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.Orientation;
27  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
28  import org.apache.myfaces.tobago.renderkit.css.Style;
29  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
30  import org.apache.myfaces.tobago.internal.util.StringUtils;
31  import org.apache.myfaces.tobago.internal.util.Deprecation;
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 SplitLayout.
41    A area with two child components rendered horizontally or vertically and allows to change the
42    layout relation of this two components on the client.
43    * UIComponent class, generated from template {@code component.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.sandbox.SplitLayoutTagDeclaration}.
45   */
46  public class UISplitLayout
47      extends AbstractUISplitLayout implements Visual {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.SplitLayout";
50  
51    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.GridLayout";
52  
53  
54    enum PropertyKeys {
55      layout,
56      columnSpacing,
57      orientation,
58      markup,
59      customClass,
60      style,
61      rowSpacing,
62      rigid,
63    }
64  
65    public String getFamily() {
66      return COMPONENT_FAMILY;
67    }
68  
69  
70    /**
71    This value defines the layout constraints for the layout.
72     It is two layout tokens separated by a semicolon. See GridLayout.
73     Example: '2*;*'.
74    <br>Default: <code>1*;1*</code>
75    */
76    public java.lang.String getLayout() {
77      java.lang.String layout = (java.lang.String) getStateHelper().eval(PropertyKeys.layout);
78      if (layout != null) {
79        return layout;
80      }
81      return "1*;1*";
82    }
83  
84    public void setLayout(java.lang.String layout) {
85      getStateHelper().put(PropertyKeys.layout, layout);
86    }
87  
88    /**
89    Spacing between the columns in the actual layout.
90  
91    */
92    public org.apache.myfaces.tobago.layout.Measure getColumnSpacing() {
93      Object object = getStateHelper().eval(PropertyKeys.columnSpacing);
94      if (object != null) {
95         return Measure.valueOf(object);
96      }
97      return Measure.ZERO;
98    }
99  
100   public void setColumnSpacing(org.apache.myfaces.tobago.layout.Measure columnSpacing) {
101     getStateHelper().put(PropertyKeys.columnSpacing, columnSpacing);
102   }
103 
104   /**
105   This value defines the orientation of the split layout.
106    Possible values are {
107   <br>Allowed Values: <code>horizontal,vertical</code>
108   */
109   public org.apache.myfaces.tobago.layout.Orientation getOrientation() {
110     return (org.apache.myfaces.tobago.layout.Orientation) getStateHelper().eval(PropertyKeys.orientation);
111   }
112 
113   public void setOrientation(org.apache.myfaces.tobago.layout.Orientation orientation) {
114     getStateHelper().put(PropertyKeys.orientation, orientation);
115   }
116 
117   public org.apache.myfaces.tobago.context.Markup getMarkup() {
118     Object object = getStateHelper().eval(PropertyKeys.markup);
119     if (object != null) {
120       return Markup.valueOf(object);
121     }
122     return null;
123   }
124 
125   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
126     getStateHelper().put(PropertyKeys.markup, markup);
127   }
128 
129   /**
130   Sets a CSS class in its parent, if the parent supports it.
131 
132    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
133 
134    <pre>
135    &lt;tc:in&gt;
136      &lt;tc:style customClass="my-emphasized"/&gt;
137    &lt;/tc:in&gt;
138    </pre>
139 
140    One capability is, to used external CSS libs.
141    <br>
142    This feature should not be used imprudent.
143    Because it might be unstable against changes in the renderered HTML code.
144 
145   */
146   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
147     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
148   }
149 
150   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
151     getStateHelper().put(PropertyKeys.customClass, customClass);
152   }
153 
154   /**
155   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
156 
157   */
158   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
159     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
160   }
161 
162   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
163     getStateHelper().put(PropertyKeys.style, style);
164   }
165 
166   /**
167   Spacing between the rows in the actual layout.
168 
169   */
170   public org.apache.myfaces.tobago.layout.Measure getRowSpacing() {
171     Object object = getStateHelper().eval(PropertyKeys.rowSpacing);
172     if (object != null) {
173        return Measure.valueOf(object);
174     }
175     return Measure.ZERO;
176   }
177 
178   public void setRowSpacing(org.apache.myfaces.tobago.layout.Measure rowSpacing) {
179     getStateHelper().put(PropertyKeys.rowSpacing, rowSpacing);
180   }
181 
182   /**
183   This attribute advises the layout manager, to not use space that comes from non rendered components.
184 
185   */
186   public boolean isRigid() {
187     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.rigid);
188     if (bool != null) {
189       return bool;
190     }
191     return false;
192   }
193 
194   public void setRigid(boolean rigid) {
195     getStateHelper().put(PropertyKeys.rigid, rigid);
196   }
197 
198 
199 }