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.UITreeNode;
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.TreeNodeTagDeclaration}.
33   */
34  public final class TreeNodeTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(TreeNodeTag.class);
36    private javax.el.ValueExpression  marked;
37    private javax.el.ValueExpression  markup;
38    private javax.el.MethodExpression  treeExpansionListener;
39    private javax.el.ValueExpression  width;
40    private javax.el.ValueExpression  expanded;
41    private javax.el.ValueExpression  tip;
42    private javax.el.MethodExpression  treeMarkedListener;
43    private javax.el.ValueExpression  selected;
44    private javax.el.ValueExpression  disabled;
45  
46    @Override
47    public String getComponentType() {
48      return UITreeNode.COMPONENT_TYPE;
49    }
50    @Override
51    public String getRendererType() {
52      return "TreeNode";
53    }
54  
55    @Override
56    protected void setProperties(final UIComponent uiComponent) {
57      super.setProperties(uiComponent);
58      final UITreeNode component = (UITreeNode) uiComponent;
59      final FacesContext context = FacesContext.getCurrentInstance();
60      final Application application = context.getApplication();
61      if (marked != null) {
62        if (!marked.isLiteralText()) {
63          component.setValueExpression("marked", marked);
64        } else {
65          component.setMarked(Boolean.parseBoolean(marked.getExpressionString()));
66        }
67      }
68      if (markup != null) {
69        if (!markup.isLiteralText()) {
70          component.setValueExpression("markup", markup);
71        } else {
72          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
73        }
74      }
75      if (treeExpansionListener != null) {
76        component.addTreeExpansionListener(new org.apache.myfaces.tobago.event.MethodExpressionTreeExpansionListener(treeExpansionListener));
77      }
78      if (width != null) {
79        if (!width.isLiteralText()) {
80          component.setValueExpression("width", width);
81        } else {
82          component.setWidth(org.apache.myfaces.tobago.layout.Measure.valueOf(width.getExpressionString()));
83        }
84      }
85      if (expanded != null) {
86        if (!expanded.isLiteralText()) {
87          component.setValueExpression("expanded", expanded);
88        } else {
89          component.setExpanded(Boolean.parseBoolean(expanded.getExpressionString()));
90        }
91      }
92      if (tip != null) {
93        component.setValueExpression("tip", tip);
94      }
95  
96      if (treeMarkedListener != null) {
97        component.addTreeMarkedListener(new org.apache.myfaces.tobago.event.MethodExpressionTreeMarkedListener(treeMarkedListener));
98      }
99      if (selected != null) {
100       if (!selected.isLiteralText()) {
101         component.setValueExpression("selected", selected);
102       } else {
103         component.setSelected(Boolean.parseBoolean(selected.getExpressionString()));
104       }
105     }
106     if (disabled != null) {
107       if (!disabled.isLiteralText()) {
108         component.setValueExpression("disabled", disabled);
109       } else {
110         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
111       }
112     }
113   }
114 
115   public javax.el.ValueExpression getMarked() {
116     return marked;
117   }
118 
119   public void setMarked(final javax.el.ValueExpression marked) {
120     this.marked = marked;
121   }
122 
123   public javax.el.ValueExpression getMarkup() {
124     return markup;
125   }
126 
127   public void setMarkup(final javax.el.ValueExpression markup) {
128     this.markup = markup;
129   }
130 
131   public javax.el.MethodExpression getTreeExpansionListener() {
132     return treeExpansionListener;
133   }
134 
135   public void setTreeExpansionListener(final javax.el.MethodExpression treeExpansionListener) {
136     this.treeExpansionListener = treeExpansionListener;
137   }
138 
139   public javax.el.ValueExpression getWidth() {
140     return width;
141   }
142 
143   public void setWidth(final javax.el.ValueExpression width) {
144     this.width = width;
145   }
146 
147   public javax.el.ValueExpression getExpanded() {
148     return expanded;
149   }
150 
151   public void setExpanded(final javax.el.ValueExpression expanded) {
152     this.expanded = expanded;
153   }
154 
155   public javax.el.ValueExpression getTip() {
156     return tip;
157   }
158 
159   public void setTip(final javax.el.ValueExpression tip) {
160     this.tip = tip;
161   }
162 
163   public javax.el.MethodExpression getTreeMarkedListener() {
164     return treeMarkedListener;
165   }
166 
167   public void setTreeMarkedListener(final javax.el.MethodExpression treeMarkedListener) {
168     this.treeMarkedListener = treeMarkedListener;
169   }
170 
171   public javax.el.ValueExpression getSelected() {
172     return selected;
173   }
174 
175   public void setSelected(final javax.el.ValueExpression selected) {
176     this.selected = selected;
177   }
178 
179   public javax.el.ValueExpression getDisabled() {
180     return disabled;
181   }
182 
183   public void setDisabled(final javax.el.ValueExpression disabled) {
184     this.disabled = disabled;
185   }
186 
187 
188 
189   @Override
190   public void release() {
191     super.release();
192     marked = null;
193     markup = null;
194     treeExpansionListener = null;
195     width = null;
196     expanded = null;
197     tip = null;
198     treeMarkedListener = null;
199     selected = null;
200     disabled = null;
201   }
202 }