KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > radio > HtmlRadioTag


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.radio;
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 Thomas Spiegl (latest modification by $Author: matzew $)
25  * @version $Revision: 1.8 $ $Date: 2005/02/18 17:19:31 $
26  * $Log: HtmlRadioTag.java,v $
27  * Revision 1.8 2005/02/18 17:19:31 matzew
28  * added release() to tag clazzes.
29  *
30  * Revision 1.7 2004/10/13 11:50:57 matze
31  * renamed packages to org.apache
32  *
33  * Revision 1.6 2004/07/01 21:53:08 mwessendorf
34  * ASF switch
35  *
36  * Revision 1.5 2004/05/18 14:31:38 manolito
37  * user role support completely moved to components source tree
38  *
39  * Revision 1.4 2004/04/05 11:04:54 manolito
40  * setter for renderer type removed, no more default renderer type needed
41  *
42  * Revision 1.3 2004/04/02 13:57:10 manolito
43  * extended HtmlSelectManyCheckbox with layout "spread" and custom Checkbox component
44  *
45  */

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

51     public String JavaDoc getComponentType()
52     {
53         return HtmlRadio.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     // HtmlRadio 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
80         _for=null;
81         _index=null;
82         _enabledOnUserRole=null;
83         _visibleOnUserRole=null;
84
85     }
86
87     protected void setProperties(UIComponent component)
88     {
89         super.setProperties(component);
90
91         setStringProperty(component, HtmlRadio.FOR_ATTR, _for);
92         setIntegerProperty(component, HtmlRadio.INDEX_ATTR, _index);
93
94         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
95         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
96     }
97
98     public String JavaDoc getFor()
99     {
100         return _for;
101     }
102
103     public void setFor(String JavaDoc aFor)
104     {
105         _for = aFor;
106     }
107
108     public String JavaDoc getIndex()
109     {
110         return _index;
111     }
112
113     public void setIndex(String JavaDoc index)
114     {
115         _index = index;
116     }
117
118     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
119     {
120         _enabledOnUserRole = enabledOnUserRole;
121     }
122
123     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
124     {
125         _visibleOnUserRole = visibleOnUserRole;
126     }
127 }
128
Popular Tags