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.UIColumn;
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.ColumnTagDeclaration}.
33   */
34  public final class ColumnTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(ColumnTag.class);
36    private javax.el.ValueExpression  markup;
37    private javax.el.ValueExpression  width;
38    private javax.el.ValueExpression  sortable;
39    private javax.el.ValueExpression  align;
40    private javax.el.ValueExpression  label;
41    private javax.el.ValueExpression  tip;
42    private javax.el.ValueExpression  resizable;
43  
44    @Override
45    public String getComponentType() {
46      return UIColumn.COMPONENT_TYPE;
47    }
48    @Override
49    public String getRendererType() {
50      return "Column";
51    }
52  
53    @Override
54    protected void setProperties(final UIComponent uiComponent) {
55      super.setProperties(uiComponent);
56      final UIColumn component = (UIColumn) uiComponent;
57      final FacesContext context = FacesContext.getCurrentInstance();
58      final Application application = context.getApplication();
59      if (markup != null) {
60        if (!markup.isLiteralText()) {
61          component.setValueExpression("markup", markup);
62        } else {
63          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
64        }
65      }
66      if (width != null) {
67        if (!width.isLiteralText()) {
68          component.setValueExpression("width", width);
69        } else {
70          component.setWidth(org.apache.myfaces.tobago.layout.Measure.valueOf(width.getExpressionString()));
71        }
72      }
73      if (sortable != null) {
74        if (!sortable.isLiteralText()) {
75          component.setValueExpression("sortable", sortable);
76        } else {
77          component.setSortable(Boolean.parseBoolean(sortable.getExpressionString()));
78        }
79      }
80      if (align != null) {
81        component.setValueExpression("align", align);
82      }
83  
84      if (label != null) {
85        component.setValueExpression("label", label);
86      }
87  
88      if (tip != null) {
89        component.setValueExpression("tip", tip);
90      }
91  
92      if (resizable != null) {
93        if (!resizable.isLiteralText()) {
94          component.setValueExpression("resizable", resizable);
95        } else {
96          component.setResizable(Boolean.parseBoolean(resizable.getExpressionString()));
97        }
98      }
99    }
100 
101   public javax.el.ValueExpression getMarkup() {
102     return markup;
103   }
104 
105   public void setMarkup(final javax.el.ValueExpression markup) {
106     this.markup = markup;
107   }
108 
109   public javax.el.ValueExpression getWidth() {
110     return width;
111   }
112 
113   public void setWidth(final javax.el.ValueExpression width) {
114     this.width = width;
115   }
116 
117   public javax.el.ValueExpression getSortable() {
118     return sortable;
119   }
120 
121   public void setSortable(final javax.el.ValueExpression sortable) {
122     this.sortable = sortable;
123   }
124 
125   public javax.el.ValueExpression getAlign() {
126     return align;
127   }
128 
129   public void setAlign(final javax.el.ValueExpression align) {
130     this.align = align;
131   }
132 
133   public javax.el.ValueExpression getLabel() {
134     return label;
135   }
136 
137   public void setLabel(final javax.el.ValueExpression label) {
138     this.label = label;
139   }
140 
141   public javax.el.ValueExpression getTip() {
142     return tip;
143   }
144 
145   public void setTip(final javax.el.ValueExpression tip) {
146     this.tip = tip;
147   }
148 
149   public javax.el.ValueExpression getResizable() {
150     return resizable;
151   }
152 
153   public void setResizable(final javax.el.ValueExpression resizable) {
154     this.resizable = resizable;
155   }
156 
157 
158 
159   @Override
160   public void release() {
161     super.release();
162     markup = null;
163     width = null;
164     sortable = null;
165     align = null;
166     label = null;
167     tip = null;
168     resizable = null;
169   }
170 }