KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > datalist > HtmlDataListTag


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.myfaces.custom.datalist;
17
18 import org.apache.myfaces.component.UserRoleAware;
19 import org.apache.myfaces.renderkit.JSFAttr;
20 import org.apache.myfaces.taglib.html.HtmlComponentBodyTagBase;
21
22 import javax.faces.component.UIComponent;
23
24 /**
25  * @author Manfred Geiler (latest modification by $Author: matzew $)
26  * @version $Revision: 1.7 $ $Date: 2005/02/18 17:19:30 $
27  * $Log: HtmlDataListTag.java,v $
28  * Revision 1.7 2005/02/18 17:19:30 matzew
29  * added release() to tag clazzes.
30  *
31  * Revision 1.6 2004/10/13 11:50:57 matze
32  * renamed packages to org.apache
33  *
34  * Revision 1.5 2004/07/01 21:53:09 mwessendorf
35  * ASF switch
36  *
37  * Revision 1.4 2004/05/18 14:31:37 manolito
38  * user role support completely moved to components source tree
39  *
40  * Revision 1.3 2004/04/05 11:04:52 manolito
41  * setter for renderer type removed, no more default renderer type needed
42  *
43  * Revision 1.2 2004/04/01 12:57:39 manolito
44  * additional extended component classes for user role support
45  *
46  * Revision 1.1 2004/03/31 12:15:26 manolito
47  * custom component refactoring
48  *
49  */

50 public class HtmlDataListTag
51         extends HtmlComponentBodyTagBase
52 {
53     //private static final Log log = LogFactory.getLog(HtmlDataListTag.class);
54

55     public String JavaDoc getComponentType()
56     {
57         return HtmlDataList.COMPONENT_TYPE;
58     }
59
60     public String JavaDoc getRendererType()
61     {
62         return "org.apache.myfaces.List";
63     }
64
65     // UIComponent attributes --> already implemented in UIComponentTagBase
66

67     // user role attributes --> already implemented in UIComponentTagBase
68

69     // HTML universal attributes --> already implemented in HtmlComponentTagBase
70

71     // HTML event handler attributes --> already implemented in HtmlComponentTagBase
72

73     // UIData attributes
74
private String JavaDoc _rows;
75     private String JavaDoc _var;
76     private String JavaDoc _first;
77
78     // HtmlDataList attributes
79
private String JavaDoc _layout;
80     private String JavaDoc _rowIndexVar;
81     private String JavaDoc _rowCountVar;
82
83     // User Role support
84
private String JavaDoc _enabledOnUserRole;
85     private String JavaDoc _visibleOnUserRole;
86
87     public void release() {
88         super.release();
89         _rows=null;
90         _var=null;
91         _first=null;
92         _layout=null;
93         _rowIndexVar=null;
94         _rowCountVar=null;
95         _enabledOnUserRole=null;
96         _visibleOnUserRole=null;
97     }
98     
99     protected void setProperties(UIComponent component)
100     {
101         super.setProperties(component);
102
103         setIntegerProperty(component, JSFAttr.ROWS_ATTR, _rows);
104         setStringProperty(component, JSFAttr.VAR_ATTR, _var);
105         setIntegerProperty(component, JSFAttr.FIRST_ATTR, _first);
106
107         setStringProperty(component, JSFAttr.LAYOUT_ATTR, _layout);
108         setStringProperty(component, "rowIndexVar", _rowIndexVar);
109         setStringProperty(component, "rowCountVar", _rowCountVar);
110
111         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
112         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
113     }
114
115     public void setRows(String JavaDoc rows)
116     {
117         _rows = rows;
118     }
119
120     public void setVar(String JavaDoc var)
121     {
122         _var = var;
123     }
124
125     public void setFirst(String JavaDoc first)
126     {
127         _first = first;
128     }
129
130     public void setLayout(String JavaDoc layout)
131     {
132         _layout = layout;
133     }
134
135     public void setRowIndexVar(String JavaDoc rowIndexVar)
136     {
137         _rowIndexVar = rowIndexVar;
138     }
139
140     public void setRowCountVar(String JavaDoc rowCountVar)
141     {
142         _rowCountVar = rowCountVar;
143     }
144
145     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
146     {
147         _enabledOnUserRole = enabledOnUserRole;
148     }
149
150     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
151     {
152         _visibleOnUserRole = visibleOnUserRole;
153     }
154 }
155
Popular Tags