1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 68 public class Table extends MultiPartElement implements Printable, MouseEvents, KeyEvents 69 { 70 73 { 74 setElementType("table"); 75 } 76 public Table() 77 { 78 } 79 80 85 public Table(int border) 86 { 87 setBorder(border); 88 } 89 90 95 public Table(String border) 96 { 97 setBorder(border); 98 } 99 100 105 public Table setSummary(String summary) 106 { 107 addAttribute("summary",summary); 108 return(this); 109 } 110 111 117 public Table setAlign(String align) 118 { 119 addAttribute("align",align); 120 return(this); 121 } 122 123 128 public Table setWidth(String width) 129 { 130 addAttribute("width",width); 131 return(this); 132 } 133 138 public Table setHeight(String height) 139 { 140 addAttribute("height",height); 141 return(this); 142 } 143 148 public Table setWidth(int width) 149 { 150 addAttribute("width",Integer.toString(width)); 151 return(this); 152 } 153 158 public Table setHeight(int height) 159 { 160 addAttribute("height",Integer.toString(height)); 161 return(this); 162 } 163 168 public Table setCols(int cols) 169 { 170 addAttribute("cols",Integer.toString(cols)); 171 return(this); 172 } 173 178 public Table setCols(String cols) 179 { 180 addAttribute("cols",cols); 181 return(this); 182 } 183 187 public Table setCellPadding(int cellpadding) 188 { 189 addAttribute("cellpadding",Integer.toString(cellpadding)); 190 return(this); 191 } 192 196 public Table setCellSpacing(int cellspacing) 197 { 198 addAttribute("cellspacing",Integer.toString(cellspacing)); 199 return(this); 200 } 201 205 public Table setCellPadding(String cellpadding) 206 { 207 addAttribute("cellpadding",cellpadding); 208 return(this); 209 } 210 214 public Table setCellSpacing(String cellspacing) 215 { 216 addAttribute("cellspacing",cellspacing); 217 return(this); 218 } 219 223 public Table setBorder(int border) 224 { 225 addAttribute("border",Integer.toString(border)); 226 return(this); 227 } 228 232 public Table setBorder(String border) 233 { 234 addAttribute("border",border); 235 return(this); 236 } 237 241 public Table setFrame(String frame) 242 { 243 addAttribute("frame",frame); 244 return(this); 245 } 246 250 public Table setRules(String rules) 251 { 252 addAttribute("rules",rules); 253 return(this); 254 } 255 256 260 public Table setBgColor(String color) 261 { 262 addAttribute("bgcolor",HtmlColor.convertColor(color)); 263 return this; 264 } 265 266 271 public Table addElement(String hashcode,Element element) 272 { 273 addElementToRegistry(hashcode,element); 274 return(this); 275 } 276 277 282 public Table addElement(String hashcode,String element) 283 { 284 addElementToRegistry(hashcode,element); 285 return(this); 286 } 287 288 292 public Table addElement(Element element) 293 { 294 addElementToRegistry(element); 295 return(this); 296 } 297 298 302 public Table addElement(String element) 303 { 304 addElementToRegistry(element); 305 return(this); 306 } 307 311 public Table removeElement(String hashcode) 312 { 313 removeElementFromRegistry(hashcode); 314 return(this); 315 } 316 317 323 public void setOnClick(String script) 324 { 325 addAttribute ( "onClick", script ); 326 } 327 333 public void setOnDblClick(String script) 334 { 335 addAttribute ( "onDblClick", script ); 336 } 337 343 public void setOnMouseDown(String script) 344 { 345 addAttribute ( "onMouseDown", script ); 346 } 347 353 public void setOnMouseUp(String script) 354 { 355 addAttribute ( "onMouseUp", script ); 356 } 357 363 public void setOnMouseOver(String script) 364 { 365 addAttribute ( "onMouseOver", script ); 366 } 367 373 public void setOnMouseMove(String script) 374 { 375 addAttribute ( "onMouseMove", script ); 376 } 377 383 public void setOnMouseOut(String script) 384 { 385 addAttribute ( "onMouseOut", script ); 386 } 387 388 394 public void setOnKeyPress(String script) 395 { 396 addAttribute ( "onKeyPress", script ); 397 } 398 399 405 public void setOnKeyDown(String script) 406 { 407 addAttribute ( "onKeyDown", script ); 408 } 409 410 416 public void setOnKeyUp(String script) 417 { 418 addAttribute ( "onKeyUp", script ); 419 } 420 } 421 | Popular Tags |