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