KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > checkbox > HtmlCheckboxTag


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.checkbox;
17
18 import org.apache.myfaces.component.UserRoleAware;
19 import org.apache.myfaces.taglib.UIComponentTagBase;
20
21 import javax.faces.component.UIComponent;
22
23 /**
24  * @author Manfred Geiler (latest modification by $Author: matzew $)
25  * @version $Revision: 1.6 $ $Date: 2005/02/18 17:19:31 $
26  * $Log: HtmlCheckboxTag.java,v $
27  * Revision 1.6 2005/02/18 17:19:31 matzew
28  * added release() to tag clazzes.
29  *
30  * Revision 1.5 2004/10/13 11:50:57 matze
31  * renamed packages to org.apache
32  *
33  * Revision 1.4 2004/07/01 21:53:06 mwessendorf
34  * ASF switch
35  *
36  * Revision 1.3 2004/05/18 14:31:37 manolito
37  * user role support completely moved to components source tree
38  *
39  * Revision 1.2 2004/04/05 11:04:52 manolito
40  * setter for renderer type removed, no more default renderer type needed
41  *
42  * Revision 1.1 2004/04/02 13:57:10 manolito
43  * extended HtmlSelectManyCheckbox with layout "spread" and custom Checkbox component
44  *
45  */

46 public class HtmlCheckboxTag
47         extends UIComponentTagBase
48 {
49     //private static final Log log = LogFactory.getLog(HtmlInputFileUploadTag.class);
50

51     public String JavaDoc getComponentType()
52     {
53         return HtmlCheckbox.COMPONENT_TYPE;
54     }
55
56     public String JavaDoc getRendererType()
57     {
58         return null;
59     }
60
61     // UIComponent attributes --> already implemented in UIComponentTagBase
62

63     // user role attributes --> already implemented in UIComponentTagBase
64

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

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

69     // HtmlCheckbox attributes
70
private String JavaDoc _for;
71     private String JavaDoc _index;
72
73     // User Role support
74
private String JavaDoc _enabledOnUserRole;
75     private String JavaDoc _visibleOnUserRole;
76
77     public void release() {
78         super.release();
79         _for=null;
80         _index=null;
81         _enabledOnUserRole=null;
82         _visibleOnUserRole=null;
83     }
84
85     protected void setProperties(UIComponent component)
86     {
87         super.setProperties(component);
88
89         setStringProperty(component, HtmlCheckbox.FOR_ATTR, _for);
90         setIntegerProperty(component, HtmlCheckbox.INDEX_ATTR, _index);
91
92         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
93         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
94     }
95
96     public String JavaDoc getFor()
97     {
98         return _for;
99     }
100
101     public void setFor(String JavaDoc aFor)
102     {
103         _for = aFor;
104     }
105
106     public String JavaDoc getIndex()
107     {
108         return _index;
109     }
110
111     public void setIndex(String JavaDoc index)
112     {
113         _index = index;
114     }
115
116     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
117     {
118         _enabledOnUserRole = enabledOnUserRole;
119     }
120
121     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
122     {
123         _visibleOnUserRole = visibleOnUserRole;
124     }
125 }
126
Popular Tags