KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > myfaces > custom > fileupload > HtmlInputFileUploadTag


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.fileupload;
17
18 import org.apache.myfaces.component.UserRoleAware;
19 import org.apache.myfaces.renderkit.html.HTML;
20 import org.apache.myfaces.taglib.html.HtmlInputTagBase;
21
22 import javax.faces.component.UIComponent;
23
24 /**
25  * @author Manfred Geiler (latest modification by $Author: matzew $)
26  * @version $Revision: 1.10 $ $Date: 2005/02/18 17:19:31 $
27  */

28 public class HtmlInputFileUploadTag
29         extends HtmlInputTagBase
30 {
31     //private static final Log log = LogFactory.getLog(HtmlInputFileUploadTag.class);
32

33     public String JavaDoc getComponentType()
34     {
35         return HtmlInputFileUpload.COMPONENT_TYPE;
36     }
37
38     public String JavaDoc getRendererType()
39     {
40         return "org.apache.myfaces.FileUpload";
41     }
42
43     // UIComponent attributes --> already implemented in UIComponentTagBase
44

45     // user role attributes --> already implemented in UIComponentTagBase
46

47     // HTML universal attributes --> already implemented in HtmlComponentTagBase
48

49     // HTML event handler attributes --> already implemented in HtmlComponentTagBase
50

51     // HTML input attributes
52
private String JavaDoc _accesskey;
53     private String JavaDoc _align;
54     private String JavaDoc _alt; //FIXME: HTML 4.0 transitional attribute and not in strict... what to do?
55
private String JavaDoc _datafld;
56     private String JavaDoc _datasrc;
57     private String JavaDoc _dataformatas;
58     private String JavaDoc _disabled;
59     private String JavaDoc _maxlength;
60     private String JavaDoc _onblur;
61     private String JavaDoc _onchange;
62     private String JavaDoc _onfocus;
63     private String JavaDoc _onselect;
64     private String JavaDoc _readonly;
65     private String JavaDoc _size;
66     private String JavaDoc _tabindex;
67
68     // UIOutput attributes
69
// value and converterId --> already implemented in UIComponentTagBase
70

71     // UIInput attributes
72
// --> already implemented in HtmlInputTagBase
73

74     // HtmlInputFileUpload attributes
75
private String JavaDoc _accept;
76     private String JavaDoc _storage;
77
78     // User Role support
79
private String JavaDoc _enabledOnUserRole;
80     private String JavaDoc _visibleOnUserRole;
81
82     
83     public void release() {
84         super.release();
85         _accesskey=null;
86         _align=null;
87         _alt=null;
88         _datafld=null;
89         _datasrc=null;
90         _dataformatas=null;
91         _disabled=null;
92         _maxlength=null;
93         _onblur=null;
94         _onchange=null;
95         _onfocus=null;
96         _onselect=null;
97         _readonly=null;
98         _size=null;
99         _tabindex=null;
100         _accept=null;
101         _storage=null;
102         _enabledOnUserRole=null;
103         _visibleOnUserRole=null;
104     }
105
106     protected void setProperties(UIComponent component)
107     {
108         super.setProperties(component);
109         
110         setStringProperty(component, HTML.ACCESSKEY_ATTR, _accesskey);
111         setStringProperty(component, HTML.ALIGN_ATTR, _align);
112         setStringProperty(component, HTML.ALT_ATTR, _alt);
113         setStringProperty(component, HTML.DATAFLD_ATTR, _datafld);
114         setStringProperty(component, HTML.DATASRC_ATTR, _datasrc);
115         setStringProperty(component, HTML.DATAFORMATAS_ATTR, _dataformatas);
116         setBooleanProperty(component, HTML.DISABLED_ATTR, _disabled);
117         setIntegerProperty(component, HTML.MAXLENGTH_ATTR, _maxlength);
118         setStringProperty(component, HTML.ONBLUR_ATTR, _onblur);
119         setStringProperty(component, HTML.ONCHANGE_ATTR, _onchange);
120         setStringProperty(component, HTML.ONFOCUS_ATTR, _onfocus);
121         setStringProperty(component, HTML.ONSELECT_ATTR, _onselect);
122         setBooleanProperty(component, HTML.READONLY_ATTR, _readonly);
123         setIntegerProperty(component, HTML.SIZE_ATTR, _size);
124         setStringProperty(component, HTML.TABINDEX_ATTR, _tabindex);
125
126         setStringProperty(component, HTML.ACCEPT_ATTR, _accept);
127         setStringProperty(component, "storage", _storage);
128
129         setStringProperty(component, UserRoleAware.ENABLED_ON_USER_ROLE_ATTR, _enabledOnUserRole);
130         setStringProperty(component, UserRoleAware.VISIBLE_ON_USER_ROLE_ATTR, _visibleOnUserRole);
131     }
132     
133     public void setStorage(String JavaDoc storage)
134     {
135         _storage = storage;
136     }
137
138     public void setAccesskey(String JavaDoc accesskey)
139     {
140         _accesskey = accesskey;
141     }
142
143     public void setAlign(String JavaDoc align)
144     {
145         _align = align;
146     }
147
148     public void setAlt(String JavaDoc alt)
149     {
150         _alt = alt;
151     }
152
153     public void setDatafld(String JavaDoc datafld)
154     {
155         _datafld = datafld;
156     }
157
158     public void setDatasrc(String JavaDoc datasrc)
159     {
160         _datasrc = datasrc;
161     }
162
163     public void setDataformatas(String JavaDoc dataformatas)
164     {
165         _dataformatas = dataformatas;
166     }
167
168     public void setDisabled(String JavaDoc disabled)
169     {
170         _disabled = disabled;
171     }
172
173     public void setMaxlength(String JavaDoc maxlength)
174     {
175         _maxlength = maxlength;
176     }
177
178     public void setOnblur(String JavaDoc onblur)
179     {
180         _onblur = onblur;
181     }
182
183     public void setOnchange(String JavaDoc onchange)
184     {
185         _onchange = onchange;
186     }
187
188     public void setOnfocus(String JavaDoc onfocus)
189     {
190         _onfocus = onfocus;
191     }
192
193     public void setOnselect(String JavaDoc onselect)
194     {
195         _onselect = onselect;
196     }
197
198     public void setReadonly(String JavaDoc readonly)
199     {
200         _readonly = readonly;
201     }
202
203     public void setSize(String JavaDoc size)
204     {
205         _size = size;
206     }
207
208     public void setTabindex(String JavaDoc tabindex)
209     {
210         _tabindex = tabindex;
211     }
212
213     public void setAccept(String JavaDoc accept)
214     {
215         _accept = accept;
216     }
217
218     public void setEnabledOnUserRole(String JavaDoc enabledOnUserRole)
219     {
220         _enabledOnUserRole = enabledOnUserRole;
221     }
222
223     public void setVisibleOnUserRole(String JavaDoc visibleOnUserRole)
224     {
225         _visibleOnUserRole = visibleOnUserRole;
226     }
227 }
228
Popular Tags