KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > taglib > html > ext > HtmlDataTableTag


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.taglib.html.ext;
17
18 import org.apache.myfaces.component.UserRoleAware;
19 import org.apache.myfaces.component.html.ext.HtmlDataTable;
20 import org.apache.myfaces.taglib.html.HtmlDataTableTagBase;
21
22 import javax.faces.component.UIComponent;
23
24 /**
25  * @author Manfred Geiler (latest modification by $Author: svieujot $)
26  * @version $Revision: 1.12 $ $Date: 2005/03/19 04:27:55 $
27  * $Log: HtmlDataTableTag.java,v $
28  * Revision 1.12 2005/03/19 04:27:55 svieujot
29  * Align default values for preserveDataModel and preserveSort between HtmlDataTable.java, HtmlDataTableTag.java and the TLD.
30  *
31  * Revision 1.11 2005/02/18 17:19:29 matzew
32  * added release() to tag clazzes.
33  *
34  * Revision 1.10 2004/10/13 11:50:59 matze
35  * renamed packages to org.apache
36  *
37  * Revision 1.9 2004/09/10 14:15:00 manolito
38  * new previousRowDataVar attribute in extended HtmlDataTable
39  *
40  * Revision 1.8 2004/08/20 07:14:41 manolito
41  * HtmlDataTable now also supports rowIndexVar and rowCountVar
42  *
43  * Revision 1.7 2004/07/01 21:53:06 mwessendorf
44  * ASF switch
45  *
46  * Revision 1.6 2004/05/21 10:39:27 manolito
47  * new renderedIfEmpty attribute in ext. HtmlDataTable component
48  *
49  * Revision 1.5 2004/05/18 15:07:11 manolito
50  * no message
51  *
52  * Revision 1.4 2004/05/18 14:31:38 manolito
53  * user role support completely moved to components source tree
54  *
55  * Revision 1.3 2004/04/05 11:04:55 manolito
56  * setter for renderer type removed, no more default renderer type needed
57  *
58  * Revision 1.2 2004/04/01 12:57:42 manolito
59  * additional extended component classes for user role support
60  *
61  * Revision 1.1 2004/03/31 12:15:28 manolito
62  * custom component refactoring
63  *
64  */

65 public class HtmlDataTableTag
66         extends HtmlDataTableTagBase
67 {
68     //private static final Log log = LogFactory.getLog(HtmlDataTableTag.class);
69

70     public String JavaDoc getComponentType()
71     {
72         return HtmlDataTable.COMPONENT_TYPE;
73     }
74
75     public String JavaDoc getRendererType()
76     {
77         return "org.apache.myfaces.Table";
78     }
79
80     private String JavaDoc _preserveDataModel;
81     private String JavaDoc _sortColumn;
82     private String JavaDoc _sortAscending;
83     private String JavaDoc _preserveSort;
84     private String JavaDoc _enabledOnUserRole;
85     private String JavaDoc _visibleOnUserRole;
86     private String JavaDoc _renderedIfEmpty;
87     private String JavaDoc _rowIndexVar;
88     private String JavaDoc _rowCountVar;
89     private String JavaDoc _previousRowDataVar;
90     
91     public void release() {
92         super.release();
93
94         _preserveDataModel=null;
95         _sortColumn=null;
96         _sortAscending=null;
97         _preserveSort=null;
98         _enabledOnUserRole=null;
99         _visibleOnUserRole=null;
100         _renderedIfEmpty=null;
101         _rowIndexVar=null;
102         _rowCountVar=null;
103         _previousRowDataVar=null;
104
105     }
106
107     protected void setProperties(UIComponent component)
108     {
109         super.setProperties(component);
110
111         setBooleanProperty(component, "preserveDataModel", _preserveDataModel);
112         setValueBinding(component, "sortColumn", _sortColumn);
113         setValueBinding(component, "sortAscending", _sortAscending);
114         setBooleanProperty(component, "preserveSort", _preserveSort);
115         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
116         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
117         setBooleanProperty(component, "renderedIfEmpty", _renderedIfEmpty);
118         setStringProperty(component, "rowIndexVar", _rowIndexVar);
119         setStringProperty(component, "rowCountVar", _rowCountVar);
120         setStringProperty(component, "previousRowDataVar", _previousRowDataVar);
121     }
122
123     public void setPreserveDataModel(String JavaDoc preserveDataModel)
124     {
125         _preserveDataModel = preserveDataModel;
126     }
127
128     public void setSortColumn(String JavaDoc sortColumn)
129     {
130         _sortColumn = sortColumn;
131     }
132
133     public void setSortAscending(String JavaDoc sortAscending)
134     {
135         _sortAscending = sortAscending;
136     }
137
138     public void setPreserveSort(String JavaDoc preserveSort)
139     {
140         _preserveSort = preserveSort;
141     }
142
143     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
144     {
145         _enabledOnUserRole = enabledOnUserRole;
146     }
147
148     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
149     {
150         _visibleOnUserRole = visibleOnUserRole;
151     }
152
153     public void setRenderedIfEmpty(String JavaDoc renderedIfEmpty)
154     {
155         _renderedIfEmpty = renderedIfEmpty;
156     }
157
158     public void setRowIndexVar(String JavaDoc rowIndexVar)
159     {
160         _rowIndexVar = rowIndexVar;
161     }
162
163     public void setRowCountVar(String JavaDoc rowCountVar)
164     {
165         _rowCountVar = rowCountVar;
166     }
167
168     public void setPreviousRowDataVar(String JavaDoc previousRowDataVar)
169     {
170         _previousRowDataVar = previousRowDataVar;
171     }
172 }
173
Popular Tags