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