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.internal.taglib;
21  
22  import javax.faces.application.Application;
23  import javax.faces.component.UIComponent;
24  import javax.faces.context.FacesContext;
25  import org.apache.myfaces.tobago.component.UIFlowLayout;
26  import org.apache.myfaces.tobago.internal.util.StringUtils;
27  import org.slf4j.Logger;
28  import org.slf4j.LoggerFactory;
29  
30  /** 
31   * JSP Tag class, generated from template {@code tag1.2.stg} with class 
32   * {@link org.apache.myfaces.tobago.internal.taglib.component.FlowLayoutTagDeclaration}.
33   */
34  public final class FlowLayoutTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(FlowLayoutTag.class);
36    private javax.el.ValueExpression  marginBottom;
37    private javax.el.ValueExpression  markup;
38    private javax.el.ValueExpression  marginTop;
39    private javax.el.ValueExpression  marginLeft;
40    private javax.el.ValueExpression  marginRight;
41    private javax.el.ValueExpression  textAlign;
42    private javax.el.ValueExpression  margin;
43  
44    @Override
45    public String getComponentType() {
46      return UIFlowLayout.COMPONENT_TYPE;
47    }
48    @Override
49    public String getRendererType() {
50      return "FlowLayout";
51    }
52  
53    @Override
54    protected void setProperties(final UIComponent uiComponent) {
55      super.setProperties(uiComponent);
56      final UIFlowLayout component = (UIFlowLayout) uiComponent;
57      final FacesContext context = FacesContext.getCurrentInstance();
58      final Application application = context.getApplication();
59      if (marginBottom != null) {
60        if (!marginBottom.isLiteralText()) {
61          component.setValueExpression("marginBottom", marginBottom);
62        } else {
63          component.setMarginBottom(org.apache.myfaces.tobago.layout.Measure.valueOf(marginBottom.getExpressionString()));
64        }
65      }
66      if (markup != null) {
67        if (!markup.isLiteralText()) {
68          component.setValueExpression("markup", markup);
69        } else {
70          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
71        }
72      }
73      if (marginTop != null) {
74        if (!marginTop.isLiteralText()) {
75          component.setValueExpression("marginTop", marginTop);
76        } else {
77          component.setMarginTop(org.apache.myfaces.tobago.layout.Measure.valueOf(marginTop.getExpressionString()));
78        }
79      }
80      if (marginLeft != null) {
81        if (!marginLeft.isLiteralText()) {
82          component.setValueExpression("marginLeft", marginLeft);
83        } else {
84          component.setMarginLeft(org.apache.myfaces.tobago.layout.Measure.valueOf(marginLeft.getExpressionString()));
85        }
86      }
87      if (marginRight != null) {
88        if (!marginRight.isLiteralText()) {
89          component.setValueExpression("marginRight", marginRight);
90        } else {
91          component.setMarginRight(org.apache.myfaces.tobago.layout.Measure.valueOf(marginRight.getExpressionString()));
92        }
93      }
94      if (textAlign != null) {
95        if (!textAlign.isLiteralText()) {
96          component.setValueExpression("textAlign", textAlign);
97        } else {
98          component.setTextAlign(org.apache.myfaces.tobago.layout.TextAlign.parse(textAlign.getExpressionString()));
99        }
100     }
101     if (margin != null) {
102       if (!margin.isLiteralText()) {
103         component.setValueExpression("margin", margin);
104       } else {
105         component.setMargin(org.apache.myfaces.tobago.layout.Measure.valueOf(margin.getExpressionString()));
106       }
107     }
108   }
109 
110   public javax.el.ValueExpression getMarginBottom() {
111     return marginBottom;
112   }
113 
114   public void setMarginBottom(final javax.el.ValueExpression marginBottom) {
115     this.marginBottom = marginBottom;
116   }
117 
118   public javax.el.ValueExpression getMarkup() {
119     return markup;
120   }
121 
122   public void setMarkup(final javax.el.ValueExpression markup) {
123     this.markup = markup;
124   }
125 
126   public javax.el.ValueExpression getMarginTop() {
127     return marginTop;
128   }
129 
130   public void setMarginTop(final javax.el.ValueExpression marginTop) {
131     this.marginTop = marginTop;
132   }
133 
134   public javax.el.ValueExpression getMarginLeft() {
135     return marginLeft;
136   }
137 
138   public void setMarginLeft(final javax.el.ValueExpression marginLeft) {
139     this.marginLeft = marginLeft;
140   }
141 
142   public javax.el.ValueExpression getMarginRight() {
143     return marginRight;
144   }
145 
146   public void setMarginRight(final javax.el.ValueExpression marginRight) {
147     this.marginRight = marginRight;
148   }
149 
150   public javax.el.ValueExpression getTextAlign() {
151     return textAlign;
152   }
153 
154   public void setTextAlign(final javax.el.ValueExpression textAlign) {
155     this.textAlign = textAlign;
156   }
157 
158   public javax.el.ValueExpression getMargin() {
159     return margin;
160   }
161 
162   public void setMargin(final javax.el.ValueExpression margin) {
163     this.margin = margin;
164   }
165 
166 
167 
168   @Override
169   public void release() {
170     super.release();
171     marginBottom = null;
172     markup = null;
173     marginTop = null;
174     marginLeft = null;
175     marginRight = null;
176     textAlign = null;
177     margin = null;
178   }
179 }