1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.internal.component.Properties;
4 import org.rcfaces.core.component.familly.IContentAccessors;
5 import java.lang.String;
6 import org.apache.commons.logging.LogFactory;
7 import org.rcfaces.core.component.capability.IShowDropDownMarkCapability;
8 import javax.faces.context.FacesContext;
9 import org.rcfaces.core.internal.tools.ImageAccessorTools;
10 import org.rcfaces.core.component.capability.IHorizontalTextPositionCapability;
11 import javax.faces.convert.Converter;
12 import javax.el.ValueExpression;
13 import java.util.HashSet;
14 import org.apache.commons.logging.Log;
15 import java.util.Set;
16 import java.util.Arrays;
17 import org.rcfaces.core.component.AbstractMenuComponent;
18 import org.rcfaces.core.component.familly.IImageButtonFamilly;
19 import org.rcfaces.core.internal.converter.TextPositionConverter;
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65 public class ImageComboComponent extends AbstractMenuComponent implements
66 IImageButtonFamilly,
67 IShowDropDownMarkCapability {
68
69 private static final Log LOG = LogFactory.getLog(ImageComboComponent.class);
70
71 public static final String COMPONENT_TYPE="org.rcfaces.core.imageCombo";
72
73 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(AbstractMenuComponent.CAMELIA_ATTRIBUTES);
74 static {
75 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"disabledImageURL","imageHeight","text","popupRowNumber","showDropDownMark","borderType","textPosition","hoverImageURL","tabIndex","selectedImageURL","selectionListener","readOnly","border","imageURL","disabled","imageWidth"}));
76 }
77
78 public ImageComboComponent() {
79 setRendererType(COMPONENT_TYPE);
80 }
81
82 public ImageComboComponent(String componentId) {
83 this();
84 setId(componentId);
85 }
86
87 protected Converter getTextPositionConverter() {
88
89
90 return TextPositionConverter.SINGLETON;
91
92 }
93
94 public void setTextPosition(String textPosition) {
95
96
97 setTextPosition(((Integer)getTextPositionConverter().getAsObject(null, this, textPosition)).intValue());
98
99 }
100
101 public java.lang.String getImageURL() {
102 return getImageURL(null);
103 }
104
105
106
107
108 public java.lang.String getImageURL(javax.faces.context.FacesContext facesContext) {
109 return engine.getStringProperty(Properties.IMAGE_URL, facesContext);
110 }
111
112
113
114
115
116 public final boolean isImageURLSetted() {
117 return engine.isPropertySetted(Properties.IMAGE_URL);
118 }
119
120 public void setImageURL(java.lang.String imageURL) {
121 engine.setProperty(Properties.IMAGE_URL, imageURL);
122 }
123
124 public java.lang.String getDisabledImageURL() {
125 return getDisabledImageURL(null);
126 }
127
128
129
130
131 public java.lang.String getDisabledImageURL(javax.faces.context.FacesContext facesContext) {
132 return engine.getStringProperty(Properties.DISABLED_IMAGE_URL, facesContext);
133 }
134
135
136
137
138
139 public final boolean isDisabledImageURLSetted() {
140 return engine.isPropertySetted(Properties.DISABLED_IMAGE_URL);
141 }
142
143 public void setDisabledImageURL(java.lang.String disabledImageURL) {
144 engine.setProperty(Properties.DISABLED_IMAGE_URL, disabledImageURL);
145 }
146
147 public java.lang.String getHoverImageURL() {
148 return getHoverImageURL(null);
149 }
150
151
152
153
154 public java.lang.String getHoverImageURL(javax.faces.context.FacesContext facesContext) {
155 return engine.getStringProperty(Properties.HOVER_IMAGE_URL, facesContext);
156 }
157
158
159
160
161
162 public final boolean isHoverImageURLSetted() {
163 return engine.isPropertySetted(Properties.HOVER_IMAGE_URL);
164 }
165
166 public void setHoverImageURL(java.lang.String hoverImageURL) {
167 engine.setProperty(Properties.HOVER_IMAGE_URL, hoverImageURL);
168 }
169
170 public java.lang.String getSelectedImageURL() {
171 return getSelectedImageURL(null);
172 }
173
174
175
176
177 public java.lang.String getSelectedImageURL(javax.faces.context.FacesContext facesContext) {
178 return engine.getStringProperty(Properties.SELECTED_IMAGE_URL, facesContext);
179 }
180
181
182
183
184
185 public final boolean isSelectedImageURLSetted() {
186 return engine.isPropertySetted(Properties.SELECTED_IMAGE_URL);
187 }
188
189 public void setSelectedImageURL(java.lang.String selectedImageURL) {
190 engine.setProperty(Properties.SELECTED_IMAGE_URL, selectedImageURL);
191 }
192
193 public boolean isBorder() {
194 return isBorder(null);
195 }
196
197
198
199
200 public boolean isBorder(javax.faces.context.FacesContext facesContext) {
201 return engine.getBoolProperty(Properties.BORDER, true, facesContext);
202 }
203
204
205
206
207
208 public final boolean isBorderSetted() {
209 return engine.isPropertySetted(Properties.BORDER);
210 }
211
212 public void setBorder(boolean border) {
213 engine.setProperty(Properties.BORDER, border);
214 }
215
216 public java.lang.String getBorderType() {
217 return getBorderType(null);
218 }
219
220
221
222
223 public java.lang.String getBorderType(javax.faces.context.FacesContext facesContext) {
224 return engine.getStringProperty(Properties.BORDER_TYPE, facesContext);
225 }
226
227
228
229
230
231 public final boolean isBorderTypeSetted() {
232 return engine.isPropertySetted(Properties.BORDER_TYPE);
233 }
234
235 public void setBorderType(java.lang.String borderType) {
236 engine.setProperty(Properties.BORDER_TYPE, borderType);
237 }
238
239 public java.lang.String getText() {
240 return getText(null);
241 }
242
243
244
245
246 public java.lang.String getText(javax.faces.context.FacesContext facesContext) {
247 return engine.getStringProperty(Properties.TEXT, facesContext);
248 }
249
250
251
252
253
254 public final boolean isTextSetted() {
255 return engine.isPropertySetted(Properties.TEXT);
256 }
257
258 public void setText(java.lang.String text) {
259 engine.setProperty(Properties.TEXT, text);
260 }
261
262 public int getTextPosition() {
263 return getTextPosition(null);
264 }
265
266
267
268
269 public int getTextPosition(javax.faces.context.FacesContext facesContext) {
270 return engine.getIntProperty(Properties.TEXT_POSITION,IHorizontalTextPositionCapability.DEFAULT_POSITION, facesContext);
271 }
272
273
274
275
276
277 public final boolean isTextPositionSetted() {
278 return engine.isPropertySetted(Properties.TEXT_POSITION);
279 }
280
281 public void setTextPosition(int textPosition) {
282 engine.setProperty(Properties.TEXT_POSITION, textPosition);
283 }
284
285 public int getImageHeight() {
286 return getImageHeight(null);
287 }
288
289
290
291
292 public int getImageHeight(javax.faces.context.FacesContext facesContext) {
293 return engine.getIntProperty(Properties.IMAGE_HEIGHT,0, facesContext);
294 }
295
296
297
298
299
300 public final boolean isImageHeightSetted() {
301 return engine.isPropertySetted(Properties.IMAGE_HEIGHT);
302 }
303
304 public void setImageHeight(int imageHeight) {
305 engine.setProperty(Properties.IMAGE_HEIGHT, imageHeight);
306 }
307
308 public int getImageWidth() {
309 return getImageWidth(null);
310 }
311
312
313
314
315 public int getImageWidth(javax.faces.context.FacesContext facesContext) {
316 return engine.getIntProperty(Properties.IMAGE_WIDTH,0, facesContext);
317 }
318
319
320
321
322
323 public final boolean isImageWidthSetted() {
324 return engine.isPropertySetted(Properties.IMAGE_WIDTH);
325 }
326
327 public void setImageWidth(int imageWidth) {
328 engine.setProperty(Properties.IMAGE_WIDTH, imageWidth);
329 }
330
331 public IContentAccessors getImageAccessors(FacesContext facesContext) {
332
333
334 return ImageAccessorTools.createImageAccessors(facesContext, this, engine);
335
336 }
337
338 public IContentAccessors getImageAccessors() {
339
340
341 return getImageAccessors(null);
342
343 }
344
345 public boolean isShowDropDownMark() {
346 return isShowDropDownMark(null);
347 }
348
349
350
351
352 public boolean isShowDropDownMark(javax.faces.context.FacesContext facesContext) {
353 return engine.getBoolProperty(Properties.SHOW_DROP_DOWN_MARK, false, facesContext);
354 }
355
356
357
358
359
360 public final boolean isShowDropDownMarkSetted() {
361 return engine.isPropertySetted(Properties.SHOW_DROP_DOWN_MARK);
362 }
363
364 public void setShowDropDownMark(boolean showDropDownMark) {
365 engine.setProperty(Properties.SHOW_DROP_DOWN_MARK, showDropDownMark);
366 }
367
368
369
370
371 public int getPopupRowNumber() {
372 return getPopupRowNumber(null);
373 }
374
375
376
377
378 public int getPopupRowNumber(javax.faces.context.FacesContext facesContext) {
379 return engine.getIntProperty(Properties.POPUP_ROW_NUMBER, 0, facesContext);
380 }
381
382
383
384
385 public void setPopupRowNumber(int popupRowNumber) {
386 engine.setProperty(Properties.POPUP_ROW_NUMBER, popupRowNumber);
387 }
388
389
390
391
392
393
394
395
396 public boolean isPopupRowNumberSetted() {
397 return engine.isPropertySetted(Properties.POPUP_ROW_NUMBER);
398 }
399
400 protected Set getCameliaFields() {
401 return CAMELIA_ATTRIBUTES;
402 }
403 }