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