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.internal.component.AbstractUIStyle;
24  import org.apache.myfaces.tobago.layout.Display;
25  import org.apache.myfaces.tobago.layout.GridSpan;
26  import org.apache.myfaces.tobago.layout.Measure;
27  import org.apache.myfaces.tobago.layout.Overflow;
28  import org.apache.myfaces.tobago.layout.Position;
29  import org.apache.myfaces.tobago.layout.TextAlign;
30  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
31  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
32  import org.apache.myfaces.tobago.internal.util.StringUtils;
33  import org.apache.myfaces.tobago.internal.util.Deprecation;
34  import javax.el.ELException;
35  import javax.faces.FacesException;
36  import java.util.Arrays;
37  import java.util.ArrayList;
38  import java.util.Collection;
39  import java.util.List;
40  import javax.el.MethodExpression;
41  import javax.el.ValueExpression;
42  
43  /** 
44   <p>
45    Add a style tag with the given file name to the header (using file attribute) or add
46    some CSS styles to the parent component.
47    </p>
48    * UIComponent class, generated from template {@code component.stg} with class
49    * {@link org.apache.myfaces.tobago.internal.taglib.component.StyleTagDeclaration}.
50   */
51  public class UIStyle
52      extends AbstractUIStyle  {
53  
54    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Style";
55  
56    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.Style";
57  
58  
59    enum PropertyKeys {
60      flexGrow,
61      backgroundImage,
62      paddingRight,
63      gridColumn,
64      minHeight,
65      marginRight,
66      file,
67      paddingBottom,
68      top,
69      gridRow,
70      maxHeight,
71      flexShrink,
72      selector,
73      paddingTop,
74      height,
75      maxWidth,
76      textAlign,
77      bottom,
78      display,
79      flexBasis,
80      minWidth,
81      right,
82      marginLeft,
83      overflowX,
84      overflowY,
85      gridTemplateRows,
86      left,
87      gridTemplateColumns,
88      width,
89      customClass,
90      marginBottom,
91      position,
92      paddingLeft,
93      marginTop,
94    }
95  
96    public String getFamily() {
97      return COMPONENT_FAMILY;
98    }
99  
100 
101   /**
102   Flex grow value of the element.
103 
104   */
105   public java.lang.Number getFlexGrow() {
106     return (java.lang.Number) getStateHelper().eval(PropertyKeys.flexGrow);
107   }
108 
109   public void setFlexGrow(java.lang.Number flexGrow) {
110     getStateHelper().put(PropertyKeys.flexGrow, flexGrow);
111   }
112 
113   /**
114   The background image of the element.
115 
116   */
117   public java.lang.String getBackgroundImage() {
118     return (java.lang.String) getStateHelper().eval(PropertyKeys.backgroundImage);
119   }
120 
121   public void setBackgroundImage(java.lang.String backgroundImage) {
122     getStateHelper().put(PropertyKeys.backgroundImage, backgroundImage);
123   }
124 
125   public org.apache.myfaces.tobago.layout.Measure getPaddingRight() {
126     Object object = getStateHelper().eval(PropertyKeys.paddingRight);
127     if (object != null) {
128        return Measure.valueOf(object);
129     }
130     return null;
131   }
132 
133   public void setPaddingRight(org.apache.myfaces.tobago.layout.Measure paddingRight) {
134     getStateHelper().put(PropertyKeys.paddingRight, paddingRight);
135   }
136 
137   /**
138   Grid column value of the element.
139 
140   */
141   public org.apache.myfaces.tobago.layout.GridSpan getGridColumn() {
142     return (org.apache.myfaces.tobago.layout.GridSpan) getStateHelper().eval(PropertyKeys.gridColumn);
143   }
144 
145   public void setGridColumn(org.apache.myfaces.tobago.layout.GridSpan gridColumn) {
146     getStateHelper().put(PropertyKeys.gridColumn, gridColumn);
147   }
148 
149   public org.apache.myfaces.tobago.layout.Measure getMinHeight() {
150     Object object = getStateHelper().eval(PropertyKeys.minHeight);
151     if (object != null) {
152        return Measure.valueOf(object);
153     }
154     return null;
155   }
156 
157   public void setMinHeight(org.apache.myfaces.tobago.layout.Measure minHeight) {
158     getStateHelper().put(PropertyKeys.minHeight, minHeight);
159   }
160 
161   public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
162     Object object = getStateHelper().eval(PropertyKeys.marginRight);
163     if (object != null) {
164        return Measure.valueOf(object);
165     }
166     return null;
167   }
168 
169   public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
170     getStateHelper().put(PropertyKeys.marginRight, marginRight);
171   }
172 
173   /**
174   Name of the stylesheet file to add to page. The name must be full qualified, or relative.
175    If using a complete path from root, you'll need to add the contextPath from the web application.
176    This can be done with the EL #{request.contextPath}.
177 
178   */
179   public java.lang.String getFile() {
180     return (java.lang.String) getStateHelper().eval(PropertyKeys.file);
181   }
182 
183   public void setFile(java.lang.String file) {
184     getStateHelper().put(PropertyKeys.file, file);
185   }
186 
187   public org.apache.myfaces.tobago.layout.Measure getPaddingBottom() {
188     Object object = getStateHelper().eval(PropertyKeys.paddingBottom);
189     if (object != null) {
190        return Measure.valueOf(object);
191     }
192     return null;
193   }
194 
195   public void setPaddingBottom(org.apache.myfaces.tobago.layout.Measure paddingBottom) {
196     getStateHelper().put(PropertyKeys.paddingBottom, paddingBottom);
197   }
198 
199   public org.apache.myfaces.tobago.layout.Measure getTop() {
200     Object object = getStateHelper().eval(PropertyKeys.top);
201     if (object != null) {
202        return Measure.valueOf(object);
203     }
204     return null;
205   }
206 
207   public void setTop(org.apache.myfaces.tobago.layout.Measure top) {
208     getStateHelper().put(PropertyKeys.top, top);
209   }
210 
211   /**
212   Grid row value of the element.
213 
214   */
215   public org.apache.myfaces.tobago.layout.GridSpan getGridRow() {
216     return (org.apache.myfaces.tobago.layout.GridSpan) getStateHelper().eval(PropertyKeys.gridRow);
217   }
218 
219   public void setGridRow(org.apache.myfaces.tobago.layout.GridSpan gridRow) {
220     getStateHelper().put(PropertyKeys.gridRow, gridRow);
221   }
222 
223   public org.apache.myfaces.tobago.layout.Measure getMaxHeight() {
224     Object object = getStateHelper().eval(PropertyKeys.maxHeight);
225     if (object != null) {
226        return Measure.valueOf(object);
227     }
228     return null;
229   }
230 
231   public void setMaxHeight(org.apache.myfaces.tobago.layout.Measure maxHeight) {
232     getStateHelper().put(PropertyKeys.maxHeight, maxHeight);
233   }
234 
235   /**
236   Flex shrink value of the element.
237 
238   */
239   public java.lang.Number getFlexShrink() {
240     return (java.lang.Number) getStateHelper().eval(PropertyKeys.flexShrink);
241   }
242 
243   public void setFlexShrink(java.lang.Number flexShrink) {
244     getStateHelper().put(PropertyKeys.flexShrink, flexShrink);
245   }
246 
247   public java.lang.String getSelector() {
248     return (java.lang.String) getStateHelper().eval(PropertyKeys.selector);
249   }
250 
251   public void setSelector(java.lang.String selector) {
252     getStateHelper().put(PropertyKeys.selector, selector);
253   }
254 
255   public org.apache.myfaces.tobago.layout.Measure getPaddingTop() {
256     Object object = getStateHelper().eval(PropertyKeys.paddingTop);
257     if (object != null) {
258        return Measure.valueOf(object);
259     }
260     return null;
261   }
262 
263   public void setPaddingTop(org.apache.myfaces.tobago.layout.Measure paddingTop) {
264     getStateHelper().put(PropertyKeys.paddingTop, paddingTop);
265   }
266 
267   public org.apache.myfaces.tobago.layout.Measure getHeight() {
268     Object object = getStateHelper().eval(PropertyKeys.height);
269     if (object != null) {
270        return Measure.valueOf(object);
271     }
272     return null;
273   }
274 
275   public void setHeight(org.apache.myfaces.tobago.layout.Measure height) {
276     getStateHelper().put(PropertyKeys.height, height);
277   }
278 
279   public org.apache.myfaces.tobago.layout.Measure getMaxWidth() {
280     Object object = getStateHelper().eval(PropertyKeys.maxWidth);
281     if (object != null) {
282        return Measure.valueOf(object);
283     }
284     return null;
285   }
286 
287   public void setMaxWidth(org.apache.myfaces.tobago.layout.Measure maxWidth) {
288     getStateHelper().put(PropertyKeys.maxWidth, maxWidth);
289   }
290 
291   /**
292   The alignment of the elements inside of the container, possible values are:
293    {
294   <br>Allowed Values: <code>left,right,center,justify</code>
295   */
296   public org.apache.myfaces.tobago.layout.TextAlign getTextAlign() {
297     return (org.apache.myfaces.tobago.layout.TextAlign) getStateHelper().eval(PropertyKeys.textAlign);
298   }
299 
300   public void setTextAlign(org.apache.myfaces.tobago.layout.TextAlign textAlign) {
301     getStateHelper().put(PropertyKeys.textAlign, textAlign);
302   }
303 
304   public org.apache.myfaces.tobago.layout.Measure getBottom() {
305     Object object = getStateHelper().eval(PropertyKeys.bottom);
306     if (object != null) {
307        return Measure.valueOf(object);
308     }
309     return null;
310   }
311 
312   public void setBottom(org.apache.myfaces.tobago.layout.Measure bottom) {
313     getStateHelper().put(PropertyKeys.bottom, bottom);
314   }
315 
316   public org.apache.myfaces.tobago.layout.Display getDisplay() {
317     return (org.apache.myfaces.tobago.layout.Display) getStateHelper().eval(PropertyKeys.display);
318   }
319 
320   public void setDisplay(org.apache.myfaces.tobago.layout.Display display) {
321     getStateHelper().put(PropertyKeys.display, display);
322   }
323 
324   /**
325   Flex basis value of the element.
326 
327   */
328   public org.apache.myfaces.tobago.layout.Measure getFlexBasis() {
329     Object object = getStateHelper().eval(PropertyKeys.flexBasis);
330     if (object != null) {
331        return Measure.valueOf(object);
332     }
333     return null;
334   }
335 
336   public void setFlexBasis(org.apache.myfaces.tobago.layout.Measure flexBasis) {
337     getStateHelper().put(PropertyKeys.flexBasis, flexBasis);
338   }
339 
340   public org.apache.myfaces.tobago.layout.Measure getMinWidth() {
341     Object object = getStateHelper().eval(PropertyKeys.minWidth);
342     if (object != null) {
343        return Measure.valueOf(object);
344     }
345     return null;
346   }
347 
348   public void setMinWidth(org.apache.myfaces.tobago.layout.Measure minWidth) {
349     getStateHelper().put(PropertyKeys.minWidth, minWidth);
350   }
351 
352   public org.apache.myfaces.tobago.layout.Measure getRight() {
353     Object object = getStateHelper().eval(PropertyKeys.right);
354     if (object != null) {
355        return Measure.valueOf(object);
356     }
357     return null;
358   }
359 
360   public void setRight(org.apache.myfaces.tobago.layout.Measure right) {
361     getStateHelper().put(PropertyKeys.right, right);
362   }
363 
364   public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
365     Object object = getStateHelper().eval(PropertyKeys.marginLeft);
366     if (object != null) {
367        return Measure.valueOf(object);
368     }
369     return null;
370   }
371 
372   public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
373     getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
374   }
375 
376   public org.apache.myfaces.tobago.layout.Overflow getOverflowX() {
377     return (org.apache.myfaces.tobago.layout.Overflow) getStateHelper().eval(PropertyKeys.overflowX);
378   }
379 
380   public void setOverflowX(org.apache.myfaces.tobago.layout.Overflow overflowX) {
381     getStateHelper().put(PropertyKeys.overflowX, overflowX);
382   }
383 
384   public org.apache.myfaces.tobago.layout.Overflow getOverflowY() {
385     return (org.apache.myfaces.tobago.layout.Overflow) getStateHelper().eval(PropertyKeys.overflowY);
386   }
387 
388   public void setOverflowY(org.apache.myfaces.tobago.layout.Overflow overflowY) {
389     getStateHelper().put(PropertyKeys.overflowY, overflowY);
390   }
391 
392   /**
393   Grid template rows value of the element.
394 
395   */
396   public java.lang.String getGridTemplateRows() {
397     return (java.lang.String) getStateHelper().eval(PropertyKeys.gridTemplateRows);
398   }
399 
400   public void setGridTemplateRows(java.lang.String gridTemplateRows) {
401     getStateHelper().put(PropertyKeys.gridTemplateRows, gridTemplateRows);
402   }
403 
404   public org.apache.myfaces.tobago.layout.Measure getLeft() {
405     Object object = getStateHelper().eval(PropertyKeys.left);
406     if (object != null) {
407        return Measure.valueOf(object);
408     }
409     return null;
410   }
411 
412   public void setLeft(org.apache.myfaces.tobago.layout.Measure left) {
413     getStateHelper().put(PropertyKeys.left, left);
414   }
415 
416   /**
417   Grid template columns value of the element.
418 
419   */
420   public java.lang.String getGridTemplateColumns() {
421     return (java.lang.String) getStateHelper().eval(PropertyKeys.gridTemplateColumns);
422   }
423 
424   public void setGridTemplateColumns(java.lang.String gridTemplateColumns) {
425     getStateHelper().put(PropertyKeys.gridTemplateColumns, gridTemplateColumns);
426   }
427 
428   public org.apache.myfaces.tobago.layout.Measure getWidth() {
429     Object object = getStateHelper().eval(PropertyKeys.width);
430     if (object != null) {
431        return Measure.valueOf(object);
432     }
433     return null;
434   }
435 
436   public void setWidth(org.apache.myfaces.tobago.layout.Measure width) {
437     getStateHelper().put(PropertyKeys.width, width);
438   }
439 
440   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
441     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
442   }
443 
444   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
445     getStateHelper().put(PropertyKeys.customClass, customClass);
446   }
447 
448   public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
449     Object object = getStateHelper().eval(PropertyKeys.marginBottom);
450     if (object != null) {
451        return Measure.valueOf(object);
452     }
453     return null;
454   }
455 
456   public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
457     getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
458   }
459 
460   public org.apache.myfaces.tobago.layout.Position getPosition() {
461     return (org.apache.myfaces.tobago.layout.Position) getStateHelper().eval(PropertyKeys.position);
462   }
463 
464   public void setPosition(org.apache.myfaces.tobago.layout.Position position) {
465     getStateHelper().put(PropertyKeys.position, position);
466   }
467 
468   public org.apache.myfaces.tobago.layout.Measure getPaddingLeft() {
469     Object object = getStateHelper().eval(PropertyKeys.paddingLeft);
470     if (object != null) {
471        return Measure.valueOf(object);
472     }
473     return null;
474   }
475 
476   public void setPaddingLeft(org.apache.myfaces.tobago.layout.Measure paddingLeft) {
477     getStateHelper().put(PropertyKeys.paddingLeft, paddingLeft);
478   }
479 
480   public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
481     Object object = getStateHelper().eval(PropertyKeys.marginTop);
482     if (object != null) {
483        return Measure.valueOf(object);
484     }
485     return null;
486   }
487 
488   public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
489     getStateHelper().put(PropertyKeys.marginTop, marginTop);
490   }
491 
492 
493 }