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.AbstractUIColumn;
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   Renders a UIComponent that represents a single column of data within a
41    parent UISheet component.
42    * UIComponent class, generated from template {@code component2.0.stg} with class
43    * {@link org.apache.myfaces.tobago.internal.taglib.component.ColumnTagDeclaration}.
44   */
45  public class UIColumn
46      extends AbstractUIColumn implements SupportsMarkup {
47  
48    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Column";
49  
50    public static final String COMPONENT_FAMILY = "javax.faces.Column";
51  
52    private org.apache.myfaces.tobago.context.Markup currentMarkup;
53  
54    enum PropertyKeys {
55      markup,
56      paddingTop,
57      width,
58      sortable,
59      align,
60      label,
61      borderBottom,
62      borderLeft,
63      tip,
64      paddingLeft,
65      paddingRight,
66      borderTop,
67      overflowX,
68      resizable,
69      overflowY,
70      borderRight,
71      paddingBottom,
72    }
73  
74    public String getFamily() {
75      return COMPONENT_FAMILY;
76    }
77  
78  
79    public org.apache.myfaces.tobago.context.Markup getMarkup() {
80      Object object = getStateHelper().eval(PropertyKeys.markup);
81      if (object != null) {
82        return Markup.valueOf(object);
83      }
84      return null;
85    }
86  
87    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
88      getStateHelper().put(PropertyKeys.markup, markup);
89    }
90  
91    /**
92    This attribute is for internal use only.
93  
94    */
95    public org.apache.myfaces.tobago.layout.Measure getPaddingTop() {
96      Object object = getStateHelper().eval(PropertyKeys.paddingTop);
97      if (object != null) {
98         return Measure.valueOf(object);
99      }
100     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
101   getRenderer(getFacesContext())).getPaddingTop(getFacesContext(), this) : Measure.ZERO;
102   }
103 
104   public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) {
105     getStateHelper().put(PropertyKeys.paddingTop, paddingTop);
106   }
107 
108   /**
109   The layout token for this column.
110    Allowd layout tokens ('*', '<x>*', '<x>px' or '<x>%').
111    Where '*' is equivalent to '1*'.
112 
113   */
114   public org.apache.myfaces.tobago.layout.Measure getWidth() {
115     Object object = getStateHelper().eval(PropertyKeys.width);
116     if (object != null) {
117        return Measure.valueOf(object);
118     }
119     return null;
120   }
121 
122   public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
123     getStateHelper().put(PropertyKeys.width, width);
124   }
125 
126   /**
127   Flag indicating whether or not this column is sortable.
128    To make a column sortable the data of the sheet must be one of
129    <code>java.util.List</code> or <code>Object[]</code>.
130   <br />Default: <code>false</code>
131   */
132   public boolean isSortable() {
133     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.sortable);
134     if (bool != null) {
135       return bool;
136     }
137     return false;
138   }
139 
140   public void setSortable(boolean sortable) {
141     getStateHelper().put(PropertyKeys.sortable, sortable);
142   }
143 
144   /**
145   Alignment of this column.
146 
147   */
148   public java.lang.String getAlign() {
149     return (java.lang.String) getStateHelper().eval(PropertyKeys.align);
150   }
151 
152   public void setAlign(java.lang.String align) {
153     getStateHelper().put(PropertyKeys.align, align);
154   }
155 
156   /**
157   Text value to display as label.
158    If text contains an underscore the next character is used as accesskey (if configured so and possible).
159 
160   */
161   public java.lang.String getLabel() {
162     return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
163   }
164 
165   public void setLabel(java.lang.String label) {
166     getStateHelper().put(PropertyKeys.label, label);
167   }
168 
169   /**
170   This attribute is for internal use only.
171 
172   */
173   public org.apache.myfaces.tobago.layout.Measure getBorderBottom() {
174     Object object = getStateHelper().eval(PropertyKeys.borderBottom);
175     if (object != null) {
176        return Measure.valueOf(object);
177     }
178     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
179   getRenderer(getFacesContext())).getBorderBottom(getFacesContext(), this) : Measure.ZERO;
180   }
181 
182   public void setBorderBottom(org.apache.myfaces.tobago.layout.Measure borderBottom) {
183     getStateHelper().put(PropertyKeys.borderBottom, borderBottom);
184   }
185 
186   /**
187   This attribute is for internal use only.
188 
189   */
190   public org.apache.myfaces.tobago.layout.Measure getBorderLeft() {
191     Object object = getStateHelper().eval(PropertyKeys.borderLeft);
192     if (object != null) {
193        return Measure.valueOf(object);
194     }
195     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
196    getRenderer(getFacesContext())).getBorderLeft(getFacesContext(), this) : Measure.ZERO;
197   }
198 
199   public void setBorderLeft(org.apache.myfaces.tobago.layout.Measure borderLeft) {
200     getStateHelper().put(PropertyKeys.borderLeft, borderLeft);
201   }
202 
203   /**
204   Text value to display as tooltip.
205 
206   */
207   public java.lang.String getTip() {
208     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
209   }
210 
211   public void setTip(java.lang.String tip) {
212     getStateHelper().put(PropertyKeys.tip, tip);
213   }
214 
215   /**
216   This attribute is for internal use only.
217 
218   */
219   public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() {
220     Object object = getStateHelper().eval(PropertyKeys.paddingLeft);
221     if (object != null) {
222        return Measure.valueOf(object);
223     }
224     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
225   getRenderer(getFacesContext())).getPaddingLeft(getFacesContext(), this) : Measure.ZERO;
226   }
227 
228   public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) {
229     getStateHelper().put(PropertyKeys.paddingLeft, paddingLeft);
230   }
231 
232   /**
233   This attribute is for internal use only.
234 
235   */
236   public org.apache.myfaces.tobago.layout.Measure getPaddingRight() {
237     Object object = getStateHelper().eval(PropertyKeys.paddingRight);
238     if (object != null) {
239        return Measure.valueOf(object);
240     }
241     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
242   getRenderer(getFacesContext())).getPaddingRight(getFacesContext(), this) : Measure.ZERO;
243   }
244 
245   public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) {
246     getStateHelper().put(PropertyKeys.paddingRight, paddingRight);
247   }
248 
249   /**
250   This attribute is for internal use only.
251 
252   */
253   public org.apache.myfaces.tobago.layout.Measure getBorderTop() {
254     Object object = getStateHelper().eval(PropertyKeys.borderTop);
255     if (object != null) {
256        return Measure.valueOf(object);
257     }
258     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
259   getRenderer(getFacesContext())).getBorderTop(getFacesContext(), this) : Measure.ZERO;
260   }
261 
262   public void setBorderTop(org.apache.myfaces.tobago.layout.Measure borderTop) {
263     getStateHelper().put(PropertyKeys.borderTop, borderTop);
264   }
265 
266   /**
267   This attribute is for internal use only.
268 
269   */
270   public boolean isOverflowX() {
271     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowX);
272     if (bool != null) {
273       return bool;
274     }
275     return false;
276   }
277 
278   public void setOverflowX(boolean overflowX) {
279     getStateHelper().put(PropertyKeys.overflowX, overflowX);
280   }
281 
282   public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
283     if (currentMarkup != null) {
284       return currentMarkup;
285     }
286     return null;
287   }
288 
289   public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
290     this.currentMarkup = currentMarkup;
291   }
292 
293   /**
294   Flag indicating whether or not the width of this column in a sheet is resizable, by the user.
295   <br />Default: <code>true</code>
296   */
297   public boolean isResizable() {
298     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.resizable);
299     if (bool != null) {
300       return bool;
301     }
302     return true;
303   }
304 
305   public void setResizable(boolean resizable) {
306     getStateHelper().put(PropertyKeys.resizable, resizable);
307   }
308 
309   /**
310   This attribute is for internal use only.
311 
312   */
313   public boolean isOverflowY() {
314     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.overflowY);
315     if (bool != null) {
316       return bool;
317     }
318     return false;
319   }
320 
321   public void setOverflowY(boolean overflowY) {
322     getStateHelper().put(PropertyKeys.overflowY, overflowY);
323   }
324 
325   /**
326   This attribute is for internal use only.
327 
328   */
329   public org.apache.myfaces.tobago.layout.Measure getBorderRight() {
330     Object object = getStateHelper().eval(PropertyKeys.borderRight);
331     if (object != null) {
332        return Measure.valueOf(object);
333     }
334     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
335   getRenderer(getFacesContext())).getBorderRight(getFacesContext(), this) : Measure.ZERO;
336   }
337 
338   public void setBorderRight(org.apache.myfaces.tobago.layout.Measure borderRight) {
339     getStateHelper().put(PropertyKeys.borderRight, borderRight);
340   }
341 
342   /**
343   This attribute is for internal use only.
344 
345   */
346   public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() {
347     Object object = getStateHelper().eval(PropertyKeys.paddingBottom);
348     if (object != null) {
349        return Measure.valueOf(object);
350     }
351     return getRendererType() != null ? ((org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer)
352   getRenderer(getFacesContext())).getPaddingBottom(getFacesContext(), this) : Measure.ZERO;
353   }
354 
355   public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) {
356     getStateHelper().put(PropertyKeys.paddingBottom, paddingBottom);
357   }
358 
359   public Object saveState(FacesContext context) {
360     currentMarkup = null;
361     return super.saveState(context);
362   }
363 
364 }