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