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.component.behavior.ClientBehaviorHolder;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.context.Markup;
25  import org.apache.myfaces.tobago.internal.component.AbstractUIFlexLayout;
26  import org.apache.myfaces.tobago.layout.AlignItems;
27  import org.apache.myfaces.tobago.layout.JustifyContent;
28  import org.apache.myfaces.tobago.layout.MeasureList;
29  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
30  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
31  import org.apache.myfaces.tobago.internal.util.StringUtils;
32  import org.apache.myfaces.tobago.internal.util.Deprecation;
33  import org.apache.myfaces.tobago.component.Tags;
34  import javax.annotation.Generated;
35  import javax.el.ELException;
36  import javax.faces.FacesException;
37  import java.util.Arrays;
38  import java.util.ArrayList;
39  import java.util.Collection;
40  import java.util.List;
41  import javax.el.MethodExpression;
42  import javax.el.ValueExpression;
43  
44  /**
45   Renders a <a href=https://www.w3.org/TR/css-flexbox-1/>Flexible Box Layout</a>.
46    * UIComponent class, generated from template {@code component.stg} with class
47    * {@link org.apache.myfaces.tobago.internal.taglib.component.FlexLayoutTagDeclaration}.
48   */
49  @Generated("component.stg")
50  public class UIFlexLayout
51      extends AbstractUIFlexLayout implements ClientBehaviorHolder {
52  
53    public static final String COMPONENT_TYPE = Tags.flexLayout.componentType();
54  
55    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.FlexLayout";
56  
57  
58    enum PropertyKeys {
59      markup,
60      alignItems,
61      columns,
62      customClass,
63      rows,
64      justifyContent,
65    }
66  
67    public String getFamily() {
68      return COMPONENT_FAMILY;
69    }
70  
71  
72    public org.apache.myfaces.tobago.context.Markup getMarkup() {
73      Object object = getStateHelper().eval(PropertyKeys.markup);
74      if (object != null) {
75        return Markup.valueOf(object);
76      }
77      return null;
78    }
79  
80    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
81      getStateHelper().put(PropertyKeys.markup, markup);
82    }
83  
84    /**
85    This value defines CSS align-items value of the flex layout.
86    <br>Allowed Values: <code>flexStart,flexEnd,baseline,center,stretch</code>
87    */
88    public org.apache.myfaces.tobago.layout.AlignItems getAlignItems() {
89      return (org.apache.myfaces.tobago.layout.AlignItems) getStateHelper().eval(PropertyKeys.alignItems);
90    }
91  
92    public void setAlignItems(org.apache.myfaces.tobago.layout.AlignItems alignItems) {
93      getStateHelper().put(PropertyKeys.alignItems, alignItems);
94    }
95  
96    /**
97    This value defines the layout constraints for column layout.
98     It is a space separated list of layout tokens '&lt;n&gt;fr', '&lt;measure&gt;' or the keyword 'auto'.
99     Where &lt;n&gt; is a positive integer and &lt;measure&gt; is a valid CSS length.
100    Example: '2fr 1fr 100px 3rem auto'.
101 
102   */
103   public org.apache.myfaces.tobago.layout.MeasureList getColumns() {
104     return (org.apache.myfaces.tobago.layout.MeasureList) getStateHelper().eval(PropertyKeys.columns);
105   }
106 
107   public void setColumns(org.apache.myfaces.tobago.layout.MeasureList columns) {
108     getStateHelper().put(PropertyKeys.columns, columns);
109   }
110 
111   /**
112   Sets a CSS class in its parent, if the parent supports it.
113 
114    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
115 
116    <pre>
117    &lt;tc:in&gt;
118      &lt;tc:style customClass="my-emphasized"/&gt;
119    &lt;/tc:in&gt;
120    </pre>
121 
122    One capability is, to used external CSS libs.
123    <br>
124    This feature should not be used imprudent.
125    Because it might be unstable against changes in the renderered HTML code.
126 
127   */
128   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
129     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
130   }
131 
132   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
133     getStateHelper().put(PropertyKeys.customClass, customClass);
134   }
135 
136   /**
137   This value defines the layout constraints for row layout.
138    It is a space separated list of layout tokens '&lt;n&gt;fr', '&lt;measure&gt;' or the keyword 'auto'.
139    Where &lt;n&gt; is a positive integer and &lt;measure&gt; is a valid CSS length.
140    Example: '2fr 1fr 100px 3rem auto'.
141 
142   */
143   public org.apache.myfaces.tobago.layout.MeasureList getRows() {
144     return (org.apache.myfaces.tobago.layout.MeasureList) getStateHelper().eval(PropertyKeys.rows);
145   }
146 
147   public void setRows(org.apache.myfaces.tobago.layout.MeasureList rows) {
148     getStateHelper().put(PropertyKeys.rows, rows);
149   }
150 
151   /**
152   This value defines CSS justify-content value of the flex layout.
153   <br>Allowed Values: <code>flexStart,flexEnd,center,spaceBetween,spaceAround</code>
154   */
155   public org.apache.myfaces.tobago.layout.JustifyContent getJustifyContent() {
156     return (org.apache.myfaces.tobago.layout.JustifyContent) getStateHelper().eval(PropertyKeys.justifyContent);
157   }
158 
159   public void setJustifyContent(org.apache.myfaces.tobago.layout.JustifyContent justifyContent) {
160     getStateHelper().put(PropertyKeys.justifyContent, justifyContent);
161   }
162 
163 
164   @Override
165   public void restoreState(FacesContext context, Object state) {
166     // FIXME HACK for mojarra SystemEventListener state restoring bug
167     pushComponentToEL(context, this);
168     super.restoreState(context, state);
169     popComponentFromEL(context);
170   }
171 
172 }