1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 69 public class table extends MultiPartElement implements Printable, MouseEvents, KeyEvents 70 { 71 74 { 75 setElementType("table"); 76 setCase(LOWERCASE); 77 setAttributeQuote(true); 78 } 79 public table() 80 { 81 } 82 83 88 public table(int border) 89 { 90 setBorder(border); 91 } 92 93 98 public table(String border) 99 { 100 setBorder(border); 101 } 102 103 108 public table setSummary(String summary) 109 { 110 addAttribute("summary",summary); 111 return(this); 112 } 113 114 120 public table setAlign(String align) 121 { 122 addAttribute("align",align); 123 return(this); 124 } 125 126 131 public table setWidth(String width) 132 { 133 addAttribute("width",width); 134 return(this); 135 } 136 141 public table setHeight(String height) 142 { 143 addAttribute("height",height); 144 return(this); 145 } 146 151 public table setWidth(int width) 152 { 153 addAttribute("width",Integer.toString(width)); 154 return(this); 155 } 156 161 public table setHeight(int height) 162 { 163 addAttribute("height",Integer.toString(height)); 164 return(this); 165 } 166 171 public table setCols(int cols) 172 { 173 addAttribute("cols",Integer.toString(cols)); 174 return(this); 175 } 176 181 public table setCols(String cols) 182 { 183 addAttribute("cols",cols); 184 return(this); 185 } 186 190 public table setCellPadding(int cellpadding) 191 { 192 addAttribute("cellpadding",Integer.toString(cellpadding)); 193 return(this); 194 } 195 199 public table setCellSpacing(int cellspacing) 200 { 201 addAttribute("cellspacing",Integer.toString(cellspacing)); 202 return(this); 203 } 204 208 public table setCellPadding(String cellpadding) 209 { 210 addAttribute("cellpadding",cellpadding); 211 return(this); 212 } 213 217 public table setCellSpacing(String cellspacing) 218 { 219 addAttribute("cellspacing",cellspacing); 220 return(this); 221 } 222 226 public table setBorder(int border) 227 { 228 addAttribute("border",Integer.toString(border)); 229 return(this); 230 } 231 235 public table setBorder(String border) 236 { 237 addAttribute("border",border); 238 return(this); 239 } 240 244 public table setFrame(String frame) 245 { 246 addAttribute("frame",frame); 247 return(this); 248 } 249 253 public table setRules(String rules) 254 { 255 addAttribute("rules",rules); 256 return(this); 257 } 258 259 263 public table setBgColor(String color) 264 { 265 addAttribute("bgcolor",HtmlColor.convertColor(color)); 266 return this; 267 } 268 269 273 public Element setLang(String lang) 274 { 275 addAttribute("lang",lang); 276 addAttribute("xml:lang",lang); 277 return this; 278 } 279 280 285 public table addElement(String hashcode,Element element) 286 { 287 addElementToRegistry(hashcode,element); 288 return(this); 289 } 290 291 296 public table addElement(String hashcode,String element) 297 { 298 addElementToRegistry(hashcode,element); 299 return(this); 300 } 301 302 306 public table addElement(Element element) 307 { 308 addElementToRegistry(element); 309 return(this); 310 } 311 312 316 public table addElement(String element) 317 { 318 addElementToRegistry(element); 319 return(this); 320 } 321 325 public table removeElement(String hashcode) 326 { 327 removeElementFromRegistry(hashcode); 328 return(this); 329 } 330 331 337 public void setOnClick(String script) 338 { 339 addAttribute ( "onclick", script ); 340 } 341 347 public void setOnDblClick(String script) 348 { 349 addAttribute ( "ondblclick", script ); 350 } 351 357 public void setOnMouseDown(String script) 358 { 359 addAttribute ( "onmousedown", script ); 360 } 361 367 public void setOnMouseUp(String script) 368 { 369 addAttribute ( "onmouseup", script ); 370 } 371 377 public void setOnMouseOver(String script) 378 { 379 addAttribute ( "onmouseover", script ); 380 } 381 387 public void setOnMouseMove(String script) 388 { 389 addAttribute ( "onmousemove", script ); 390 } 391 397 public void setOnMouseOut(String script) 398 { 399 addAttribute ( "onmouseout", script ); 400 } 401 402 408 public void setOnKeyPress(String script) 409 { 410 addAttribute ( "onkeypress", script ); 411 } 412 413 419 public void setOnKeyDown(String script) 420 { 421 addAttribute ( "onkeydown", script ); 422 } 423 424 430 public void setOnKeyUp(String script) 431 { 432 addAttribute ( "onkeyup", script ); 433 } 434 } 435 | Popular Tags |