1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.uif.field;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
21 import org.kuali.rice.krad.uif.component.Component;
22 import org.kuali.rice.krad.uif.element.Header;
23 import org.kuali.rice.krad.uif.element.Image;
24 import org.kuali.rice.krad.uif.element.Message;
25 import org.kuali.rice.krad.uif.view.View;
26
27 import java.util.List;
28
29
30
31
32
33
34
35
36
37
38
39 @BeanTag(name = "imageField-bean", parent = "Uif-ImageField")
40 public class ImageField extends FieldBase {
41 private static final long serialVersionUID = -7994212503770623408L;
42
43 private Image image;
44
45 public ImageField() {
46 super();
47 }
48
49
50
51
52
53
54
55
56
57 @Override
58 public void performFinalize(View view, Object model, Component parent) {
59 super.performFinalize(view, model, parent);
60
61
62 if (this.getFieldLabel() != null && this.getImage() != null && StringUtils.isNotBlank(this.getImage().getId())) {
63 this.getFieldLabel().setLabelForComponentId(this.getImage().getId());
64 }
65 }
66
67
68
69
70 @Override
71 public List<Component> getComponentsForLifecycle() {
72 List<Component> components = super.getComponentsForLifecycle();
73
74 components.add(image);
75
76 return components;
77 }
78
79
80
81
82
83
84 @BeanTagAttribute(name="image",type= BeanTagAttribute.AttributeType.SINGLEBEAN)
85 public Image getImage() {
86 return image;
87 }
88
89
90
91
92
93
94 public void setImage(Image image) {
95 this.image = image;
96 }
97
98
99
100
101
102
103
104 @BeanTagAttribute(name="source")
105 public String getSource() {
106 return image.getSource();
107 }
108
109
110
111
112
113
114 public void setSource(String source) {
115 image.setSource(source);
116 }
117
118
119
120
121
122
123
124
125
126
127
128
129 @BeanTagAttribute(name="altText")
130 public String getAltText() {
131 return image.getAltText();
132 }
133
134
135
136
137
138
139 public void setAltText(String altText) {
140 image.setAltText(altText);
141 }
142
143
144
145
146
147
148 @BeanTagAttribute(name="height")
149 public String getHeight() {
150 return image.getHeight();
151 }
152
153
154
155
156
157
158 public void setHeight(String height) {
159 image.setHeight(height);
160 }
161
162
163
164
165
166
167 public void setWidth(String width) {
168 image.setWidth(width);
169 }
170
171
172
173
174
175
176 @BeanTagAttribute(name="width")
177 public String getWidth() {
178 return image.getWidth();
179 }
180
181
182
183
184
185
186 @BeanTagAttribute(name="captionHeaderText")
187 public String getCaptionHeaderText() {
188 return image.getCaptionHeaderText();
189 }
190
191
192
193
194
195
196 public void setCaptionHeaderText(String captionHeaderText) {
197 image.setCaptionHeaderText(captionHeaderText);
198 }
199
200
201
202
203
204
205 @BeanTagAttribute(name="captionHeader",type= BeanTagAttribute.AttributeType.SINGLEBEAN)
206 public Header getCaptionHeader() {
207 return image.getCaptionHeader();
208 }
209
210
211
212
213
214
215 public void setCaptionHeader(Header captionHeader) {
216 image.setCaptionHeader(captionHeader);
217 }
218
219
220
221
222
223
224 @BeanTagAttribute(name="cutlineText")
225 public String getCutlineText() {
226 return image.getCutlineText();
227 }
228
229
230
231
232
233
234 public void setCutlineText(String cutlineText) {
235 image.setCutlineText(cutlineText);
236 }
237
238
239
240
241
242
243 @BeanTagAttribute(name="cutline",type= BeanTagAttribute.AttributeType.SINGLEBEAN)
244 public Message getCutline() {
245 return image.getCutlineMessage();
246 }
247
248
249
250
251
252
253 public void setCutline(Message cutline) {
254 image.setCutlineMessage(cutline);
255 }
256
257
258
259
260
261
262 @BeanTagAttribute(name="captionHeaderAboveImage")
263 public boolean isCaptionHeaderAboveImage() {
264 return image.isCaptionHeaderPlacementAboveImage();
265 }
266
267
268
269
270
271
272 public void setCaptionHeaderAboveImage(boolean captionHeaderAboveImage) {
273 image.setCaptionHeaderPlacementAboveImage(captionHeaderAboveImage);
274 }
275 }