1 package org.rcfaces.core.component;
2
3 import org.rcfaces.core.internal.component.CameliaItemsComponent;
4 import org.rcfaces.core.internal.component.Properties;
5 import java.lang.Object;
6 import org.apache.commons.logging.LogFactory;
7 import java.lang.String;
8 import org.rcfaces.core.internal.manager.IClientDataManager;
9 import javax.faces.context.FacesContext;
10 import org.rcfaces.core.internal.component.IDataMapAccessor;
11 import org.rcfaces.core.internal.manager.IServerDataManager;
12 import org.rcfaces.core.internal.tools.SelectItemsIteratorTools;
13 import javax.faces.FacesException;
14 import javax.el.ValueExpression;
15 import java.util.HashSet;
16 import org.apache.commons.logging.Log;
17 import java.util.Set;
18 import java.util.Arrays;
19
20 public class SelectItemsIteratorComponent extends CameliaItemsComponent implements
21 IClientDataManager,
22 IServerDataManager {
23
24 private static final Log LOG = LogFactory.getLog(SelectItemsIteratorComponent.class);
25
26 public static final String COMPONENT_TYPE="org.rcfaces.core.selectItemsIterator";
27
28 protected static final Set CAMELIA_ATTRIBUTES=new HashSet(CameliaItemsComponent.CAMELIA_ATTRIBUTES);
29 static {
30 CAMELIA_ATTRIBUTES.addAll(Arrays.asList(new String[] {"itemImageURL","itemAcceleratorKey","var","itemHoverImageURL","itemVisibility","itemGroupName","itemExpandedImageURL","itemSelectedImageURL","itemDescription","itemIndexVar","items","itemLabel","itemValue","itemInputType","itemDisabledImageURL","itemAccessKey","itemStyleClass","itemDisabled"}));
31 }
32
33 public SelectItemsIteratorComponent() {
34 setRendererType(null);
35 }
36
37 public SelectItemsIteratorComponent(String componentId) {
38 this();
39 setId(componentId);
40 }
41
42 public void setClientData(String name, ValueExpression value) {
43
44
45 IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(null, "clientData", true);
46
47 dataMapAccessor.setData(name, value, null);
48
49 }
50
51 public String setClientData(String name, String value) {
52
53
54 IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(null, "clientData", true);
55
56 return (String)dataMapAccessor.setData(name, value, null);
57
58 }
59
60 public void setServerData(String name, ValueExpression value) {
61
62
63 IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(null, "serverData", true);
64
65 dataMapAccessor.setData(name, value, null);
66
67 }
68
69 public Object setServerData(String name, Object value) {
70
71
72 IDataMapAccessor dataMapAccessor=engine.getDataMapAccessor(null, "serverData", true);
73
74 return dataMapAccessor.setData(name, value, null);
75
76 }
77
78 public void setValue(Object value) {
79
80
81 throw new FacesException("Can not set value of 'SelectItemsIterator', use 'items' attribute to set the collection.");
82
83 }
84
85 public Object getValue() {
86
87
88 return getValue(null);
89
90 }
91
92 public Object getValue(FacesContext context) {
93
94
95 return SelectItemsIteratorTools.getValue(this, context);
96
97 }
98
99 public IDataMapAccessor getClientMapAccessor(FacesContext context) {
100
101
102 return engine.getDataMapAccessor(context, "clientData", false);
103
104 }
105
106 public IDataMapAccessor getServerMapAccessor(FacesContext context) {
107
108
109 return engine.getDataMapAccessor(context, "serverData", false);
110
111 }
112
113 public Object getItems() {
114 return getItems(null);
115 }
116
117 public Object getItems(javax.faces.context.FacesContext facesContext) {
118 return engine.getValue(Properties.ITEMS, facesContext);
119 }
120
121 public void setItems(Object items) {
122 engine.setValue(Properties.ITEMS, items);
123 }
124
125
126
127
128
129 public boolean isItemsSetted() {
130 return engine.isPropertySetted(Properties.ITEMS);
131 }
132
133 public String getVar() {
134 return getVar(null);
135 }
136
137 public String getVar(javax.faces.context.FacesContext facesContext) {
138 return engine.getStringProperty(Properties.VAR, facesContext);
139 }
140
141 public void setVar(String var) {
142 engine.setProperty(Properties.VAR, var);
143 }
144
145
146
147
148
149 public boolean isVarSetted() {
150 return engine.isPropertySetted(Properties.VAR);
151 }
152
153 public String getItemIndexVar() {
154 return getItemIndexVar(null);
155 }
156
157 public String getItemIndexVar(javax.faces.context.FacesContext facesContext) {
158 return engine.getStringProperty(Properties.ITEM_INDEX_VAR, facesContext);
159 }
160
161 public void setItemIndexVar(String itemIndexVar) {
162 engine.setProperty(Properties.ITEM_INDEX_VAR, itemIndexVar);
163 }
164
165
166
167
168
169 public boolean isItemIndexVarSetted() {
170 return engine.isPropertySetted(Properties.ITEM_INDEX_VAR);
171 }
172
173 public String getItemLabel() {
174 return getItemLabel(null);
175 }
176
177 public String getItemLabel(javax.faces.context.FacesContext facesContext) {
178 return engine.getStringProperty(Properties.ITEM_LABEL, facesContext);
179 }
180
181 public void setItemLabel(String itemLabel) {
182 engine.setProperty(Properties.ITEM_LABEL, itemLabel);
183 }
184
185
186
187
188
189 public boolean isItemLabelSetted() {
190 return engine.isPropertySetted(Properties.ITEM_LABEL);
191 }
192
193 public Object getItemValue() {
194 return getItemValue(null);
195 }
196
197 public Object getItemValue(javax.faces.context.FacesContext facesContext) {
198 return engine.getValue(Properties.ITEM_VALUE, facesContext);
199 }
200
201 public void setItemValue(Object itemValue) {
202 engine.setValue(Properties.ITEM_VALUE, itemValue);
203 }
204
205
206
207
208
209 public boolean isItemValueSetted() {
210 return engine.isPropertySetted(Properties.ITEM_VALUE);
211 }
212
213 public boolean isItemDisabled() {
214 return isItemDisabled(null);
215 }
216
217 public boolean isItemDisabled(javax.faces.context.FacesContext facesContext) {
218 return engine.getBoolProperty(Properties.ITEM_DISABLED, false, facesContext);
219 }
220
221 public void setItemDisabled(boolean itemDisabled) {
222 engine.setProperty(Properties.ITEM_DISABLED, itemDisabled);
223 }
224
225
226
227
228
229 public boolean isItemDisabledSetted() {
230 return engine.isPropertySetted(Properties.ITEM_DISABLED);
231 }
232
233 public String getItemDescription() {
234 return getItemDescription(null);
235 }
236
237 public String getItemDescription(javax.faces.context.FacesContext facesContext) {
238 return engine.getStringProperty(Properties.ITEM_DESCRIPTION, facesContext);
239 }
240
241 public void setItemDescription(String itemDescription) {
242 engine.setProperty(Properties.ITEM_DESCRIPTION, itemDescription);
243 }
244
245
246
247
248
249 public boolean isItemDescriptionSetted() {
250 return engine.isPropertySetted(Properties.ITEM_DESCRIPTION);
251 }
252
253 public String getItemAccessKey() {
254 return getItemAccessKey(null);
255 }
256
257 public String getItemAccessKey(javax.faces.context.FacesContext facesContext) {
258 return engine.getStringProperty(Properties.ITEM_ACCESS_KEY, facesContext);
259 }
260
261 public void setItemAccessKey(String itemAccessKey) {
262 engine.setProperty(Properties.ITEM_ACCESS_KEY, itemAccessKey);
263 }
264
265
266
267
268
269 public boolean isItemAccessKeySetted() {
270 return engine.isPropertySetted(Properties.ITEM_ACCESS_KEY);
271 }
272
273 public String getItemAcceleratorKey() {
274 return getItemAcceleratorKey(null);
275 }
276
277 public String getItemAcceleratorKey(javax.faces.context.FacesContext facesContext) {
278 return engine.getStringProperty(Properties.ITEM_ACCELERATOR_KEY, facesContext);
279 }
280
281 public void setItemAcceleratorKey(String itemAcceleratorKey) {
282 engine.setProperty(Properties.ITEM_ACCELERATOR_KEY, itemAcceleratorKey);
283 }
284
285
286
287
288
289 public boolean isItemAcceleratorKeySetted() {
290 return engine.isPropertySetted(Properties.ITEM_ACCELERATOR_KEY);
291 }
292
293 public String getItemGroupName() {
294 return getItemGroupName(null);
295 }
296
297 public String getItemGroupName(javax.faces.context.FacesContext facesContext) {
298 return engine.getStringProperty(Properties.ITEM_GROUP_NAME, facesContext);
299 }
300
301 public void setItemGroupName(String itemGroupName) {
302 engine.setProperty(Properties.ITEM_GROUP_NAME, itemGroupName);
303 }
304
305
306
307
308
309 public boolean isItemGroupNameSetted() {
310 return engine.isPropertySetted(Properties.ITEM_GROUP_NAME);
311 }
312
313 public String getItemInputType() {
314 return getItemInputType(null);
315 }
316
317 public String getItemInputType(javax.faces.context.FacesContext facesContext) {
318 return engine.getStringProperty(Properties.ITEM_INPUT_TYPE, facesContext);
319 }
320
321 public void setItemInputType(String itemInputType) {
322 engine.setProperty(Properties.ITEM_INPUT_TYPE, itemInputType);
323 }
324
325
326
327
328
329 public boolean isItemInputTypeSetted() {
330 return engine.isPropertySetted(Properties.ITEM_INPUT_TYPE);
331 }
332
333 public String getItemStyleClass() {
334 return getItemStyleClass(null);
335 }
336
337 public String getItemStyleClass(javax.faces.context.FacesContext facesContext) {
338 return engine.getStringProperty(Properties.ITEM_STYLE_CLASS, facesContext);
339 }
340
341 public void setItemStyleClass(String itemStyleClass) {
342 engine.setProperty(Properties.ITEM_STYLE_CLASS, itemStyleClass);
343 }
344
345
346
347
348
349 public boolean isItemStyleClassSetted() {
350 return engine.isPropertySetted(Properties.ITEM_STYLE_CLASS);
351 }
352
353 public String getItemImageURL() {
354 return getItemImageURL(null);
355 }
356
357 public String getItemImageURL(javax.faces.context.FacesContext facesContext) {
358 return engine.getStringProperty(Properties.ITEM_IMAGE_URL, facesContext);
359 }
360
361 public void setItemImageURL(String itemImageURL) {
362 engine.setProperty(Properties.ITEM_IMAGE_URL, itemImageURL);
363 }
364
365
366
367
368
369 public boolean isItemImageURLSetted() {
370 return engine.isPropertySetted(Properties.ITEM_IMAGE_URL);
371 }
372
373 public String getItemDisabledImageURL() {
374 return getItemDisabledImageURL(null);
375 }
376
377 public String getItemDisabledImageURL(javax.faces.context.FacesContext facesContext) {
378 return engine.getStringProperty(Properties.ITEM_DISABLED_IMAGE_URL, facesContext);
379 }
380
381 public void setItemDisabledImageURL(String itemDisabledImageURL) {
382 engine.setProperty(Properties.ITEM_DISABLED_IMAGE_URL, itemDisabledImageURL);
383 }
384
385
386
387
388
389 public boolean isItemDisabledImageURLSetted() {
390 return engine.isPropertySetted(Properties.ITEM_DISABLED_IMAGE_URL);
391 }
392
393 public String getItemHoverImageURL() {
394 return getItemHoverImageURL(null);
395 }
396
397 public String getItemHoverImageURL(javax.faces.context.FacesContext facesContext) {
398 return engine.getStringProperty(Properties.ITEM_HOVER_IMAGE_URL, facesContext);
399 }
400
401 public void setItemHoverImageURL(String itemHoverImageURL) {
402 engine.setProperty(Properties.ITEM_HOVER_IMAGE_URL, itemHoverImageURL);
403 }
404
405
406
407
408
409 public boolean isItemHoverImageURLSetted() {
410 return engine.isPropertySetted(Properties.ITEM_HOVER_IMAGE_URL);
411 }
412
413 public String getItemSelectedImageURL() {
414 return getItemSelectedImageURL(null);
415 }
416
417 public String getItemSelectedImageURL(javax.faces.context.FacesContext facesContext) {
418 return engine.getStringProperty(Properties.ITEM_SELECTED_IMAGE_URL, facesContext);
419 }
420
421 public void setItemSelectedImageURL(String itemSelectedImageURL) {
422 engine.setProperty(Properties.ITEM_SELECTED_IMAGE_URL, itemSelectedImageURL);
423 }
424
425
426
427
428
429 public boolean isItemSelectedImageURLSetted() {
430 return engine.isPropertySetted(Properties.ITEM_SELECTED_IMAGE_URL);
431 }
432
433 public String getItemExpandedImageURL() {
434 return getItemExpandedImageURL(null);
435 }
436
437 public String getItemExpandedImageURL(javax.faces.context.FacesContext facesContext) {
438 return engine.getStringProperty(Properties.ITEM_EXPANDED_IMAGE_URL, facesContext);
439 }
440
441 public void setItemExpandedImageURL(String itemExpandedImageURL) {
442 engine.setProperty(Properties.ITEM_EXPANDED_IMAGE_URL, itemExpandedImageURL);
443 }
444
445
446
447
448
449 public boolean isItemExpandedImageURLSetted() {
450 return engine.isPropertySetted(Properties.ITEM_EXPANDED_IMAGE_URL);
451 }
452
453 public boolean isItemVisibility() {
454 return isItemVisibility(null);
455 }
456
457 public boolean isItemVisibility(javax.faces.context.FacesContext facesContext) {
458 return engine.getBoolProperty(Properties.ITEM_VISIBILITY, false, facesContext);
459 }
460
461 public void setItemVisibility(boolean itemVisibility) {
462 engine.setProperty(Properties.ITEM_VISIBILITY, itemVisibility);
463 }
464
465
466
467
468
469 public boolean isItemVisibilitySetted() {
470 return engine.isPropertySetted(Properties.ITEM_VISIBILITY);
471 }
472
473 protected Set getCameliaFields() {
474 return CAMELIA_ATTRIBUTES;
475 }
476 }