KickJava   Java API By Example, From Geeks To Geeks.

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


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.UISelectMany;
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 HtmlSelectManyListbox extends UISelectMany
27 {
28     //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
29

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