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