KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > taglib > html > HtmlCommandButtonTagBase


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;
17
18 import org.apache.myfaces.renderkit.JSFAttr;
19 import org.apache.myfaces.renderkit.html.HTML;
20
21 import javax.faces.component.UIComponent;
22
23
24 /**
25  * @author Manfred Geiler (latest modification by $Author: matzew $)
26  * @author Martin Marinschek
27  * @version $Revision: 1.4 $ $Date: 2005/02/18 18:24:35 $
28  * $Log: HtmlCommandButtonTagBase.java,v $
29  * Revision 1.4 2005/02/18 18:24:35 matzew
30  * added release() to tag clazzes.
31  *
32  * Revision 1.3 2004/10/13 11:51:01 matze
33  * renamed packages to org.apache
34  *
35  * Revision 1.2 2004/07/01 22:01:11 mwessendorf
36  * ASF switch
37  *
38  * Revision 1.1 2004/04/01 12:57:44 manolito
39  * additional extended component classes for user role support
40  *
41  */

42 public abstract class HtmlCommandButtonTagBase
43     extends HtmlComponentTagBase
44 {
45     //private static final Log log = LogFactory.getLog(HtmlCommandButtonTag.class);
46

47     // UIComponent attributes --> already implemented in UIComponentTagBase
48

49     // user role attributes --> already implemented in UIComponentTagBase
50

51     // HTML universal attributes --> already implemented in HtmlComponentTagBase
52

53     // HTML event handler attributes --> already implemented in HtmlComponentTagBase
54

55     // HTML input attributes relevant for command-button
56
private String JavaDoc _accesskey;
57     private String JavaDoc _alt;
58     private String JavaDoc _disabled;
59     private String JavaDoc _onblur;
60     private String JavaDoc _onchange;
61     private String JavaDoc _onfocus;
62     private String JavaDoc _onselect;
63     private String JavaDoc _size;
64     private String JavaDoc _tabindex;
65     private String JavaDoc _type;
66
67     // UICommand attributes
68
private String JavaDoc _action;
69     private String JavaDoc _immediate;
70     private String JavaDoc _actionListener;
71
72     // HtmlCommandButton attributes
73
private String JavaDoc _image;
74     
75     public void release() {
76         super.release();
77         _accesskey=null;
78         _alt=null;
79         _disabled=null;
80         _onblur=null;
81         _onchange=null;
82         _onfocus=null;
83         _onselect=null;
84         _size=null;
85         _tabindex=null;
86         _type=null;
87         _action=null;
88         _immediate=null;
89         _actionListener=null;
90         _image=null;
91     }
92
93     protected void setProperties(UIComponent component)
94     {
95         super.setProperties(component);
96
97         setStringProperty(component, HTML.ACCESSKEY_ATTR, _accesskey);
98         setStringProperty(component, HTML.ALT_ATTR, _alt);
99         setBooleanProperty(component, HTML.DISABLED_ATTR, _disabled);
100         setStringProperty(component, HTML.ONBLUR_ATTR, _onblur);
101         setStringProperty(component, HTML.ONCHANGE_ATTR, _onchange);
102         setStringProperty(component, HTML.ONFOCUS_ATTR, _onfocus);
103         setStringProperty(component, HTML.ONSELECT_ATTR, _onselect);
104         setStringProperty(component, HTML.SIZE_ATTR, _size);
105         setStringProperty(component, HTML.TABINDEX_ATTR, _tabindex);
106         setStringProperty(component, HTML.TYPE_ATTR, _type);
107         setActionProperty(component, _action);
108         setActionListenerProperty(component, _actionListener);
109         setBooleanProperty(component, JSFAttr.IMMEDIATE_ATTR, _immediate);
110         setStringProperty(component, JSFAttr.IMAGE_ATTR, _image);
111    }
112
113     public void setAccesskey(String JavaDoc accesskey)
114     {
115         _accesskey = accesskey;
116     }
117
118     public void setAlt(String JavaDoc alt)
119     {
120         _alt = alt;
121     }
122
123     public void setDisabled(String JavaDoc disabled)
124     {
125         _disabled = disabled;
126     }
127
128     public void setOnblur(String JavaDoc onblur)
129     {
130         _onblur = onblur;
131     }
132
133     public void setOnchange(String JavaDoc onchange)
134     {
135         _onchange = onchange;
136     }
137
138     public void setOnfocus(String JavaDoc onfocus)
139     {
140         _onfocus = onfocus;
141     }
142
143     public void setOnselect(String JavaDoc onselect)
144     {
145         _onselect = onselect;
146     }
147
148     public void setSize(String JavaDoc size)
149     {
150         _size = size;
151     }
152
153     public void setTabindex(String JavaDoc tabindex)
154     {
155         _tabindex = tabindex;
156     }
157
158     public void setType(String JavaDoc type)
159     {
160         _type = type;
161     }
162
163     public void setAction(String JavaDoc action)
164     {
165         _action = action;
166     }
167
168     public void setImmediate(String JavaDoc immediate)
169     {
170         _immediate = immediate;
171     }
172
173     public void setImage(String JavaDoc image)
174     {
175         _image = image;
176     }
177
178     public void setActionListener(String JavaDoc actionListener)
179     {
180         _actionListener = actionListener;
181     }
182 }
183
Popular Tags