1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.component;
21
22 import javax.faces.context.FacesContext;
23 import org.apache.myfaces.tobago.context.Markup;
24 import org.apache.myfaces.tobago.internal.component.AbstractUISelectMany;
25 import org.apache.myfaces.tobago.layout.Display;
26 import org.apache.myfaces.tobago.layout.Measure;
27 import org.apache.commons.lang.ArrayUtils;
28 import org.apache.commons.lang.StringUtils;
29 import org.apache.myfaces.tobago.internal.util.Deprecation;
30 import org.apache.myfaces.tobago.renderkit.MarginValues;
31 import org.apache.myfaces.tobago.renderkit.SpacingValues;
32 import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
33 import javax.el.ELException;
34 import javax.faces.FacesException;
35 import java.util.ArrayList;
36 import java.util.List;
37 import javax.el.MethodExpression;
38 import javax.el.ValueExpression;
39
40
41
42
43
44
45 public class UISelectManyListbox
46 extends AbstractUISelectMany implements SupportsMarkup {
47
48 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SelectManyListbox";
49
50 public static final String COMPONENT_FAMILY = "javax.faces.SelectMany";
51
52 private org.apache.myfaces.tobago.context.Markup currentMarkup;
53
54 enum PropertyKeys {
55 accessKey,
56 markup,
57 marginLeft,
58 labelWithAccessKey,
59 tabIndex,
60 minimumHeight,
61 tip,
62 height,
63 minimumWidth,
64 inline,
65 rowSpan,
66 left,
67 focus,
68 columnSpan,
69 top,
70 maximumHeight,
71 currentWidth,
72 marginTop,
73 width,
74 marginRight,
75 preferredHeight,
76 currentHeight,
77 display,
78 label,
79 maximumWidth,
80 onchange,
81 preferredWidth,
82 marginBottom,
83 verticalIndex,
84 horizontalIndex,
85 readonly,
86 disabled,
87 }
88
89 public String getFamily() {
90 return COMPONENT_FAMILY;
91 }
92
93
94
95
96
97
98 @Deprecated
99 public java.lang.Character getAccessKey() {
100 Deprecation.LOG.error("The attribute 'accessKey' of 'UISelectManyListbox' is deprecated. "
101 + "Please refer the documentation for further information.");
102 return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
103 }
104
105 @Deprecated
106 public void setAccessKey(java.lang.Character accessKey) {
107 getStateHelper().put(PropertyKeys.accessKey, accessKey);
108 }
109
110 public org.apache.myfaces.tobago.context.Markup getMarkup() {
111 Object object = getStateHelper().eval(PropertyKeys.markup);
112 if (object != null) {
113 return Markup.valueOf(object);
114 }
115 return null;
116 }
117
118 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
119 getStateHelper().put(PropertyKeys.markup, markup);
120 }
121
122 public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
123 Object object = getStateHelper().eval(PropertyKeys.marginLeft);
124 if (object != null) {
125 return Measure.valueOf(object);
126 }
127 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this);
128 }
129
130 public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
131 getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
132 }
133
134
135
136
137
138
139
140 @Deprecated
141 public java.lang.String getLabelWithAccessKey() {
142 Deprecation.LOG.error("The attribute 'labelWithAccessKey' of 'UISelectManyListbox' is deprecated. "
143 + "Please refer the documentation for further information.");
144 return (java.lang.String) getStateHelper().eval(PropertyKeys.labelWithAccessKey);
145 }
146
147 @Deprecated
148 public void setLabelWithAccessKey(java.lang.String labelWithAccessKey) {
149 getStateHelper().put(PropertyKeys.labelWithAccessKey, labelWithAccessKey);
150 }
151
152
153
154
155
156
157
158
159
160
161
162
163 public java.lang.Integer getTabIndex() {
164 Number value = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
165 if (value != null) {
166 return value.intValue();
167 }
168 return null;
169 }
170
171 public void setTabIndex(java.lang.Integer tabIndex) {
172 getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
173 }
174
175 public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
176 Object object = getStateHelper().eval(PropertyKeys.minimumHeight);
177 if (object != null) {
178 return Measure.valueOf(object);
179 }
180 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
181 }
182
183 public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
184 getStateHelper().put(PropertyKeys.minimumHeight, minimumHeight);
185 }
186
187
188
189
190
191 public java.lang.String getTip() {
192 return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
193 }
194
195 public void setTip(java.lang.String tip) {
196 getStateHelper().put(PropertyKeys.tip, tip);
197 }
198
199
200
201
202
203 public org.apache.myfaces.tobago.layout.Measure getHeight() {
204 Object object = getStateHelper().eval(PropertyKeys.height);
205 if (object != null) {
206 return Measure.valueOf(object);
207 }
208 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
209 }
210
211 public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
212 getStateHelper().put(PropertyKeys.height, height);
213 }
214
215 public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
216 Object object = getStateHelper().eval(PropertyKeys.minimumWidth);
217 if (object != null) {
218 return Measure.valueOf(object);
219 }
220 return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this);
221 }
222
223 public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
224 getStateHelper().put(PropertyKeys.minimumWidth, minimumWidth);
225 }
226
227
228
229
230
231 @Deprecated
232 public boolean isInline() {
233 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.inline);
234 if (bool != null) {
235 return bool;
236 }
237 return false;
238 }
239
240 @Deprecated
241 public void setInline(boolean inline) {
242 Deprecation.LOG.error("The attribute 'inline' of 'UISelectManyListbox' is deprecated. "
243 + "Please refer the documentation for further information.");
244 getStateHelper().put(PropertyKeys.inline, inline);
245 }
246
247 public java.lang.Integer getRowSpan() {
248 Number value = (Number) getStateHelper().eval(PropertyKeys.rowSpan);
249 if (value != null) {
250 return value.intValue();
251 }
252 return 1;
253 }
254
255 public void setRowSpan(java.lang.Integer rowSpan) {
256 getStateHelper().put(PropertyKeys.rowSpan, rowSpan);
257 }
258
259
260
261
262
263 public org.apache.myfaces.tobago.layout.Measure getLeft() {
264 Object object = getStateHelper().eval(PropertyKeys.left);
265 if (object != null) {
266 return Measure.valueOf(object);
267 }
268 return null;
269 }
270
271 public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
272 getStateHelper().put(PropertyKeys.left, left);
273 }
274
275
276
277
278
279 public boolean isFocus() {
280 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
281 if (bool != null) {
282 return bool;
283 }
284 return false;
285 }
286
287 public void setFocus(boolean focus) {
288 getStateHelper().put(PropertyKeys.focus, focus);
289 }
290
291 public java.lang.Integer getColumnSpan() {
292 Number value = (Number) getStateHelper().eval(PropertyKeys.columnSpan);
293 if (value != null) {
294 return value.intValue();
295 }
296 return 1;
297 }
298
299 public void setColumnSpan(java.lang.Integer columnSpan) {
300 getStateHelper().put(PropertyKeys.columnSpan, columnSpan);
301 }
302
303
304
305
306
307 public org.apache.myfaces.tobago.layout.Measure getTop() {
308 Object object = getStateHelper().eval(PropertyKeys.top);
309 if (object != null) {
310 return Measure.valueOf(object);
311 }
312 return null;
313 }
314
315 public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
316 getStateHelper().put(PropertyKeys.top, top);
317 }
318
319 public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
320 Object object = getStateHelper().eval(PropertyKeys.maximumHeight);
321 if (object != null) {
322 return Measure.valueOf(object);
323 }
324 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
325 }
326
327 public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
328 getStateHelper().put(PropertyKeys.maximumHeight, maximumHeight);
329 }
330
331
332
333
334
335 public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
336 Object object = getStateHelper().eval(PropertyKeys.currentWidth);
337 if (object != null) {
338 return Measure.valueOf(object);
339 }
340 return getWidth();
341 }
342
343 public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
344 getStateHelper().put(PropertyKeys.currentWidth, currentWidth);
345 }
346
347 public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
348 Object object = getStateHelper().eval(PropertyKeys.marginTop);
349 if (object != null) {
350 return Measure.valueOf(object);
351 }
352 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
353 }
354
355 public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
356 getStateHelper().put(PropertyKeys.marginTop, marginTop);
357 }
358
359
360
361
362
363 public org.apache.myfaces.tobago.layout.Measure getWidth() {
364 Object object = getStateHelper().eval(PropertyKeys.width);
365 if (object != null) {
366 return Measure.valueOf(object);
367 }
368 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
369 }
370
371 public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
372 getStateHelper().put(PropertyKeys.width, width);
373 }
374
375 public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
376 Object object = getStateHelper().eval(PropertyKeys.marginRight);
377 if (object != null) {
378 return Measure.valueOf(object);
379 }
380 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
381 }
382
383 public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
384 getStateHelper().put(PropertyKeys.marginRight, marginRight);
385 }
386
387 public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
388 Object object = getStateHelper().eval(PropertyKeys.preferredHeight);
389 if (object != null) {
390 return Measure.valueOf(object);
391 }
392 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
393 }
394
395 public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
396 getStateHelper().put(PropertyKeys.preferredHeight, preferredHeight);
397 }
398
399
400
401
402
403 public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
404 Object object = getStateHelper().eval(PropertyKeys.currentHeight);
405 if (object != null) {
406 return Measure.valueOf(object);
407 }
408 return getHeight();
409 }
410
411 public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
412 getStateHelper().put(PropertyKeys.currentHeight, currentHeight);
413 }
414
415
416
417
418
419 public org.apache.myfaces.tobago.layout.Display getDisplay() {
420 return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
421 }
422
423 public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
424 getStateHelper().put(PropertyKeys.display, display);
425 }
426
427
428
429
430
431
432 public java.lang.String getLabel() {
433 return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
434 }
435
436 public void setLabel(java.lang.String label) {
437 getStateHelper().put(PropertyKeys.label, label);
438 }
439
440 public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
441 Object object = getStateHelper().eval(PropertyKeys.maximumWidth);
442 if (object != null) {
443 return Measure.valueOf(object);
444 }
445 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
446 }
447
448 public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
449 getStateHelper().put(PropertyKeys.maximumWidth, maximumWidth);
450 }
451
452
453
454
455
456 public java.lang.String getOnchange() {
457 return (java.lang.String) getStateHelper().eval(PropertyKeys.onchange);
458 }
459
460 public void setOnchange(java.lang.String onchange) {
461 getStateHelper().put(PropertyKeys.onchange, onchange);
462 }
463
464 public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
465 Object object = getStateHelper().eval(PropertyKeys.preferredWidth);
466 if (object != null) {
467 return Measure.valueOf(object);
468 }
469 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
470 }
471
472 public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
473 getStateHelper().put(PropertyKeys.preferredWidth, preferredWidth);
474 }
475
476 public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
477 Object object = getStateHelper().eval(PropertyKeys.marginBottom);
478 if (object != null) {
479 return Measure.valueOf(object);
480 }
481 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
482 }
483
484 public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
485 getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
486 }
487
488
489
490
491
492 public java.lang.Integer getVerticalIndex() {
493 Number value = (Number) getStateHelper().eval(PropertyKeys.verticalIndex);
494 if (value != null) {
495 return value.intValue();
496 }
497 return null;
498 }
499
500 public void setVerticalIndex(java.lang.Integer verticalIndex) {
501 getStateHelper().put(PropertyKeys.verticalIndex, verticalIndex);
502 }
503
504 public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
505 if (currentMarkup != null) {
506 return currentMarkup;
507 }
508 return null;
509 }
510
511 public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
512 this.currentMarkup = currentMarkup;
513 }
514
515
516
517
518
519 public java.lang.Integer getHorizontalIndex() {
520 Number value = (Number) getStateHelper().eval(PropertyKeys.horizontalIndex);
521 if (value != null) {
522 return value.intValue();
523 }
524 return null;
525 }
526
527 public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
528 getStateHelper().put(PropertyKeys.horizontalIndex, horizontalIndex);
529 }
530
531
532
533
534
535 public boolean isReadonly() {
536 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
537 if (bool != null) {
538 return bool;
539 }
540 return false;
541 }
542
543 public void setReadonly(boolean readonly) {
544 getStateHelper().put(PropertyKeys.readonly, readonly);
545 }
546
547
548
549
550
551 public boolean isDisabled() {
552 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
553 if (bool != null) {
554 return bool;
555 }
556 return false;
557 }
558
559 public void setDisabled(boolean disabled) {
560 getStateHelper().put(PropertyKeys.disabled, disabled);
561 }
562
563 public Object saveState(FacesContext context) {
564 currentMarkup = null;
565 return super.saveState(context);
566 }
567
568
569 }