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.AbstractUIColumnNode;
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
46 public class UIColumnNode
47 extends AbstractUIColumnNode implements SupportsMarkup {
48
49 public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.ColumnNode";
50
51 public static final String COMPONENT_FAMILY = "javax.faces.Column";
52
53 private org.apache.myfaces.tobago.context.Markup currentMarkup;
54
55 enum PropertyKeys {
56 markup,
57 marginLeft,
58 minimumHeight,
59 borderLeft,
60 tip,
61 height,
62 minimumWidth,
63 overflowX,
64 rowSpan,
65 resizable,
66 overflowY,
67 left,
68 columnSpan,
69 borderRight,
70 paddingBottom,
71 top,
72 maximumHeight,
73 currentWidth,
74 paddingTop,
75 marginTop,
76 width,
77 marginRight,
78 currentHeight,
79 preferredHeight,
80 label,
81 display,
82 borderBottom,
83 maximumWidth,
84 paddingLeft,
85 paddingRight,
86 preferredWidth,
87 marginBottom,
88 verticalIndex,
89 borderTop,
90 horizontalIndex,
91 disabled,
92 }
93
94 public String getFamily() {
95 return COMPONENT_FAMILY;
96 }
97
98
99 public org.apache.myfaces.tobago.context.Markup getMarkup() {
100 Object object = getStateHelper().eval(PropertyKeys.markup);
101 if (object != null) {
102 return Markup.valueOf(object);
103 }
104 return null;
105 }
106
107 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
108 getStateHelper().put(PropertyKeys.markup, markup);
109 }
110
111 public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
112 Object object = getStateHelper().eval(PropertyKeys.marginLeft);
113 if (object != null) {
114 return Measure.valueOf(object);
115 }
116 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this);
117 }
118
119 public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
120 getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
121 }
122
123 public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
124 Object object = getStateHelper().eval(PropertyKeys.minimumHeight);
125 if (object != null) {
126 return Measure.valueOf(object);
127 }
128 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this);
129 }
130
131 public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
132 getStateHelper().put(PropertyKeys.minimumHeight, minimumHeight);
133 }
134
135
136
137
138
139 public org.apache.myfaces.tobago.layout.Measure getBorderLeft() {
140 Object object = getStateHelper().eval(PropertyKeys.borderLeft);
141 if (object != null) {
142 return Measure.valueOf(object);
143 }
144 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
145 getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this);
146 }
147
148 public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) {
149 getStateHelper().put(PropertyKeys.borderLeft, borderLeft);
150 }
151
152
153
154
155
156 public java.lang.String getTip() {
157 return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
158 }
159
160 public void setTip(java.lang.String tip) {
161 getStateHelper().put(PropertyKeys.tip, tip);
162 }
163
164
165
166
167
168 public org.apache.myfaces.tobago.layout.Measure getHeight() {
169 Object object = getStateHelper().eval(PropertyKeys.height);
170 if (object != null) {
171 return Measure.valueOf(object);
172 }
173 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this);
174 }
175
176 public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
177 getStateHelper().put(PropertyKeys.height, height);
178 }
179
180 public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
181 Object object = getStateHelper().eval(PropertyKeys.minimumWidth);
182 if (object != null) {
183 return Measure.valueOf(object);
184 }
185 return ((LayoutComponentRenderer)getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this);
186 }
187
188 public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
189 getStateHelper().put(PropertyKeys.minimumWidth, minimumWidth);
190 }
191
192
193
194
195
196 public boolean isOverflowX() {
197 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowX);
198 if (bool != null) {
199 return bool;
200 }
201 return false;
202 }
203
204 public void setOverflowX(boolean overflowX) {
205 getStateHelper().put(PropertyKeys.overflowX, overflowX);
206 }
207
208 public java.lang.Integer getRowSpan() {
209 Number value = (Number) getStateHelper().eval(PropertyKeys.rowSpan);
210 if (value != null) {
211 return value.intValue();
212 }
213 return 1;
214 }
215
216 public void setRowSpan(java.lang.Integer rowSpan) {
217 getStateHelper().put(PropertyKeys.rowSpan, rowSpan);
218 }
219
220
221
222
223
224 public boolean isResizable() {
225 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.resizable);
226 if (bool != null) {
227 return bool;
228 }
229 return true;
230 }
231
232 public void setResizable(boolean resizable) {
233 getStateHelper().put(PropertyKeys.resizable, resizable);
234 }
235
236
237
238
239
240 public boolean isOverflowY() {
241 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowY);
242 if (bool != null) {
243 return bool;
244 }
245 return false;
246 }
247
248 public void setOverflowY(boolean overflowY) {
249 getStateHelper().put(PropertyKeys.overflowY, overflowY);
250 }
251
252
253
254
255
256 public org.apache.myfaces.tobago.layout.Measure getLeft() {
257 Object object = getStateHelper().eval(PropertyKeys.left);
258 if (object != null) {
259 return Measure.valueOf(object);
260 }
261 return null;
262 }
263
264 public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
265 getStateHelper().put(PropertyKeys.left, left);
266 }
267
268 public java.lang.Integer getColumnSpan() {
269 Number value = (Number) getStateHelper().eval(PropertyKeys.columnSpan);
270 if (value != null) {
271 return value.intValue();
272 }
273 return 1;
274 }
275
276 public void setColumnSpan(java.lang.Integer columnSpan) {
277 getStateHelper().put(PropertyKeys.columnSpan, columnSpan);
278 }
279
280
281
282
283
284 public org.apache.myfaces.tobago.layout.Measure getBorderRight() {
285 Object object = getStateHelper().eval(PropertyKeys.borderRight);
286 if (object != null) {
287 return Measure.valueOf(object);
288 }
289 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
290 getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this);
291 }
292
293 public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) {
294 getStateHelper().put(PropertyKeys.borderRight, borderRight);
295 }
296
297
298
299
300
301 public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() {
302 Object object = getStateHelper().eval(PropertyKeys.paddingBottom);
303 if (object != null) {
304 return Measure.valueOf(object);
305 }
306 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
307 getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this);
308 }
309
310 public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) {
311 getStateHelper().put(PropertyKeys.paddingBottom, paddingBottom);
312 }
313
314
315
316
317
318 public org.apache.myfaces.tobago.layout.Measure getTop() {
319 Object object = getStateHelper().eval(PropertyKeys.top);
320 if (object != null) {
321 return Measure.valueOf(object);
322 }
323 return null;
324 }
325
326 public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
327 getStateHelper().put(PropertyKeys.top, top);
328 }
329
330 public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
331 Object object = getStateHelper().eval(PropertyKeys.maximumHeight);
332 if (object != null) {
333 return Measure.valueOf(object);
334 }
335 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this);
336 }
337
338 public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
339 getStateHelper().put(PropertyKeys.maximumHeight, maximumHeight);
340 }
341
342
343
344
345
346 public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
347 Object object = getStateHelper().eval(PropertyKeys.currentWidth);
348 if (object != null) {
349 return Measure.valueOf(object);
350 }
351 return getWidth();
352 }
353
354 public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
355 getStateHelper().put(PropertyKeys.currentWidth, currentWidth);
356 }
357
358
359
360
361
362 public org.apache.myfaces.tobago.layout.Measure getPaddingTop() {
363 Object object = getStateHelper().eval(PropertyKeys.paddingTop);
364 if (object != null) {
365 return Measure.valueOf(object);
366 }
367 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
368 getRenderer(getFacesContext())).getPaddingTop(getFacesContext(), this);
369 }
370
371 public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) {
372 getStateHelper().put(PropertyKeys.paddingTop, paddingTop);
373 }
374
375 public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
376 Object object = getStateHelper().eval(PropertyKeys.marginTop);
377 if (object != null) {
378 return Measure.valueOf(object);
379 }
380 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this);
381 }
382
383 public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
384 getStateHelper().put(PropertyKeys.marginTop, marginTop);
385 }
386
387
388
389
390
391 public org.apache.myfaces.tobago.layout.Measure getWidth() {
392 Object object = getStateHelper().eval(PropertyKeys.width);
393 if (object != null) {
394 return Measure.valueOf(object);
395 }
396 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this);
397 }
398
399 public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
400 getStateHelper().put(PropertyKeys.width, width);
401 }
402
403 public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
404 Object object = getStateHelper().eval(PropertyKeys.marginRight);
405 if (object != null) {
406 return Measure.valueOf(object);
407 }
408 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this);
409 }
410
411 public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
412 getStateHelper().put(PropertyKeys.marginRight, marginRight);
413 }
414
415
416
417
418
419 public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
420 Object object = getStateHelper().eval(PropertyKeys.currentHeight);
421 if (object != null) {
422 return Measure.valueOf(object);
423 }
424 return getHeight();
425 }
426
427 public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
428 getStateHelper().put(PropertyKeys.currentHeight, currentHeight);
429 }
430
431 public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
432 Object object = getStateHelper().eval(PropertyKeys.preferredHeight);
433 if (object != null) {
434 return Measure.valueOf(object);
435 }
436 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this);
437 }
438
439 public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
440 getStateHelper().put(PropertyKeys.preferredHeight, preferredHeight);
441 }
442
443
444
445
446
447
448 public java.lang.String getLabel() {
449 return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
450 }
451
452 public void setLabel(java.lang.String label) {
453 getStateHelper().put(PropertyKeys.label, label);
454 }
455
456
457
458
459
460 public org.apache.myfaces.tobago.layout.Display getDisplay() {
461 return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
462 }
463
464 public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
465 getStateHelper().put(PropertyKeys.display, display);
466 }
467
468
469
470
471
472 public org.apache.myfaces.tobago.layout.Measure getBorderBottom() {
473 Object object = getStateHelper().eval(PropertyKeys.borderBottom);
474 if (object != null) {
475 return Measure.valueOf(object);
476 }
477 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
478 getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this);
479 }
480
481 public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) {
482 getStateHelper().put(PropertyKeys.borderBottom, borderBottom);
483 }
484
485 public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
486 Object object = getStateHelper().eval(PropertyKeys.maximumWidth);
487 if (object != null) {
488 return Measure.valueOf(object);
489 }
490 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this);
491 }
492
493 public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
494 getStateHelper().put(PropertyKeys.maximumWidth, maximumWidth);
495 }
496
497
498
499
500
501 public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() {
502 Object object = getStateHelper().eval(PropertyKeys.paddingLeft);
503 if (object != null) {
504 return Measure.valueOf(object);
505 }
506 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
507 getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this);
508 }
509
510 public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) {
511 getStateHelper().put(PropertyKeys.paddingLeft, paddingLeft);
512 }
513
514
515
516
517
518 public org.apache.myfaces.tobago.layout.Measure getPaddingRight() {
519 Object object = getStateHelper().eval(PropertyKeys.paddingRight);
520 if (object != null) {
521 return Measure.valueOf(object);
522 }
523 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
524 getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this);
525 }
526
527 public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) {
528 getStateHelper().put(PropertyKeys.paddingRight, paddingRight);
529 }
530
531 public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
532 Object object = getStateHelper().eval(PropertyKeys.preferredWidth);
533 if (object != null) {
534 return Measure.valueOf(object);
535 }
536 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this);
537 }
538
539 public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
540 getStateHelper().put(PropertyKeys.preferredWidth, preferredWidth);
541 }
542
543 public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
544 Object object = getStateHelper().eval(PropertyKeys.marginBottom);
545 if (object != null) {
546 return Measure.valueOf(object);
547 }
548 return ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this);
549 }
550
551 public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
552 getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
553 }
554
555
556
557
558
559 public java.lang.Integer getVerticalIndex() {
560 Number value = (Number) getStateHelper().eval(PropertyKeys.verticalIndex);
561 if (value != null) {
562 return value.intValue();
563 }
564 return null;
565 }
566
567 public void setVerticalIndex(java.lang.Integer verticalIndex) {
568 getStateHelper().put(PropertyKeys.verticalIndex, verticalIndex);
569 }
570
571
572
573
574
575 public org.apache.myfaces.tobago.layout.Measure getBorderTop() {
576 Object object = getStateHelper().eval(PropertyKeys.borderTop);
577 if (object != null) {
578 return Measure.valueOf(object);
579 }
580 return ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
581 getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this);
582 }
583
584 public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) {
585 getStateHelper().put(PropertyKeys.borderTop, borderTop);
586 }
587
588 public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
589 if (currentMarkup != null) {
590 return currentMarkup;
591 }
592 return null;
593 }
594
595 public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
596 this.currentMarkup = currentMarkup;
597 }
598
599
600
601
602
603 public java.lang.Integer getHorizontalIndex() {
604 Number value = (Number) getStateHelper().eval(PropertyKeys.horizontalIndex);
605 if (value != null) {
606 return value.intValue();
607 }
608 return null;
609 }
610
611 public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
612 getStateHelper().put(PropertyKeys.horizontalIndex, horizontalIndex);
613 }
614
615
616
617
618
619 public boolean isDisabled() {
620 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
621 if (bool != null) {
622 return bool;
623 }
624 return false;
625 }
626
627 public void setDisabled(boolean disabled) {
628 getStateHelper().put(PropertyKeys.disabled, disabled);
629 }
630
631 public Object saveState(FacesContext context) {
632 currentMarkup = null;
633 return super.saveState(context);
634 }
635
636
637 }