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.internal.component.AbstractUIImage;
25  import org.apache.myfaces.tobago.layout.Display;
26  import org.apache.myfaces.tobago.layout.Measure;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.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   Renders an image beside a tree node.
42    * UIComponent class, generated from template {@code component2.0.stg} with class
43    * {@link org.apache.myfaces.tobago.internal.taglib.component.TreeIconTagDeclaration}.
44   */
45  public class UITreeIcon
46      extends AbstractUIImage implements SupportsMarkup {
47  
48    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.TreeIcon";
49  
50    public static final String COMPONENT_FAMILY = "javax.faces.Graphic";
51  
52    private org.apache.myfaces.tobago.context.Markup currentMarkup;
53  
54    enum PropertyKeys {
55      markup,
56      marginLeft,
57      minimumHeight,
58      tip,
59      height,
60      minimumWidth,
61      rowSpan,
62      left,
63      columnSpan,
64      maximumHeight,
65      top,
66      currentWidth,
67      marginTop,
68      marginRight,
69      width,
70      preferredHeight,
71      currentHeight,
72      display,
73      maximumWidth,
74      preferredWidth,
75      marginBottom,
76      verticalIndex,
77      horizontalIndex,
78      disabled,
79    }
80  
81    public String getFamily() {
82      return COMPONENT_FAMILY;
83    }
84  
85  
86    public org.apache.myfaces.tobago.context.Markup getMarkup() {
87      Object object = getStateHelper().eval(PropertyKeys.markup);
88      if (object != null) {
89        return Markup.valueOf(object);
90      }
91      return null;
92    }
93  
94    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
95      getStateHelper().put(PropertyKeys.markup, markup);
96    }
97  
98    public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
99      Object object = getStateHelper().eval(PropertyKeys.marginLeft);
100     if (object != null) {
101        return Measure.valueOf(object);
102     }
103     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this) : Measure.ZERO;
104   }
105 
106   public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
107     getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
108   }
109 
110   public org.apache.myfaces.tobago.layout.Measure getMinimumHeight() {
111     Object object = getStateHelper().eval(PropertyKeys.minimumHeight);
112     if (object != null) {
113        return Measure.valueOf(object);
114     }
115     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumHeight(getFacesContext(), this) : Measure.ZERO;
116   }
117 
118   public void setMinimumHeight(org.apache.myfaces.tobago.layout.Measure minimumHeight) {
119     getStateHelper().put(PropertyKeys.minimumHeight, minimumHeight);
120   }
121 
122   /**
123   Text value to display as tooltip.
124 
125   */
126   public java.lang.String getTip() {
127     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
128   }
129 
130   public void setTip(java.lang.String tip) {
131     getStateHelper().put(PropertyKeys.tip, tip);
132   }
133 
134   /**
135   This value will usually be set by the layout manager.
136 
137   */
138   public org.apache.myfaces.tobago.layout.Measure getHeight() {
139     Object object = getStateHelper().eval(PropertyKeys.height);
140     if (object != null) {
141        return Measure.valueOf(object);
142     }
143     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getHeight(getFacesContext(), this) : Measure.ZERO;
144   }
145 
146   public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
147     getStateHelper().put(PropertyKeys.height, height);
148   }
149 
150   public org.apache.myfaces.tobago.layout.Measure getMinimumWidth() {
151     Object object = getStateHelper().eval(PropertyKeys.minimumWidth);
152     if (object != null) {
153        return Measure.valueOf(object);
154     }
155     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMinimumWidth(getFacesContext(), this) : Measure.ZERO;
156   }
157 
158   public void setMinimumWidth(org.apache.myfaces.tobago.layout.Measure minimumWidth) {
159     getStateHelper().put(PropertyKeys.minimumWidth, minimumWidth);
160   }
161 
162   public java.lang.Integer getRowSpan() {
163     Number value  = (Number) getStateHelper().eval(PropertyKeys.rowSpan);
164     if (value != null) {
165       return value.intValue();
166     }
167     return 1;
168   }
169 
170   public void setRowSpan(java.lang.Integer rowSpan) {
171     getStateHelper().put(PropertyKeys.rowSpan, rowSpan);
172   }
173 
174   /**
175   This value will usually be set by the layout manager.
176 
177   */
178   public org.apache.myfaces.tobago.layout.Measure getLeft() {
179     Object object = getStateHelper().eval(PropertyKeys.left);
180     if (object != null) {
181        return Measure.valueOf(object);
182     }
183     return null;
184   }
185 
186   public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
187     getStateHelper().put(PropertyKeys.left, left);
188   }
189 
190   public java.lang.Integer getColumnSpan() {
191     Number value  = (Number) getStateHelper().eval(PropertyKeys.columnSpan);
192     if (value != null) {
193       return value.intValue();
194     }
195     return 1;
196   }
197 
198   public void setColumnSpan(java.lang.Integer columnSpan) {
199     getStateHelper().put(PropertyKeys.columnSpan, columnSpan);
200   }
201 
202   public org.apache.myfaces.tobago.layout.Measure getMaximumHeight() {
203     Object object = getStateHelper().eval(PropertyKeys.maximumHeight);
204     if (object != null) {
205        return Measure.valueOf(object);
206     }
207     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumHeight(getFacesContext(), this) : Measure.ZERO;
208   }
209 
210   public void setMaximumHeight(org.apache.myfaces.tobago.layout.Measure maximumHeight) {
211     getStateHelper().put(PropertyKeys.maximumHeight, maximumHeight);
212   }
213 
214   /**
215   This value will usually be set by the layout manager.
216 
217   */
218   public org.apache.myfaces.tobago.layout.Measure getTop() {
219     Object object = getStateHelper().eval(PropertyKeys.top);
220     if (object != null) {
221        return Measure.valueOf(object);
222     }
223     return null;
224   }
225 
226   public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
227     getStateHelper().put(PropertyKeys.top, top);
228   }
229 
230   /**
231   This value will usually be set by the layout manager. It holds the current width computed by the layout manager.
232 
233   */
234   public org.apache.myfaces.tobago.layout.Measure getCurrentWidth() {
235     Object object = getStateHelper().eval(PropertyKeys.currentWidth);
236     if (object != null) {
237        return Measure.valueOf(object);
238     }
239     return getWidth();
240   }
241 
242   public void setCurrentWidth(org.apache.myfaces.tobago.layout.Measure currentWidth) {
243     getStateHelper().put(PropertyKeys.currentWidth, currentWidth);
244   }
245 
246   public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
247     Object object = getStateHelper().eval(PropertyKeys.marginTop);
248     if (object != null) {
249        return Measure.valueOf(object);
250     }
251     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this) : Measure.ZERO;
252   }
253 
254   public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
255     getStateHelper().put(PropertyKeys.marginTop, marginTop);
256   }
257 
258   public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
259     Object object = getStateHelper().eval(PropertyKeys.marginRight);
260     if (object != null) {
261        return Measure.valueOf(object);
262     }
263     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this) : Measure.ZERO;
264   }
265 
266   public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
267     getStateHelper().put(PropertyKeys.marginRight, marginRight);
268   }
269 
270   /**
271   This value will usually be set by the layout manager.
272 
273   */
274   public org.apache.myfaces.tobago.layout.Measure getWidth() {
275     Object object = getStateHelper().eval(PropertyKeys.width);
276     if (object != null) {
277        return Measure.valueOf(object);
278     }
279     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getWidth(getFacesContext(), this) : Measure.ZERO;
280   }
281 
282   public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
283     getStateHelper().put(PropertyKeys.width, width);
284   }
285 
286   public org.apache.myfaces.tobago.layout.Measure getPreferredHeight() {
287     Object object = getStateHelper().eval(PropertyKeys.preferredHeight);
288     if (object != null) {
289        return Measure.valueOf(object);
290     }
291     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredHeight(getFacesContext(), this) : Measure.ZERO;
292   }
293 
294   public void setPreferredHeight(org.apache.myfaces.tobago.layout.Measure preferredHeight) {
295     getStateHelper().put(PropertyKeys.preferredHeight, preferredHeight);
296   }
297 
298   /**
299   This value will usually be set by the layout manager. It holds the current height computed by the layout manager.
300 
301   */
302   public org.apache.myfaces.tobago.layout.Measure getCurrentHeight() {
303     Object object = getStateHelper().eval(PropertyKeys.currentHeight);
304     if (object != null) {
305        return Measure.valueOf(object);
306     }
307     return getHeight();
308   }
309 
310   public void setCurrentHeight(org.apache.myfaces.tobago.layout.Measure currentHeight) {
311     getStateHelper().put(PropertyKeys.currentHeight, currentHeight);
312   }
313 
314   /**
315   This attribute is for internal use only.
316 
317   */
318   public org.apache.myfaces.tobago.layout.Display getDisplay() {
319     return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
320   }
321 
322   public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
323     getStateHelper().put(PropertyKeys.display, display);
324   }
325 
326   public org.apache.myfaces.tobago.layout.Measure getMaximumWidth() {
327     Object object = getStateHelper().eval(PropertyKeys.maximumWidth);
328     if (object != null) {
329        return Measure.valueOf(object);
330     }
331     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMaximumWidth(getFacesContext(), this) : Measure.ZERO;
332   }
333 
334   public void setMaximumWidth(org.apache.myfaces.tobago.layout.Measure maximumWidth) {
335     getStateHelper().put(PropertyKeys.maximumWidth, maximumWidth);
336   }
337 
338   public org.apache.myfaces.tobago.layout.Measure getPreferredWidth() {
339     Object object = getStateHelper().eval(PropertyKeys.preferredWidth);
340     if (object != null) {
341        return Measure.valueOf(object);
342     }
343     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getPreferredWidth(getFacesContext(), this) : Measure.ZERO;
344   }
345 
346   public void setPreferredWidth(org.apache.myfaces.tobago.layout.Measure preferredWidth) {
347     getStateHelper().put(PropertyKeys.preferredWidth, preferredWidth);
348   }
349 
350   public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
351     Object object = getStateHelper().eval(PropertyKeys.marginBottom);
352     if (object != null) {
353        return Measure.valueOf(object);
354     }
355     return getRendererType() != null ? ((LayoutComponentRenderer) getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this) : Measure.ZERO;
356   }
357 
358   public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
359     getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
360   }
361 
362   /**
363   This attribute is for internal use only.
364 
365   */
366   public java.lang.Integer getVerticalIndex() {
367     Number value  = (Number) getStateHelper().eval(PropertyKeys.verticalIndex);
368     if (value != null) {
369       return value.intValue();
370     }
371     return null;
372   }
373 
374   public void setVerticalIndex(java.lang.Integer verticalIndex) {
375     getStateHelper().put(PropertyKeys.verticalIndex, verticalIndex);
376   }
377 
378   public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
379     if (currentMarkup != null) {
380       return currentMarkup;
381     }
382     return null;
383   }
384 
385   public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
386     this.currentMarkup = currentMarkup;
387   }
388 
389   /**
390   This attribute is for internal use only.
391 
392   */
393   public java.lang.Integer getHorizontalIndex() {
394     Number value  = (Number) getStateHelper().eval(PropertyKeys.horizontalIndex);
395     if (value != null) {
396       return value.intValue();
397     }
398     return null;
399   }
400 
401   public void setHorizontalIndex(java.lang.Integer horizontalIndex) {
402     getStateHelper().put(PropertyKeys.horizontalIndex, horizontalIndex);
403   }
404 
405   /**
406   Flag indicating that this element is disabled.
407   <br />Default: <code>false</code>
408   */
409   public boolean isDisabled() {
410     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
411     if (bool != null) {
412       return bool;
413     }
414     return false;
415   }
416 
417   public void setDisabled(boolean disabled) {
418     getStateHelper().put(PropertyKeys.disabled, disabled);
419   }
420 
421   public Object saveState(FacesContext context) {
422     currentMarkup = null;
423     return super.saveState(context);
424   }
425 
426 
427 }