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