KickJava   Java API By Example, From Geeks To Geeks.

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


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

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