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.UICell;
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.CellTagDeclaration}.
33   */
34  public final class CellTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(CellTag.class);
36    private javax.el.ValueExpression  markup;
37    private javax.el.ValueExpression  scrollbars;
38    private javax.el.ValueExpression  spanX;
39    private javax.el.ValueExpression  spanY;
40  
41    @Override
42    public String getComponentType() {
43      return UICell.COMPONENT_TYPE;
44    }
45    @Override
46    public String getRendererType() {
47      return "Cell";
48    }
49  
50    @Override
51    protected void setProperties(final UIComponent uiComponent) {
52      super.setProperties(uiComponent);
53      final UICell component = (UICell) uiComponent;
54      final FacesContext context = FacesContext.getCurrentInstance();
55      final Application application = context.getApplication();
56      if (markup != null) {
57        if (!markup.isLiteralText()) {
58          component.setValueExpression("markup", markup);
59        } else {
60          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
61        }
62      }
63      if (scrollbars != null) {
64        component.setValueExpression("scrollbars", scrollbars);
65      }
66  
67      if (spanX != null) {
68        if (!spanX.isLiteralText()) {
69          component.setValueExpression("spanX", spanX);
70        } else {
71          component.setSpanX(Integer.parseInt(spanX.getExpressionString()));
72        }
73      }
74      if (spanY != null) {
75        if (!spanY.isLiteralText()) {
76          component.setValueExpression("spanY", spanY);
77        } else {
78          component.setSpanY(Integer.parseInt(spanY.getExpressionString()));
79        }
80      }
81    }
82  
83    public javax.el.ValueExpression getMarkup() {
84      return markup;
85    }
86  
87    public void setMarkup(final javax.el.ValueExpression markup) {
88      this.markup = markup;
89    }
90  
91    public javax.el.ValueExpression getScrollbars() {
92      return scrollbars;
93    }
94  
95    public void setScrollbars(final javax.el.ValueExpression scrollbars) {
96      this.scrollbars = scrollbars;
97    }
98  
99    public javax.el.ValueExpression getSpanX() {
100     return spanX;
101   }
102 
103   public void setSpanX(final javax.el.ValueExpression spanX) {
104     this.spanX = spanX;
105   }
106 
107   public javax.el.ValueExpression getSpanY() {
108     return spanY;
109   }
110 
111   public void setSpanY(final javax.el.ValueExpression spanY) {
112     this.spanY = spanY;
113   }
114 
115 
116 
117   @Override
118   public void release() {
119     super.release();
120     markup = null;
121     scrollbars = null;
122     spanX = null;
123     spanY = null;
124   }
125 }