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.commons.lang.StringUtils;
26  import org.apache.myfaces.tobago.component.UIGridLayout;
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.GridLayoutTagDeclaration}.
33   */
34  public final class GridLayoutTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(GridLayoutTag.class);
36    private javax.el.ValueExpression  rowOverflow;
37    private javax.el.ValueExpression  markup;
38    private javax.el.ValueExpression  marginLeft;
39    private javax.el.ValueExpression  marginTop;
40    private javax.el.ValueExpression  marginRight;
41    private javax.el.ValueExpression  columns;
42    private javax.el.ValueExpression  cellspacing;
43    private javax.el.ValueExpression  rows;
44    private javax.el.ValueExpression  marginBottom;
45    private javax.el.ValueExpression  columnOverflow;
46    private javax.el.ValueExpression  rowSpacing;
47    private javax.el.ValueExpression  margin;
48    private javax.el.ValueExpression  border;
49    private javax.el.ValueExpression  columnSpacing;
50  
51    @Override
52    public String getComponentType() {
53      return UIGridLayout.COMPONENT_TYPE;
54    }
55    @Override
56    public String getRendererType() {
57      return "GridLayout";
58    }
59  
60    @Override
61    protected void setProperties(final UIComponent uiComponent) {
62      super.setProperties(uiComponent);
63      final UIGridLayout component = (UIGridLayout) uiComponent;
64      final FacesContext context = FacesContext.getCurrentInstance();
65      final Application application = context.getApplication();
66      if (rowOverflow != null) {
67        if (!rowOverflow.isLiteralText()) {
68          component.setValueExpression("rowOverflow", rowOverflow);
69        } else {
70          component.setRowOverflow(Boolean.parseBoolean(rowOverflow.getExpressionString()));
71        }
72      }
73      if (markup != null) {
74        if (!markup.isLiteralText()) {
75          component.setValueExpression("markup", markup);
76        } else {
77          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.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 (marginTop != null) {
88        if (!marginTop.isLiteralText()) {
89          component.setValueExpression("marginTop", marginTop);
90        } else {
91          component.setMarginTop(org.apache.myfaces.tobago.layout.Measure.valueOf(marginTop.getExpressionString()));
92        }
93      }
94      if (marginRight != null) {
95        if (!marginRight.isLiteralText()) {
96          component.setValueExpression("marginRight", marginRight);
97        } else {
98          component.setMarginRight(org.apache.myfaces.tobago.layout.Measure.valueOf(marginRight.getExpressionString()));
99        }
100     }
101     if (columns != null) {
102       component.setValueExpression("columns", columns);
103     }
104 
105     if (cellspacing != null) {
106       if (!cellspacing.isLiteralText()) {
107         component.setValueExpression("cellspacing", cellspacing);
108       } else {
109         component.setCellspacing(org.apache.myfaces.tobago.layout.Measure.valueOf(cellspacing.getExpressionString()));
110       }
111     }
112     if (rows != null) {
113       component.setValueExpression("rows", rows);
114     }
115 
116     if (marginBottom != null) {
117       if (!marginBottom.isLiteralText()) {
118         component.setValueExpression("marginBottom", marginBottom);
119       } else {
120         component.setMarginBottom(org.apache.myfaces.tobago.layout.Measure.valueOf(marginBottom.getExpressionString()));
121       }
122     }
123     if (columnOverflow != null) {
124       if (!columnOverflow.isLiteralText()) {
125         component.setValueExpression("columnOverflow", columnOverflow);
126       } else {
127         component.setColumnOverflow(Boolean.parseBoolean(columnOverflow.getExpressionString()));
128       }
129     }
130     if (rowSpacing != null) {
131       if (!rowSpacing.isLiteralText()) {
132         component.setValueExpression("rowSpacing", rowSpacing);
133       } else {
134         component.setRowSpacing(org.apache.myfaces.tobago.layout.Measure.valueOf(rowSpacing.getExpressionString()));
135       }
136     }
137     if (margin != null) {
138       if (!margin.isLiteralText()) {
139         component.setValueExpression("margin", margin);
140       } else {
141         component.setMargin(org.apache.myfaces.tobago.layout.Measure.valueOf(margin.getExpressionString()));
142       }
143     }
144     if (border != null) {
145       component.setValueExpression("border", border);
146     }
147 
148     if (columnSpacing != null) {
149       if (!columnSpacing.isLiteralText()) {
150         component.setValueExpression("columnSpacing", columnSpacing);
151       } else {
152         component.setColumnSpacing(org.apache.myfaces.tobago.layout.Measure.valueOf(columnSpacing.getExpressionString()));
153       }
154     }
155   }
156 
157   public javax.el.ValueExpression getRowOverflow() {
158     return rowOverflow;
159   }
160 
161   public void setRowOverflow(final javax.el.ValueExpression rowOverflow) {
162     this.rowOverflow = rowOverflow;
163   }
164 
165   public javax.el.ValueExpression getMarkup() {
166     return markup;
167   }
168 
169   public void setMarkup(final javax.el.ValueExpression markup) {
170     this.markup = markup;
171   }
172 
173   public javax.el.ValueExpression getMarginLeft() {
174     return marginLeft;
175   }
176 
177   public void setMarginLeft(final javax.el.ValueExpression marginLeft) {
178     this.marginLeft = marginLeft;
179   }
180 
181   public javax.el.ValueExpression getMarginTop() {
182     return marginTop;
183   }
184 
185   public void setMarginTop(final javax.el.ValueExpression marginTop) {
186     this.marginTop = marginTop;
187   }
188 
189   public javax.el.ValueExpression getMarginRight() {
190     return marginRight;
191   }
192 
193   public void setMarginRight(final javax.el.ValueExpression marginRight) {
194     this.marginRight = marginRight;
195   }
196 
197   public javax.el.ValueExpression getColumns() {
198     return columns;
199   }
200 
201   public void setColumns(final javax.el.ValueExpression columns) {
202     this.columns = columns;
203   }
204 
205   public javax.el.ValueExpression getCellspacing() {
206     return cellspacing;
207   }
208 
209   public void setCellspacing(final javax.el.ValueExpression cellspacing) {
210     this.cellspacing = cellspacing;
211   }
212 
213   public javax.el.ValueExpression getRows() {
214     return rows;
215   }
216 
217   public void setRows(final javax.el.ValueExpression rows) {
218     this.rows = rows;
219   }
220 
221   public javax.el.ValueExpression getMarginBottom() {
222     return marginBottom;
223   }
224 
225   public void setMarginBottom(final javax.el.ValueExpression marginBottom) {
226     this.marginBottom = marginBottom;
227   }
228 
229   public javax.el.ValueExpression getColumnOverflow() {
230     return columnOverflow;
231   }
232 
233   public void setColumnOverflow(final javax.el.ValueExpression columnOverflow) {
234     this.columnOverflow = columnOverflow;
235   }
236 
237   public javax.el.ValueExpression getRowSpacing() {
238     return rowSpacing;
239   }
240 
241   public void setRowSpacing(final javax.el.ValueExpression rowSpacing) {
242     this.rowSpacing = rowSpacing;
243   }
244 
245   public javax.el.ValueExpression getMargin() {
246     return margin;
247   }
248 
249   public void setMargin(final javax.el.ValueExpression margin) {
250     this.margin = margin;
251   }
252 
253   public javax.el.ValueExpression getBorder() {
254     return border;
255   }
256 
257   public void setBorder(final javax.el.ValueExpression border) {
258     this.border = border;
259   }
260 
261   public javax.el.ValueExpression getColumnSpacing() {
262     return columnSpacing;
263   }
264 
265   public void setColumnSpacing(final javax.el.ValueExpression columnSpacing) {
266     this.columnSpacing = columnSpacing;
267   }
268 
269 
270 
271   @Override
272   public void release() {
273     super.release();
274     rowOverflow = null;
275     markup = null;
276     marginLeft = null;
277     marginTop = null;
278     marginRight = null;
279     columns = null;
280     cellspacing = null;
281     rows = null;
282     marginBottom = null;
283     columnOverflow = null;
284     rowSpacing = null;
285     margin = null;
286     border = null;
287     columnSpacing = null;
288   }
289 }