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