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.UISheet;
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.SheetTagDeclaration}.
33   */
34  public final class SheetTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(SheetTag.class);
36    private javax.el.ValueExpression  markup;
37    private javax.el.ValueExpression  columns;
38    private javax.el.ValueExpression  showDirectLinks;
39    private javax.el.ValueExpression  showPageRange;
40    private javax.el.ValueExpression  value;
41    private javax.el.ValueExpression  forceVerticalScrollbar;
42    private javax.el.MethodExpression  stateChangeListener;
43    private javax.el.ValueExpression  showRootJunction;
44    private javax.el.ValueExpression  rows;
45    private javax.el.ValueExpression  showPagingAlways;
46    private javax.el.ValueExpression  renderedPartially;
47    private String var;
48    private javax.el.ValueExpression  state;
49    private javax.el.ValueExpression  showPageRangeArrows;
50    private javax.el.ValueExpression  showRoot;
51    private javax.el.ValueExpression  showDirectLinksArrows;
52    private javax.el.ValueExpression  showRowRange;
53    private javax.el.ValueExpression  selectable;
54    private javax.el.ValueExpression  showHeader;
55    private javax.el.ValueExpression  directLinkCount;
56    private javax.el.MethodExpression  sortActionListener;
57    private javax.el.ValueExpression  first;
58  
59    @Override
60    public String getComponentType() {
61      return UISheet.COMPONENT_TYPE;
62    }
63    @Override
64    public String getRendererType() {
65      return "Sheet";
66    }
67  
68    @Override
69    protected void setProperties(final UIComponent uiComponent) {
70      super.setProperties(uiComponent);
71      final UISheet component = (UISheet) uiComponent;
72      final FacesContext context = FacesContext.getCurrentInstance();
73      final Application application = context.getApplication();
74      if (markup != null) {
75        if (!markup.isLiteralText()) {
76          component.setValueExpression("markup", markup);
77        } else {
78          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
79        }
80      }
81      if (columns != null) {
82        component.setValueExpression("columns", columns);
83      }
84  
85      if (showDirectLinks != null) {
86        component.setValueExpression("showDirectLinks", showDirectLinks);
87      }
88  
89      if (showPageRange != null) {
90        component.setValueExpression("showPageRange", showPageRange);
91      }
92  
93      if (value != null) {
94        if (!value.isLiteralText()) {
95          component.setValueExpression("value", value);
96        /*} else {
97          component.setValue(value.getExpressionString());*/
98        }
99      }
100     if (forceVerticalScrollbar != null) {
101       component.setValueExpression("forceVerticalScrollbar", forceVerticalScrollbar);
102     }
103 
104     if (stateChangeListener != null) {
105       component.addStateChangeListener(new org.apache.myfaces.tobago.event.MethodExpressionStateChangeListener(stateChangeListener));
106     }
107     if (showRootJunction != null) {
108       if (!showRootJunction.isLiteralText()) {
109         component.setValueExpression("showRootJunction", showRootJunction);
110       } else {
111         component.setShowRootJunction(Boolean.parseBoolean(showRootJunction.getExpressionString()));
112       }
113     }
114     if (rows != null) {
115       if (!rows.isLiteralText()) {
116         component.setValueExpression("rows", rows);
117       } else {
118         component.setRows(Integer.parseInt(rows.getExpressionString()));
119       }
120     }
121     if (showPagingAlways != null) {
122       if (!showPagingAlways.isLiteralText()) {
123         component.setValueExpression("showPagingAlways", showPagingAlways);
124       } else {
125         component.setShowPagingAlways(Boolean.parseBoolean(showPagingAlways.getExpressionString()));
126       }
127     }
128     if (renderedPartially != null) {
129       if (!renderedPartially.isLiteralText()) {
130         component.setValueExpression("renderedPartially", renderedPartially);
131       } else {
132         component.setRenderedPartially(splitList(renderedPartially.getExpressionString()));
133       }
134     }
135     if (var != null) {
136       component.setVar(var);
137     }
138 
139     if (state != null) {
140       if (!state.isLiteralText()) {
141         component.setValueExpression("state", state);
142       /*} else {
143         component.setState(state.getExpressionString());*/
144       }
145     }
146     if (showPageRangeArrows != null) {
147       if (!showPageRangeArrows.isLiteralText()) {
148         component.setValueExpression("showPageRangeArrows", showPageRangeArrows);
149       } else {
150         component.setShowPageRangeArrows(Boolean.parseBoolean(showPageRangeArrows.getExpressionString()));
151       }
152     }
153     if (showRoot != null) {
154       if (!showRoot.isLiteralText()) {
155         component.setValueExpression("showRoot", showRoot);
156       } else {
157         component.setShowRoot(Boolean.parseBoolean(showRoot.getExpressionString()));
158       }
159     }
160     if (showDirectLinksArrows != null) {
161       if (!showDirectLinksArrows.isLiteralText()) {
162         component.setValueExpression("showDirectLinksArrows", showDirectLinksArrows);
163       } else {
164         component.setShowDirectLinksArrows(Boolean.parseBoolean(showDirectLinksArrows.getExpressionString()));
165       }
166     }
167     if (showRowRange != null) {
168       component.setValueExpression("showRowRange", showRowRange);
169     }
170 
171     if (selectable != null) {
172       component.setValueExpression("selectable", selectable);
173     }
174 
175     if (showHeader != null) {
176       if (!showHeader.isLiteralText()) {
177         component.setValueExpression("showHeader", showHeader);
178       } else {
179         component.setShowHeader(Boolean.parseBoolean(showHeader.getExpressionString()));
180       }
181     }
182     if (directLinkCount != null) {
183       if (!directLinkCount.isLiteralText()) {
184         component.setValueExpression("directLinkCount", directLinkCount);
185       } else {
186         component.setDirectLinkCount(Integer.parseInt(directLinkCount.getExpressionString()));
187       }
188     }
189     if (sortActionListener != null) {
190       component.setSortActionListenerExpression(sortActionListener);
191     }
192     if (first != null) {
193       if (!first.isLiteralText()) {
194         component.setValueExpression("first", first);
195       } else {
196         component.setFirst(Integer.parseInt(first.getExpressionString()));
197       }
198     }
199   }
200 
201   public javax.el.ValueExpression getMarkup() {
202     return markup;
203   }
204 
205   public void setMarkup(final javax.el.ValueExpression markup) {
206     this.markup = markup;
207   }
208 
209   public javax.el.ValueExpression getColumns() {
210     return columns;
211   }
212 
213   public void setColumns(final javax.el.ValueExpression columns) {
214     this.columns = columns;
215   }
216 
217   public javax.el.ValueExpression getShowDirectLinks() {
218     return showDirectLinks;
219   }
220 
221   public void setShowDirectLinks(final javax.el.ValueExpression showDirectLinks) {
222     this.showDirectLinks = showDirectLinks;
223   }
224 
225   public javax.el.ValueExpression getShowPageRange() {
226     return showPageRange;
227   }
228 
229   public void setShowPageRange(final javax.el.ValueExpression showPageRange) {
230     this.showPageRange = showPageRange;
231   }
232 
233   public javax.el.ValueExpression getValue() {
234     return value;
235   }
236 
237   public void setValue(final javax.el.ValueExpression value) {
238     this.value = value;
239   }
240 
241   public javax.el.ValueExpression getForceVerticalScrollbar() {
242     return forceVerticalScrollbar;
243   }
244 
245   public void setForceVerticalScrollbar(final javax.el.ValueExpression forceVerticalScrollbar) {
246     this.forceVerticalScrollbar = forceVerticalScrollbar;
247   }
248 
249   public javax.el.MethodExpression getStateChangeListener() {
250     return stateChangeListener;
251   }
252 
253   public void setStateChangeListener(final javax.el.MethodExpression stateChangeListener) {
254     this.stateChangeListener = stateChangeListener;
255   }
256 
257   public javax.el.ValueExpression getShowRootJunction() {
258     return showRootJunction;
259   }
260 
261   public void setShowRootJunction(final javax.el.ValueExpression showRootJunction) {
262     this.showRootJunction = showRootJunction;
263   }
264 
265   public javax.el.ValueExpression getRows() {
266     return rows;
267   }
268 
269   public void setRows(final javax.el.ValueExpression rows) {
270     this.rows = rows;
271   }
272 
273   public javax.el.ValueExpression getShowPagingAlways() {
274     return showPagingAlways;
275   }
276 
277   public void setShowPagingAlways(final javax.el.ValueExpression showPagingAlways) {
278     this.showPagingAlways = showPagingAlways;
279   }
280 
281   public javax.el.ValueExpression getRenderedPartially() {
282     return renderedPartially;
283   }
284 
285   public void setRenderedPartially(final javax.el.ValueExpression renderedPartially) {
286     this.renderedPartially = renderedPartially;
287   }
288 
289   public String getVar() {
290     return var;
291   }
292 
293   public void setVar(final String var) {
294     this.var = var;
295   }
296 
297   public javax.el.ValueExpression getState() {
298     return state;
299   }
300 
301   public void setState(final javax.el.ValueExpression state) {
302     this.state = state;
303   }
304 
305   public javax.el.ValueExpression getShowPageRangeArrows() {
306     return showPageRangeArrows;
307   }
308 
309   public void setShowPageRangeArrows(final javax.el.ValueExpression showPageRangeArrows) {
310     this.showPageRangeArrows = showPageRangeArrows;
311   }
312 
313   public javax.el.ValueExpression getShowRoot() {
314     return showRoot;
315   }
316 
317   public void setShowRoot(final javax.el.ValueExpression showRoot) {
318     this.showRoot = showRoot;
319   }
320 
321   public javax.el.ValueExpression getShowDirectLinksArrows() {
322     return showDirectLinksArrows;
323   }
324 
325   public void setShowDirectLinksArrows(final javax.el.ValueExpression showDirectLinksArrows) {
326     this.showDirectLinksArrows = showDirectLinksArrows;
327   }
328 
329   public javax.el.ValueExpression getShowRowRange() {
330     return showRowRange;
331   }
332 
333   public void setShowRowRange(final javax.el.ValueExpression showRowRange) {
334     this.showRowRange = showRowRange;
335   }
336 
337   public javax.el.ValueExpression getSelectable() {
338     return selectable;
339   }
340 
341   public void setSelectable(final javax.el.ValueExpression selectable) {
342     this.selectable = selectable;
343   }
344 
345   public javax.el.ValueExpression getShowHeader() {
346     return showHeader;
347   }
348 
349   public void setShowHeader(final javax.el.ValueExpression showHeader) {
350     this.showHeader = showHeader;
351   }
352 
353   public javax.el.ValueExpression getDirectLinkCount() {
354     return directLinkCount;
355   }
356 
357   public void setDirectLinkCount(final javax.el.ValueExpression directLinkCount) {
358     this.directLinkCount = directLinkCount;
359   }
360 
361   public javax.el.MethodExpression getSortActionListener() {
362     return sortActionListener;
363   }
364 
365   public void setSortActionListener(final javax.el.MethodExpression sortActionListener) {
366     this.sortActionListener = sortActionListener;
367   }
368 
369   public javax.el.ValueExpression getFirst() {
370     return first;
371   }
372 
373   public void setFirst(final javax.el.ValueExpression first) {
374     this.first = first;
375   }
376 
377 
378 
379   @Override
380   public void release() {
381     super.release();
382     markup = null;
383     columns = null;
384     showDirectLinks = null;
385     showPageRange = null;
386     value = null;
387     forceVerticalScrollbar = null;
388     stateChangeListener = null;
389     showRootJunction = null;
390     rows = null;
391     showPagingAlways = null;
392     renderedPartially = null;
393     var = null;
394     state = null;
395     showPageRangeArrows = null;
396     showRoot = null;
397     showDirectLinksArrows = null;
398     showRowRange = null;
399     selectable = null;
400     showHeader = null;
401     directLinkCount = null;
402     sortActionListener = null;
403     first = null;
404   }
405 }