KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > faces > component > html > HtmlInputText


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 javax.faces.component.html;
17
18 import javax.faces.component.UIInput;
19 import javax.faces.context.FacesContext;
20 import javax.faces.el.ValueBinding;
21
22 /**
23  * @author Thomas Spiegl (latest modification by $Author: mwessendorf $)
24  * @version $Revision: 1.3 $ $Date: 2004/07/01 22:01:16 $
25  */

26 public class HtmlInputText extends UIInput
27 {
28     //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
29

30     public static final String JavaDoc COMPONENT_TYPE = "javax.faces.HtmlInputText";
31     private static final String JavaDoc DEFAULT_RENDERER_TYPE = "javax.faces.Text";
32     private static final boolean DEFAULT_DISABLED = false;
33     private static final int DEFAULT_MAXLENGTH = Integer.MIN_VALUE;
34     private static final boolean DEFAULT_READONLY = false;
35     private static final int DEFAULT_SIZE = Integer.MIN_VALUE;
36
37     private String JavaDoc _accesskey = null;
38     private String JavaDoc _alt = null;
39     private String JavaDoc _dir = null;
40     private Boolean JavaDoc _disabled = null;
41     private String JavaDoc _lang = null;
42     private Integer JavaDoc _maxlength = null;
43     private String JavaDoc _onblur = null;
44     private String JavaDoc _onchange = null;
45     private String JavaDoc _onclick = null;
46     private String JavaDoc _ondblclick = null;
47     private String JavaDoc _onfocus = null;
48     private String JavaDoc _onkeydown = null;
49     private String JavaDoc _onkeypress = null;
50     private String JavaDoc _onkeyup = null;
51     private String JavaDoc _onmousedown = null;
52     private String JavaDoc _onmousemove = null;
53     private String JavaDoc _onmouseout = null;
54     private String JavaDoc _onmouseover = null;
55     private String JavaDoc _onmouseup = null;
56     private String JavaDoc _onselect = null;
57     private Boolean JavaDoc _readonly = null;
58     private Integer JavaDoc _size = null;
59     private String JavaDoc _style = null;
60     private String JavaDoc _styleClass = null;
61     private String JavaDoc _tabindex = null;
62     private String JavaDoc _title = null;
63
64     public HtmlInputText()
65     {
66         setRendererType(DEFAULT_RENDERER_TYPE);
67     }
68
69
70     public void setAccesskey(String JavaDoc accesskey)
71     {
72         _accesskey = accesskey;
73     }
74
75     public String JavaDoc getAccesskey()
76     {
77         if (_accesskey != null) return _accesskey;
78         ValueBinding vb = getValueBinding("accesskey");
79         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
80     }
81
82     public void setAlt(String JavaDoc alt)
83     {
84         _alt = alt;
85     }
86
87     public String JavaDoc getAlt()
88     {
89         if (_alt != null) return _alt;
90         ValueBinding vb = getValueBinding("alt");
91         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
92     }
93
94     public void setDir(String JavaDoc dir)
95     {
96         _dir = dir;
97     }
98
99     public String JavaDoc getDir()
100     {
101         if (_dir != null) return _dir;
102         ValueBinding vb = getValueBinding("dir");
103         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
104     }
105
106     public void setDisabled(boolean disabled)
107     {
108         _disabled = Boolean.valueOf(disabled);
109     }
110
111     public boolean isDisabled()
112     {
113         if (_disabled != null) return _disabled.booleanValue();
114         ValueBinding vb = getValueBinding("disabled");
115         Boolean JavaDoc v = vb != null ? (Boolean JavaDoc)vb.getValue(getFacesContext()) : null;
116         return v != null ? v.booleanValue() : DEFAULT_DISABLED;
117     }
118
119     public void setLang(String JavaDoc lang)
120     {
121         _lang = lang;
122     }
123
124     public String JavaDoc getLang()
125     {
126         if (_lang != null) return _lang;
127         ValueBinding vb = getValueBinding("lang");
128         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
129     }
130
131     public void setMaxlength(int maxlength)
132     {
133         _maxlength = new Integer JavaDoc(maxlength);
134     }
135
136     public int getMaxlength()
137     {
138         if (_maxlength != null) return _maxlength.intValue();
139         ValueBinding vb = getValueBinding("maxlength");
140         Integer JavaDoc v = vb != null ? (Integer JavaDoc)vb.getValue(getFacesContext()) : null;
141         return v != null ? v.intValue() : DEFAULT_MAXLENGTH;
142     }
143
144     public void setOnblur(String JavaDoc onblur)
145     {
146         _onblur = onblur;
147     }
148
149     public String JavaDoc getOnblur()
150     {
151         if (_onblur != null) return _onblur;
152         ValueBinding vb = getValueBinding("onblur");
153         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
154     }
155
156     public void setOnchange(String JavaDoc onchange)
157     {
158         _onchange = onchange;
159     }
160
161     public String JavaDoc getOnchange()
162     {
163         if (_onchange != null) return _onchange;
164         ValueBinding vb = getValueBinding("onchange");
165         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
166     }
167
168     public void setOnclick(String JavaDoc onclick)
169     {
170         _onclick = onclick;
171     }
172
173     public String JavaDoc getOnclick()
174     {
175         if (_onclick != null) return _onclick;
176         ValueBinding vb = getValueBinding("onclick");
177         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
178     }
179
180     public void setOndblclick(String JavaDoc ondblclick)
181     {
182         _ondblclick = ondblclick;
183     }
184
185     public String JavaDoc getOndblclick()
186     {
187         if (_ondblclick != null) return _ondblclick;
188         ValueBinding vb = getValueBinding("ondblclick");
189         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
190     }
191
192     public void setOnfocus(String JavaDoc onfocus)
193     {
194         _onfocus = onfocus;
195     }
196
197     public String JavaDoc getOnfocus()
198     {
199         if (_onfocus != null) return _onfocus;
200         ValueBinding vb = getValueBinding("onfocus");
201         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
202     }
203
204     public void setOnkeydown(String JavaDoc onkeydown)
205     {
206         _onkeydown = onkeydown;
207     }
208
209     public String JavaDoc getOnkeydown()
210     {
211         if (_onkeydown != null) return _onkeydown;
212         ValueBinding vb = getValueBinding("onkeydown");
213         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
214     }
215
216     public void setOnkeypress(String JavaDoc onkeypress)
217     {
218         _onkeypress = onkeypress;
219     }
220
221     public String JavaDoc getOnkeypress()
222     {
223         if (_onkeypress != null) return _onkeypress;
224         ValueBinding vb = getValueBinding("onkeypress");
225         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
226     }
227
228     public void setOnkeyup(String JavaDoc onkeyup)
229     {
230         _onkeyup = onkeyup;
231     }
232
233     public String JavaDoc getOnkeyup()
234     {
235         if (_onkeyup != null) return _onkeyup;
236         ValueBinding vb = getValueBinding("onkeyup");
237         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
238     }
239
240     public void setOnmousedown(String JavaDoc onmousedown)
241     {
242         _onmousedown = onmousedown;
243     }
244
245     public String JavaDoc getOnmousedown()
246     {
247         if (_onmousedown != null) return _onmousedown;
248         ValueBinding vb = getValueBinding("onmousedown");
249         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
250     }
251
252     public void setOnmousemove(String JavaDoc onmousemove)
253     {
254         _onmousemove = onmousemove;
255     }
256
257     public String JavaDoc getOnmousemove()
258     {
259         if (_onmousemove != null) return _onmousemove;
260         ValueBinding vb = getValueBinding("onmousemove");
261         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
262     }
263
264     public void setOnmouseout(String JavaDoc onmouseout)
265     {
266         _onmouseout = onmouseout;
267     }
268
269     public String JavaDoc getOnmouseout()
270     {
271         if (_onmouseout != null) return _onmouseout;
272         ValueBinding vb = getValueBinding("onmouseout");
273         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
274     }
275
276     public void setOnmouseover(String JavaDoc onmouseover)
277     {
278         _onmouseover = onmouseover;
279     }
280
281     public String JavaDoc getOnmouseover()
282     {
283         if (_onmouseover != null) return _onmouseover;
284         ValueBinding vb = getValueBinding("onmouseover");
285         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
286     }
287
288     public void setOnmouseup(String JavaDoc onmouseup)
289     {
290         _onmouseup = onmouseup;
291     }
292
293     public String JavaDoc getOnmouseup()
294     {
295         if (_onmouseup != null) return _onmouseup;
296         ValueBinding vb = getValueBinding("onmouseup");
297         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
298     }
299
300     public void setOnselect(String JavaDoc onselect)
301     {
302         _onselect = onselect;
303     }
304
305     public String JavaDoc getOnselect()
306     {
307         if (_onselect != null) return _onselect;
308         ValueBinding vb = getValueBinding("onselect");
309         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
310     }
311
312     public void setReadonly(boolean readonly)
313     {
314         _readonly = Boolean.valueOf(readonly);
315     }
316
317     public boolean isReadonly()
318     {
319         if (_readonly != null) return _readonly.booleanValue();
320         ValueBinding vb = getValueBinding("readonly");
321         Boolean JavaDoc v = vb != null ? (Boolean JavaDoc)vb.getValue(getFacesContext()) : null;
322         return v != null ? v.booleanValue() : DEFAULT_READONLY;
323     }
324
325     public void setSize(int size)
326     {
327         _size = new Integer JavaDoc(size);
328     }
329
330     public int getSize()
331     {
332         if (_size != null) return _size.intValue();
333         ValueBinding vb = getValueBinding("size");
334         Integer JavaDoc v = vb != null ? (Integer JavaDoc)vb.getValue(getFacesContext()) : null;
335         return v != null ? v.intValue() : DEFAULT_SIZE;
336     }
337
338     public void setStyle(String JavaDoc style)
339     {
340         _style = style;
341     }
342
343     public String JavaDoc getStyle()
344     {
345         if (_style != null) return _style;
346         ValueBinding vb = getValueBinding("style");
347         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
348     }
349
350     public void setStyleClass(String JavaDoc styleClass)
351     {
352         _styleClass = styleClass;
353     }
354
355     public String JavaDoc getStyleClass()
356     {
357         if (_styleClass != null) return _styleClass;
358         ValueBinding vb = getValueBinding("styleClass");
359         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
360     }
361
362     public void setTabindex(String JavaDoc tabindex)
363     {
364         _tabindex = tabindex;
365     }
366
367     public String JavaDoc getTabindex()
368     {
369         if (_tabindex != null) return _tabindex;
370         ValueBinding vb = getValueBinding("tabindex");
371         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
372     }
373
374     public void setTitle(String JavaDoc title)
375     {
376         _title = title;
377     }
378
379     public String JavaDoc getTitle()
380     {
381         if (_title != null) return _title;
382         ValueBinding vb = getValueBinding("title");
383         return vb != null ? (String JavaDoc)vb.getValue(getFacesContext()) : null;
384     }
385
386
387     public Object JavaDoc saveState(FacesContext context)
388     {
389         Object JavaDoc values[] = new Object JavaDoc[27];
390         values[0] = super.saveState(context);
391         values[1] = _accesskey;
392         values[2] = _alt;
393         values[3] = _dir;
394         values[4] = _disabled;
395         values[5] = _lang;
396         values[6] = _maxlength;
397         values[7] = _onblur;
398         values[8] = _onchange;
399         values[9] = _onclick;
400         values[10] = _ondblclick;
401         values[11] = _onfocus;
402         values[12] = _onkeydown;
403         values[13] = _onkeypress;
404         values[14] = _onkeyup;
405         values[15] = _onmousedown;
406         values[16] = _onmousemove;
407         values[17] = _onmouseout;
408         values[18] = _onmouseover;
409         values[19] = _onmouseup;
410         values[20] = _onselect;
411         values[21] = _readonly;
412         values[22] = _size;
413         values[23] = _style;
414         values[24] = _styleClass;
415         values[25] = _tabindex;
416         values[26] = _title;
417         return ((Object JavaDoc) (values));
418     }
419
420     public void restoreState(FacesContext context, Object JavaDoc state)
421     {
422         Object JavaDoc values[] = (Object JavaDoc[])state;
423         super.restoreState(context, values[0]);
424         _accesskey = (String JavaDoc)values[1];
425         _alt = (String JavaDoc)values[2];
426         _dir = (String JavaDoc)values[3];
427         _disabled = (Boolean JavaDoc)values[4];
428         _lang = (String JavaDoc)values[5];
429         _maxlength = (Integer JavaDoc)values[6];
430         _onblur = (String JavaDoc)values[7];
431         _onchange = (String JavaDoc)values[8];
432         _onclick = (String JavaDoc)values[9];
433         _ondblclick = (String JavaDoc)values[10];
434         _onfocus = (String JavaDoc)values[11];
435         _onkeydown = (String JavaDoc)values[12];
436         _onkeypress = (String JavaDoc)values[13];
437         _onkeyup = (String JavaDoc)values[14];
438         _onmousedown = (String JavaDoc)values[15];
439         _onmousemove = (String JavaDoc)values[16];
440         _onmouseout = (String JavaDoc)values[17];
441         _onmouseover = (String JavaDoc)values[18];
442         _onmouseup = (String JavaDoc)values[19];
443         _onselect = (String JavaDoc)values[20];
444         _readonly = (Boolean JavaDoc)values[21];
445         _size = (Integer JavaDoc)values[22];
446         _style = (String JavaDoc)values[23];
447         _styleClass = (String JavaDoc)values[24];
448         _tabindex = (String JavaDoc)values[25];
449         _title = (String JavaDoc)values[26];
450     }
451     //------------------ GENERATED CODE END ---------------------------------------
452
}
453
Popular Tags