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