1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.widget;
17
18 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
20 import org.kuali.rice.krad.uif.component.ClientSideState;
21 import org.kuali.rice.krad.uif.component.Component;
22 import org.kuali.rice.krad.uif.view.View;
23
24
25
26
27
28
29 @BeanTag(name = "disclosure-bean", parent = "Uif-Disclosure")
30 public class Disclosure extends WidgetBase {
31 private static final long serialVersionUID = 1238789480161901850L;
32
33 private String collapseImageSrc;
34 private String expandImageSrc;
35
36 private int animationSpeed;
37
38 @ClientSideState(variableName = "open")
39 private boolean defaultOpen;
40 private boolean ajaxRetrievalWhenOpened;
41
42 private boolean renderImage;
43
44 public Disclosure() {
45 super();
46
47 defaultOpen = true;
48 renderImage = true;
49
50 }
51
52
53
54
55
56
57 @Override
58 public void performApplyModel(View view, Object model, Component parent) {
59 super.performFinalize(view, model, parent);
60
61 if(ajaxRetrievalWhenOpened){
62 parent.setForceSessionPersistence(true);
63 }
64 }
65
66
67
68
69
70
71 @BeanTagAttribute(name="CollapseImageSrc")
72 public String getCollapseImageSrc() {
73 return this.collapseImageSrc;
74 }
75
76
77
78
79
80
81 public void setCollapseImageSrc(String collapseImageSrc) {
82 this.collapseImageSrc = collapseImageSrc;
83 }
84
85
86
87
88
89
90 @BeanTagAttribute(name="expandImageSrc")
91 public String getExpandImageSrc() {
92 return this.expandImageSrc;
93 }
94
95
96
97
98
99
100 public void setExpandImageSrc(String expandImageSrc) {
101 this.expandImageSrc = expandImageSrc;
102 }
103
104
105
106
107
108
109
110 @BeanTagAttribute(name="animationSpeed")
111 public int getAnimationSpeed() {
112 return this.animationSpeed;
113 }
114
115
116
117
118
119
120 public void setAnimationSpeed(int animationSpeed) {
121 this.animationSpeed = animationSpeed;
122 }
123
124
125
126
127
128
129
130 @BeanTagAttribute(name="defaultOpen")
131 public boolean isDefaultOpen() {
132 return this.defaultOpen;
133 }
134
135
136
137
138
139
140 public void setDefaultOpen(boolean defaultOpen) {
141 this.defaultOpen = defaultOpen;
142 }
143
144
145
146
147
148
149
150
151 public boolean isAjaxRetrievalWhenOpened() {
152 return ajaxRetrievalWhenOpened;
153 }
154
155
156
157
158
159
160 public void setAjaxRetrievalWhenOpened(boolean ajaxRetrievalWhenOpened) {
161 this.ajaxRetrievalWhenOpened = ajaxRetrievalWhenOpened;
162 }
163
164
165
166
167
168
169
170 @BeanTagAttribute(name="renderImage")
171 public boolean isRenderImage() {
172 return renderImage;
173 }
174
175
176
177
178
179
180 public void setRenderImage(boolean renderImage) {
181 this.renderImage = renderImage;
182 }
183
184
185
186
187 @Override
188 protected <T> void copyProperties(T component) {
189 super.copyProperties(component);
190 Disclosure disclosureCopy = (Disclosure) component;
191 disclosureCopy.setAnimationSpeed(this.animationSpeed);
192 disclosureCopy.setCollapseImageSrc(this.collapseImageSrc);
193 disclosureCopy.setDefaultOpen(this.defaultOpen);
194 disclosureCopy.setAjaxRetrievalWhenOpened(this.ajaxRetrievalWhenOpened);
195 disclosureCopy.setExpandImageSrc(this.expandImageSrc);
196 disclosureCopy.setRenderImage(this.renderImage);
197 }
198 }