View Javadoc

1   // ---------- Attention: Generated code, please do not modify! -----------  
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.component;
21  
22  import javax.faces.component.NamingContainer;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.context.Markup;
25  import org.apache.myfaces.tobago.internal.component.AbstractUITab;
26  import org.apache.myfaces.tobago.layout.Display;
27  import org.apache.myfaces.tobago.layout.Measure;
28  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
29  import org.apache.myfaces.tobago.internal.util.StringUtils;
30  import org.apache.myfaces.tobago.internal.util.Deprecation;
31  import org.apache.myfaces.tobago.renderkit.MarginValues;
32  import org.apache.myfaces.tobago.renderkit.SpacingValues;
33  import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
34  import javax.el.ELException;
35  import javax.faces.FacesException;
36  import java.util.ArrayList;
37  import java.util.List;
38  import javax.el.MethodExpression;
39  import javax.el.ValueExpression;
40  
41  /** 
42   Renders a tab within a tab group.
43    * UIComponent class, generated from template {@code component2.0.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.component.TabTagDeclaration}.
45   */
46  public class UITab
47      extends AbstractUITab implements SupportsAccessKey, SupportsMarkup, NamingContainer {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Tab";
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Panel";
52  
53    private org.apache.myfaces.tobago.context.Markup currentMarkup;
54  
55    enum PropertyKeys {
56      markup,
57      accessKey,
58      marginLeft,
59      minimumHeight,
60      borderLeft,
61      tip,
62      height,
63      minimumWidth,
64      overflowX,
65      rowSpan,
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      image,
81      label,
82      display,
83      borderBottom,
84      maximumWidth,
85      paddingLeft,
86      paddingRight,
87      preferredWidth,
88      marginBottom,
89      verticalIndex,
90      borderTop,
91      horizontalIndex,
92      disabled,
93    }
94  
95    public String getFamily() {
96      return COMPONENT_FAMILY;
97    }
98  
99  
100   public org.apache.myfaces.tobago.context.Markup getMarkup() {
101     Object object = getStateHelper().eval(PropertyKeys.markup);
102     if (object != null) {
103       return Markup.valueOf(object);
104     }
105     return null;
106   }
107 
108   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
109     getStateHelper().put(PropertyKeys.markup, markup);
110   }
111 
112   /**
113   The access key of this control.
114 
115   */
116   public java.lang.Character getAccessKey() {
117     return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
118   }
119 
120   public void setAccessKey(java.lang.Character accessKey) {
121     getStateHelper().put(PropertyKeys.accessKey, accessKey);
122   }
123 
124   public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
125     Object object = getStateHelper().eval(PropertyKeys.marginLeft);
126     if (object != null) {
127        return Measure.valueOf(object);
128     }
129     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this) : Measure.ZERO;
130   }
131 
132   public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
133     getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
134   }
135 
136   public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
137     Object object = getStateHelper().eval(PropertyKeys.minimumHeight);
138     if (object != null) {
139        return Measure.valueOf(object);
140     }
141     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this) : Measure.ZERO;
142   }
143 
144   public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
145     getStateHelper().put(PropertyKeys.minimumHeight, minimumHeight);
146   }
147 
148   /**
149   This attribute is for internal use only.
150 
151   */
152   public org.apache.myfaces.tobago.layout.Measure getBorderLeft() {
153     Object object = getStateHelper().eval(PropertyKeys.borderLeft);
154     if (object != null) {
155        return Measure.valueOf(object);
156     }
157     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
158    getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this) : Measure.ZERO;
159   }
160 
161   public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) {
162     getStateHelper().put(PropertyKeys.borderLeft, borderLeft);
163   }
164 
165   /**
166   Text value to display as tooltip.
167 
168   */
169   public java.lang.String getTip() {
170     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
171   }
172 
173   public void setTip(java.lang.String tip) {
174     getStateHelper().put(PropertyKeys.tip, tip);
175   }
176 
177   /**
178   This value will usually be set by the layout manager.
179 
180   */
181   public org.apache.myfaces.tobago.layout.Measure getHeight() {
182     Object object = getStateHelper().eval(PropertyKeys.height);
183     if (object != null) {
184        return Measure.valueOf(object);
185     }
186     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this) : Measure.ZERO;
187   }
188 
189   public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
190     getStateHelper().put(PropertyKeys.height, height);
191   }
192 
193   public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
194     Object object = getStateHelper().eval(PropertyKeys.minimumWidth);
195     if (object != null) {
196        return Measure.valueOf(object);
197     }
198     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this) : Measure.ZERO;
199   }
200 
201   public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
202     getStateHelper().put(PropertyKeys.minimumWidth, minimumWidth);
203   }
204 
205   /**
206   This attribute is for internal use only.
207 
208   */
209   public boolean isOverflowX() {
210     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowX);
211     if (bool != null) {
212       return bool;
213     }
214     return false;
215   }
216 
217   public void setOverflowX(boolean overflowX) {
218     getStateHelper().put(PropertyKeys.overflowX, overflowX);
219   }
220 
221   public java.lang.Integer getRowSpan() {
222     Number value  = (Number) getStateHelper().eval(PropertyKeys.rowSpan);
223     if (value != null) {
224       return value.intValue();
225     }
226     return 1;
227   }
228 
229   public void setRowSpan(java.lang.Integer rowSpan) {
230     getStateHelper().put(PropertyKeys.rowSpan, rowSpan);
231   }
232 
233   /**
234   This attribute is for internal use only.
235 
236   */
237   public boolean isOverflowY() {
238     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowY);
239     if (bool != null) {
240       return bool;
241     }
242     return false;
243   }
244 
245   public void setOverflowY(boolean overflowY) {
246     getStateHelper().put(PropertyKeys.overflowY, overflowY);
247   }
248 
249   /**
250   This value will usually be set by the layout manager.
251 
252   */
253   public org.apache.myfaces.tobago.layout.Measure getLeft() {
254     Object object = getStateHelper().eval(PropertyKeys.left);
255     if (object != null) {
256        return Measure.valueOf(object);
257     }
258     return null;
259   }
260 
261   public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
262     getStateHelper().put(PropertyKeys.left, left);
263   }
264 
265   public java.lang.Integer getColumnSpan() {
266     Number value  = (Number) getStateHelper().eval(PropertyKeys.columnSpan);
267     if (value != null) {
268       return value.intValue();
269     }
270     return 1;
271   }
272 
273   public void setColumnSpan(java.lang.Integer columnSpan) {
274     getStateHelper().put(PropertyKeys.columnSpan, columnSpan);
275   }
276 
277   /**
278   This attribute is for internal use only.
279 
280   */
281   public org.apache.myfaces.tobago.layout.Measure getBorderRight() {
282     Object object = getStateHelper().eval(PropertyKeys.borderRight);
283     if (object != null) {
284        return Measure.valueOf(object);
285     }
286     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
287   getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this) : Measure.ZERO;
288   }
289 
290   public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) {
291     getStateHelper().put(PropertyKeys.borderRight, borderRight);
292   }
293 
294   /**
295   This attribute is for internal use only.
296 
297   */
298   public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() {
299     Object object = getStateHelper().eval(PropertyKeys.paddingBottom);
300     if (object != null) {
301        return Measure.valueOf(object);
302     }
303     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
304   getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this) : Measure.ZERO;
305   }
306 
307   public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) {
308     getStateHelper().put(PropertyKeys.paddingBottom, paddingBottom);
309   }
310 
311   /**
312   This value will usually be set by the layout manager.
313 
314   */
315   public org.apache.myfaces.tobago.layout.Measure getTop() {
316     Object object = getStateHelper().eval(PropertyKeys.top);
317     if (object != null) {
318        return Measure.valueOf(object);
319     }
320     return null;
321   }
322 
323   public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
324     getStateHelper().put(PropertyKeys.top, top);
325   }
326 
327   public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
328     Object object = getStateHelper().eval(PropertyKeys.maximumHeight);
329     if (object != null) {
330        return Measure.valueOf(object);
331     }
332     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this) : Measure.ZERO;
333   }
334 
335   public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
336     getStateHelper().put(PropertyKeys.maximumHeight, maximumHeight);
337   }
338 
339   /**
340   This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
341 
342   */
343   public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
344     Object object = getStateHelper().eval(PropertyKeys.currentWidth);
345     if (object != null) {
346        return Measure.valueOf(object);
347     }
348     return getWidth();
349   }
350 
351   public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
352     getStateHelper().put(PropertyKeys.currentWidth, currentWidth);
353   }
354 
355   /**
356   This attribute is for internal use only.
357 
358   */
359   public org.apache.myfaces.tobago.layout.Measure getPaddingTop() {
360     Object object = getStateHelper().eval(PropertyKeys.paddingTop);
361     if (object != null) {
362        return Measure.valueOf(object);
363     }
364     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
365   getRenderer(getFacesContext())).getPaddingTop(getFacesContext(), this) : Measure.ZERO;
366   }
367 
368   public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) {
369     getStateHelper().put(PropertyKeys.paddingTop, paddingTop);
370   }
371 
372   public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
373     Object object = getStateHelper().eval(PropertyKeys.marginTop);
374     if (object != null) {
375        return Measure.valueOf(object);
376     }
377     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this) : Measure.ZERO;
378   }
379 
380   public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
381     getStateHelper().put(PropertyKeys.marginTop, marginTop);
382   }
383 
384   /**
385   This value will usually be set by the layout manager.
386 
387   */
388   public org.apache.myfaces.tobago.layout.Measure getWidth() {
389     Object object = getStateHelper().eval(PropertyKeys.width);
390     if (object != null) {
391        return Measure.valueOf(object);
392     }
393     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this) : Measure.ZERO;
394   }
395 
396   public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
397     getStateHelper().put(PropertyKeys.width, width);
398   }
399 
400   public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
401     Object object = getStateHelper().eval(PropertyKeys.marginRight);
402     if (object != null) {
403        return Measure.valueOf(object);
404     }
405     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this) : Measure.ZERO;
406   }
407 
408   public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
409     getStateHelper().put(PropertyKeys.marginRight, marginRight);
410   }
411 
412   /**
413   This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
414 
415   */
416   public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
417     Object object = getStateHelper().eval(PropertyKeys.currentHeight);
418     if (object != null) {
419        return Measure.valueOf(object);
420     }
421     return getHeight();
422   }
423 
424   public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
425     getStateHelper().put(PropertyKeys.currentHeight, currentHeight);
426   }
427 
428   public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
429     Object object = getStateHelper().eval(PropertyKeys.preferredHeight);
430     if (object != null) {
431        return Measure.valueOf(object);
432     }
433     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this) : Measure.ZERO;
434   }
435 
436   public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
437     getStateHelper().put(PropertyKeys.preferredHeight, preferredHeight);
438   }
439 
440   /**
441   Url to an image to display.
442 
443   */
444   public java.lang.String getImage() {
445     return (java.lang.String) getStateHelper().eval(PropertyKeys.image);
446   }
447 
448   public void setImage(java.lang.String image) {
449     getStateHelper().put(PropertyKeys.image, image);
450   }
451 
452   /**
453   Text value to display as label.
454    If text contains an underscore the next character is used as accesskey (if configured so and possible).
455 
456   */
457   public java.lang.String getLabel() {
458     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
459   }
460 
461   public void setLabel(java.lang.String label) {
462     getStateHelper().put(PropertyKeys.label, label);
463   }
464 
465   /**
466   This attribute is for internal use only.
467 
468   */
469   public org.apache.myfaces.tobago.layout.Display getDisplay() {
470     return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
471   }
472 
473   public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
474     getStateHelper().put(PropertyKeys.display, display);
475   }
476 
477   /**
478   This attribute is for internal use only.
479 
480   */
481   public org.apache.myfaces.tobago.layout.Measure getBorderBottom() {
482     Object object = getStateHelper().eval(PropertyKeys.borderBottom);
483     if (object != null) {
484        return Measure.valueOf(object);
485     }
486     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
487   getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this) : Measure.ZERO;
488   }
489 
490   public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) {
491     getStateHelper().put(PropertyKeys.borderBottom, borderBottom);
492   }
493 
494   public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
495     Object object = getStateHelper().eval(PropertyKeys.maximumWidth);
496     if (object != null) {
497        return Measure.valueOf(object);
498     }
499     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this) : Measure.ZERO;
500   }
501 
502   public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
503     getStateHelper().put(PropertyKeys.maximumWidth, maximumWidth);
504   }
505 
506   /**
507   This attribute is for internal use only.
508 
509   */
510   public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() {
511     Object object = getStateHelper().eval(PropertyKeys.paddingLeft);
512     if (object != null) {
513        return Measure.valueOf(object);
514     }
515     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
516   getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this) : Measure.ZERO;
517   }
518 
519   public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) {
520     getStateHelper().put(PropertyKeys.paddingLeft, paddingLeft);
521   }
522 
523   /**
524   This attribute is for internal use only.
525 
526   */
527   public org.apache.myfaces.tobago.layout.Measure getPaddingRight() {
528     Object object = getStateHelper().eval(PropertyKeys.paddingRight);
529     if (object != null) {
530        return Measure.valueOf(object);
531     }
532     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
533   getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this) : Measure.ZERO;
534   }
535 
536   public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) {
537     getStateHelper().put(PropertyKeys.paddingRight, paddingRight);
538   }
539 
540   public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
541     Object object = getStateHelper().eval(PropertyKeys.preferredWidth);
542     if (object != null) {
543        return Measure.valueOf(object);
544     }
545     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this) : Measure.ZERO;
546   }
547 
548   public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
549     getStateHelper().put(PropertyKeys.preferredWidth, preferredWidth);
550   }
551 
552   public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
553     Object object = getStateHelper().eval(PropertyKeys.marginBottom);
554     if (object != null) {
555        return Measure.valueOf(object);
556     }
557     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this) : Measure.ZERO;
558   }
559 
560   public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
561     getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
562   }
563 
564   /**
565   This attribute is for internal use only.
566 
567   */
568   public java.lang.Integer getVerticalIndex() {
569     Number value  = (Number) getStateHelper().eval(PropertyKeys.verticalIndex);
570     if (value != null) {
571       return value.intValue();
572     }
573     return null;
574   }
575 
576   public void setVerticalIndex(java.lang.Integer verticalIndex) {
577     getStateHelper().put(PropertyKeys.verticalIndex, verticalIndex);
578   }
579 
580   /**
581   This attribute is for internal use only.
582 
583   */
584   public org.apache.myfaces.tobago.layout.Measure getBorderTop() {
585     Object object = getStateHelper().eval(PropertyKeys.borderTop);
586     if (object != null) {
587        return Measure.valueOf(object);
588     }
589     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
590   getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this) : Measure.ZERO;
591   }
592 
593   public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) {
594     getStateHelper().put(PropertyKeys.borderTop, borderTop);
595   }
596 
597   public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
598     if (currentMarkup != null) {
599       return currentMarkup;
600     }
601     return null;
602   }
603 
604   public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
605     this.currentMarkup = currentMarkup;
606   }
607 
608   /**
609   This attribute is for internal use only.
610 
611   */
612   public java.lang.Integer getHorizontalIndex() {
613     Number value  = (Number) getStateHelper().eval(PropertyKeys.horizontalIndex);
614     if (value != null) {
615       return value.intValue();
616     }
617     return null;
618   }
619 
620   public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
621     getStateHelper().put(PropertyKeys.horizontalIndex, horizontalIndex);
622   }
623 
624   /**
625   Flag indicating that this element is disabled.
626   <br />Default: <code>false</code>
627   */
628   public boolean isDisabled() {
629     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
630     if (bool != null) {
631       return bool;
632     }
633     return false;
634   }
635 
636   public void setDisabled(boolean disabled) {
637     getStateHelper().put(PropertyKeys.disabled, disabled);
638   }
639 
640   public Object saveState(FacesContext context) {
641     currentMarkup = null;
642     return super.saveState(context);
643   }
644 
645 }