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