KickJava   Java API By Example, From Geeks To Geeks.

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


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

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