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