KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > layout > HtmlPanelLayoutTag


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.layout;
17
18 import org.apache.myfaces.component.UserRoleAware;
19 import org.apache.myfaces.renderkit.html.HTML;
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: HtmlPanelLayoutTag.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:53 manolito
41  * setter for renderer type removed, no more default renderer type needed
42  *
43  * Revision 1.2 2004/04/01 12:57:40 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 HtmlPanelLayoutTag
51         extends HtmlComponentBodyTagBase
52 {
53     public String JavaDoc getComponentType()
54     {
55         return HtmlPanelLayout.COMPONENT_TYPE;
56     }
57
58     public String JavaDoc getRendererType()
59     {
60         return "org.apache.myfaces.Layout";
61     }
62
63     // UIComponent attributes --> already implemented in UIComponentBodyTagBase
64

65     // HTML universal attributes --> already implemented in MyFacesTag
66

67     // HTML event handler attributes --> already implemented in MyFacesTag
68

69     // UIPanel attributes --> value attribute already implemented in UIComponentBodyTagBase
70

71     // HtmlPanelLayout attributes
72
private String JavaDoc _layout;
73     private String JavaDoc _headerClass;
74     private String JavaDoc _navigationClass;
75     private String JavaDoc _bodyClass;
76     private String JavaDoc _footerClass;
77     private String JavaDoc _headerStyle;
78     private String JavaDoc _navigationStyle;
79     private String JavaDoc _bodyStyle;
80     private String JavaDoc _footerStyle;
81
82     // HTML table attributes
83
private String JavaDoc _align;
84     private String JavaDoc _bgcolor;
85     private String JavaDoc _border;
86     private String JavaDoc _cellpadding;
87     private String JavaDoc _cellspacing;
88     private String JavaDoc _datafld;
89     private String JavaDoc _datasrc;
90     private String JavaDoc _dataformatas;
91     private String JavaDoc _frame;
92     private String JavaDoc _rules;
93     private String JavaDoc _summary;
94     private String JavaDoc _width;
95
96     // User Role support
97
private String JavaDoc _enabledOnUserRole;
98     private String JavaDoc _visibleOnUserRole;
99
100     
101     public void release() {
102         super.release();
103         _layout=null;
104         _headerClass=null;
105         _navigationClass=null;
106         _bodyClass=null;
107         _footerClass=null;
108         _headerStyle=null;
109         _navigationStyle=null;
110         _bodyStyle=null;
111         _footerStyle=null;
112         _align=null;
113         _bgcolor=null;
114         _border=null;
115         _cellpadding=null;
116         _cellspacing=null;
117         _datafld=null;
118         _datasrc=null;
119         _dataformatas=null;
120         _frame=null;
121         _rules=null;
122         _summary=null;
123         _width=null;
124         _enabledOnUserRole=null;
125         _visibleOnUserRole=null;
126    }
127     protected void setProperties(UIComponent component)
128     {
129         super.setProperties(component);
130
131         setStringProperty(component, "layout", _layout);
132         setStringProperty(component, "headerClass", _headerClass);
133         setStringProperty(component, "navigationClass", _navigationClass);
134         setStringProperty(component, "bodyClass", _bodyClass);
135         setStringProperty(component, "footerClass", _footerClass);
136         setStringProperty(component, "headerStyle", _headerStyle);
137         setStringProperty(component, "navigationStyle", _navigationStyle);
138         setStringProperty(component, "bodyStyle", _bodyStyle);
139         setStringProperty(component, "footerStyle", _footerStyle);
140
141         setStringProperty(component, HTML.ALIGN_ATTR, _align);
142         setStringProperty(component, HTML.BGCOLOR_ATTR, _bgcolor);
143         setStringProperty(component, HTML.BORDER_ATTR, _border);
144         setStringProperty(component, HTML.CELLPADDING_ATTR, _cellpadding);
145         setStringProperty(component, HTML.CELLSPACING_ATTR, _cellspacing);
146         setStringProperty(component, HTML.DATAFLD_ATTR, _datafld);
147         setStringProperty(component, HTML.DATASRC_ATTR, _datasrc);
148         setStringProperty(component, HTML.DATAFORMATAS_ATTR, _dataformatas);
149         setStringProperty(component, HTML.FRAME_ATTR, _frame);
150         setStringProperty(component, HTML.RULES_ATTR, _rules);
151         setStringProperty(component, HTML.SUMMARY_ATTR, _summary);
152         setStringProperty(component, HTML.WIDTH_ATTR, _width);
153
154         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
155         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
156     }
157
158     public void setLayout(String JavaDoc layout)
159     {
160         _layout = layout;
161     }
162
163     public void setHeaderClass(String JavaDoc headerClass)
164     {
165         _headerClass = headerClass;
166     }
167
168     public void setNavigationClass(String JavaDoc navigationClass)
169     {
170         _navigationClass = navigationClass;
171     }
172
173     public void setBodyClass(String JavaDoc bodyClass)
174     {
175         _bodyClass = bodyClass;
176     }
177
178     public void setFooterClass(String JavaDoc footerClass)
179     {
180         _footerClass = footerClass;
181     }
182
183     public void setHeaderStyle(String JavaDoc headerStyle)
184     {
185         _headerStyle = headerStyle;
186     }
187
188     public void setNavigationStyle(String JavaDoc navigationStyle)
189     {
190         _navigationStyle = navigationStyle;
191     }
192
193     public void setBodyStyle(String JavaDoc bodyStyle)
194     {
195         _bodyStyle = bodyStyle;
196     }
197
198     public void setFooterStyle(String JavaDoc footerStyle)
199     {
200         _footerStyle = footerStyle;
201     }
202
203     public void setAlign(String JavaDoc align)
204     {
205         _align = align;
206     }
207
208     public void setBgcolor(String JavaDoc bgcolor)
209     {
210         _bgcolor = bgcolor;
211     }
212
213     public void setBorder(String JavaDoc border)
214     {
215         _border = border;
216     }
217
218     public void setCellpadding(String JavaDoc cellpadding)
219     {
220         _cellpadding = cellpadding;
221     }
222
223     public void setCellspacing(String JavaDoc cellspacing)
224     {
225         _cellspacing = cellspacing;
226     }
227
228     public void setDatafld(String JavaDoc datafld)
229     {
230         _datafld = datafld;
231     }
232
233     public void setDatasrc(String JavaDoc datasrc)
234     {
235         _datasrc = datasrc;
236     }
237
238     public void setDataformatas(String JavaDoc dataformatas)
239     {
240         _dataformatas = dataformatas;
241     }
242
243     public void setFrame(String JavaDoc frame)
244     {
245         _frame = frame;
246     }
247
248     public void setRules(String JavaDoc rules)
249     {
250         _rules = rules;
251     }
252
253     public void setSummary(String JavaDoc summary)
254     {
255         _summary = summary;
256     }
257
258     public void setWidth(String JavaDoc width)
259     {
260         _width = width;
261     }
262
263     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
264     {
265         _enabledOnUserRole = enabledOnUserRole;
266     }
267
268     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
269     {
270         _visibleOnUserRole = visibleOnUserRole;
271     }
272 }
273
Popular Tags