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