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.AbstractUISplitLayout;
25  import org.apache.myfaces.tobago.layout.Measure;
26  import org.apache.myfaces.tobago.layout.MeasureList;
27  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
28  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
29  import org.apache.myfaces.tobago.internal.util.StringUtils;
30  import org.apache.myfaces.tobago.internal.util.Deprecation;
31  import org.apache.myfaces.tobago.component.Tags;
32  import javax.annotation.Generated;
33  import javax.el.ELException;
34  import javax.faces.FacesException;
35  import java.util.Arrays;
36  import java.util.ArrayList;
37  import java.util.Collection;
38  import java.util.List;
39  import javax.el.MethodExpression;
40  import javax.el.ValueExpression;
41  
42  /**
43   <p>
44    WARNING: This component is preliminary and may be changed without a major release.
45    </p>
46  
47    Renders a SplitLayout.
48    A area with two child components rendered horizontally or vertically and allows to change the
49    layout relation of this two components on the client.
50    * UIComponent class, generated from template {@code component.stg} with class
51    * {@link org.apache.myfaces.tobago.internal.taglib.component.SplitLayoutTagDeclaration}.
52   */
53  @Generated("component.stg")
54  public class UISplitLayout
55      extends AbstractUISplitLayout  {
56  
57    public static final String COMPONENT_TYPE = Tags.splitLayout.componentType();
58  
59    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.GridLayout";
60  
61  
62    enum PropertyKeys {
63      columnSpacing,
64      markup,
65      columns,
66      customClass,
67      rowSpacing,
68      rows,
69    }
70  
71    public String getFamily() {
72      return COMPONENT_FAMILY;
73    }
74  
75  
76    /**
77    Spacing between the columns in the actual layout.
78  
79    */
80    public org.apache.myfaces.tobago.layout.Measure getColumnSpacing() {
81      Object object = getStateHelper().eval(PropertyKeys.columnSpacing);
82      if (object != null) {
83         return Measure.valueOf(object);
84      }
85      return Measure.ZERO;
86    }
87  
88    public void setColumnSpacing(org.apache.myfaces.tobago.layout.Measure columnSpacing) {
89      getStateHelper().put(PropertyKeys.columnSpacing, columnSpacing);
90    }
91  
92    public org.apache.myfaces.tobago.context.Markup getMarkup() {
93      Object object = getStateHelper().eval(PropertyKeys.markup);
94      if (object != null) {
95        return Markup.valueOf(object);
96      }
97      return null;
98    }
99  
100   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
101     getStateHelper().put(PropertyKeys.markup, markup);
102   }
103 
104   /**
105   This value defines the layout constraints for column layout.
106    It is a space separated list of layout tokens '&lt;n&gt;fr', '&lt;measure&gt;' or the keyword 'auto'.
107    Where &lt;n&gt; is a positive integer and &lt;measure&gt; is a valid CSS length.
108    Example: '2fr 1fr 100px 3rem auto'.
109 
110   */
111   public org.apache.myfaces.tobago.layout.MeasureList getColumns() {
112     return (org.apache.myfaces.tobago.layout.MeasureList) getStateHelper().eval(PropertyKeys.columns);
113   }
114 
115   public void setColumns(org.apache.myfaces.tobago.layout.MeasureList columns) {
116     getStateHelper().put(PropertyKeys.columns, columns);
117   }
118 
119   /**
120   Sets a CSS class in its parent, if the parent supports it.
121 
122    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
123 
124    <pre>
125    &lt;tc:in&gt;
126      &lt;tc:style customClass="my-emphasized"/&gt;
127    &lt;/tc:in&gt;
128    </pre>
129 
130    One capability is, to used external CSS libs.
131    <br>
132    This feature should not be used imprudent.
133    Because it might be unstable against changes in the renderered HTML code.
134 
135   */
136   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
137     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
138   }
139 
140   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
141     getStateHelper().put(PropertyKeys.customClass, customClass);
142   }
143 
144   /**
145   Spacing between the rows in the actual layout.
146 
147   */
148   public org.apache.myfaces.tobago.layout.Measure getRowSpacing() {
149     Object object = getStateHelper().eval(PropertyKeys.rowSpacing);
150     if (object != null) {
151        return Measure.valueOf(object);
152     }
153     return Measure.ZERO;
154   }
155 
156   public void setRowSpacing(org.apache.myfaces.tobago.layout.Measure rowSpacing) {
157     getStateHelper().put(PropertyKeys.rowSpacing, rowSpacing);
158   }
159 
160   /**
161   This value defines the layout constraints for row layout.
162    It is a space separated list of layout tokens '&lt;n&gt;fr', '&lt;measure&gt;' or the keyword 'auto'.
163    Where &lt;n&gt; is a positive integer and &lt;measure&gt; is a valid CSS length.
164    Example: '2fr 1fr 100px 3rem auto'.
165 
166   */
167   public org.apache.myfaces.tobago.layout.MeasureList getRows() {
168     return (org.apache.myfaces.tobago.layout.MeasureList) getStateHelper().eval(PropertyKeys.rows);
169   }
170 
171   public void setRows(org.apache.myfaces.tobago.layout.MeasureList rows) {
172     getStateHelper().put(PropertyKeys.rows, rows);
173   }
174 
175 
176   @Override
177   public void restoreState(FacesContext context, Object state) {
178     // FIXME HACK for mojarra SystemEventListener state restoring bug
179     pushComponentToEL(context, this);
180     super.restoreState(context, state);
181     popComponentFromEL(context);
182   }
183 
184 }