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.AbstractUIFlowLayout;
25  import org.apache.myfaces.tobago.layout.Measure;
26  import org.apache.myfaces.tobago.layout.TextAlign;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.StringUtils;
29  import org.apache.myfaces.tobago.internal.util.Deprecation;
30  import org.apache.myfaces.tobago.renderkit.MarginValues;
31  import org.apache.myfaces.tobago.renderkit.SpacingValues;
32  import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
33  import javax.el.ELException;
34  import javax.faces.FacesException;
35  import java.util.ArrayList;
36  import java.util.List;
37  import javax.el.MethodExpression;
38  import javax.el.ValueExpression;
39  
40  /** 
41   XXX Warning: Still in progress! Please do not use it until other announcement.
42    Renders a FlowLayout that positions the content components in there natural order.
43    * UIComponent class, generated from template {@code component2.0.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.component.FlowLayoutTagDeclaration}.
45   */
46  public class UIFlowLayout
47      extends AbstractUIFlowLayout implements SupportsMarkup {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.FlowLayout";
50  
51    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.FlowLayout";
52  
53    private org.apache.myfaces.tobago.context.Markup currentMarkup;
54  
55    enum PropertyKeys {
56      marginBottom,
57      markup,
58      marginTop,
59      marginLeft,
60      marginRight,
61      textAlign,
62      margin,
63    }
64  
65    public String getFamily() {
66      return COMPONENT_FAMILY;
67    }
68  
69  
70    /**
71    Bottom margin between container component and the children.
72  
73    */
74    public org.apache.myfaces.tobago.layout.Measure getMarginBottom() {
75      Object object = getStateHelper().eval(PropertyKeys.marginBottom);
76      if (object != null) {
77         return Measure.valueOf(object);
78      }
79      return getMargin() != null
80     ? getMargin()
81     : getRendererType() != null ? ((MarginValues)getRenderer(getFacesContext())).getMarginBottom(getFacesContext(), this) : Measure.ZERO;
82    }
83  
84    public void setMarginBottom(org.apache.myfaces.tobago.layout.Measure marginBottom) {
85      getStateHelper().put(PropertyKeys.marginBottom, marginBottom);
86    }
87  
88    public org.apache.myfaces.tobago.context.Markup getMarkup() {
89      Object object = getStateHelper().eval(PropertyKeys.markup);
90      if (object != null) {
91        return Markup.valueOf(object);
92      }
93      return null;
94    }
95  
96    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
97      getStateHelper().put(PropertyKeys.markup, markup);
98    }
99  
100   /**
101   Top margin between container component and the children.
102 
103   */
104   public org.apache.myfaces.tobago.layout.Measure getMarginTop() {
105     Object object = getStateHelper().eval(PropertyKeys.marginTop);
106     if (object != null) {
107        return Measure.valueOf(object);
108     }
109     return getMargin() != null
110    ? getMargin()
111    : getRendererType() != null ? ((MarginValues)getRenderer(getFacesContext())).getMarginTop(getFacesContext(), this) : Measure.ZERO;
112   }
113 
114   public void setMarginTop(org.apache.myfaces.tobago.layout.Measure marginTop) {
115     getStateHelper().put(PropertyKeys.marginTop, marginTop);
116   }
117 
118   /**
119   Left margin between container component and the children.
120 
121   */
122   public org.apache.myfaces.tobago.layout.Measure getMarginLeft() {
123     Object object = getStateHelper().eval(PropertyKeys.marginLeft);
124     if (object != null) {
125        return Measure.valueOf(object);
126     }
127     return getMargin() != null
128    ? getMargin()
129    : getRendererType() != null ? ((MarginValues)getRenderer(getFacesContext())).getMarginLeft(getFacesContext(), this) : Measure.ZERO;
130   }
131 
132   public void setMarginLeft(org.apache.myfaces.tobago.layout.Measure marginLeft) {
133     getStateHelper().put(PropertyKeys.marginLeft, marginLeft);
134   }
135 
136   /**
137   Right margin between container component and the children.
138 
139   */
140   public org.apache.myfaces.tobago.layout.Measure getMarginRight() {
141     Object object = getStateHelper().eval(PropertyKeys.marginRight);
142     if (object != null) {
143        return Measure.valueOf(object);
144     }
145     return getMargin() != null
146    ? getMargin()
147    : getRendererType() != null ? ((MarginValues)getRenderer(getFacesContext())).getMarginRight(getFacesContext(), this) : Measure.ZERO;
148   }
149 
150   public void setMarginRight(org.apache.myfaces.tobago.layout.Measure marginRight) {
151     getStateHelper().put(PropertyKeys.marginRight, marginRight);
152   }
153 
154   public org.apache.myfaces.tobago.context.Markup getCurrentMarkup() {
155     if (currentMarkup != null) {
156       return currentMarkup;
157     }
158     return null;
159   }
160 
161   public void setCurrentMarkup(org.apache.myfaces.tobago.context.Markup currentMarkup) {
162     this.currentMarkup = currentMarkup;
163   }
164 
165   /**
166   The alignment of the elements inside of the container, possible values are:
167    {
168   <br />Default: <code>TextAlign.LEFT</code><br />Allowed Values: <code>left,right,center,justify</code>
169   */
170   public org.apache.myfaces.tobago.layout.TextAlign getTextAlign() {
171     org.apache.myfaces.tobago.layout.TextAlign textAlign = (org.apache.myfaces.tobago.layout.TextAlign) getStateHelper().eval(PropertyKeys.textAlign);
172     if (textAlign != null) {
173       return textAlign;
174     }
175     return TextAlign.LEFT;
176   }
177 
178   public void setTextAlign(org.apache.myfaces.tobago.layout.TextAlign textAlign) {
179     getStateHelper().put(PropertyKeys.textAlign, textAlign);
180   }
181 
182   /**
183   Margin between container component and the children.
184 
185   */
186   public org.apache.myfaces.tobago.layout.Measure getMargin() {
187     Object object = getStateHelper().eval(PropertyKeys.margin);
188     if (object != null) {
189        return Measure.valueOf(object);
190     }
191     return null;
192   }
193 
194   public void setMargin(org.apache.myfaces.tobago.layout.Measure margin) {
195     getStateHelper().put(PropertyKeys.margin, margin);
196   }
197 
198   public Object saveState(FacesContext context) {
199     currentMarkup = null;
200     return super.saveState(context);
201   }
202 
203 }