1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 68 public class TH extends MultiPartElement implements Printable, MouseEvents, KeyEvents 69 { 70 73 { 74 setElementType("th"); 75 } 76 77 80 public TH() 81 { 82 } 83 84 87 public TH(Element element) 88 { 89 addElement(element); 90 } 91 92 95 public TH(String element) 96 { 97 addElement(element); 98 } 99 100 104 public TH(boolean close) 105 { 106 setNeedClosingTag(close); 107 } 108 109 113 public TH setAbbr(String cdata) 114 { 115 addAttribute("abbr",cdata); 116 return(this); 117 } 118 119 123 public TH setAxis(String cdata) 124 { 125 addAttribute("axis",cdata); 126 return(this); 127 } 128 129 133 public TH setAxes(String id_refs) 134 { 135 addAttribute("axes",id_refs); 136 return(this); 137 } 138 139 143 public TH setRowSpan(int span) 144 { 145 addAttribute("rowspan",Integer.toString(span)); 146 return(this); 147 } 148 149 153 public TH setRowSpan(String span) 154 { 155 addAttribute("rowspan",span); 156 return(this); 157 } 158 159 163 public TH setColSpan(int span) 164 { 165 addAttribute("colspan",Integer.toString(span)); 166 return(this); 167 } 168 169 173 public TH setColSpan(String span) 174 { 175 addAttribute("colspan",span); 176 return(this); 177 } 178 179 183 public TH setNoWrap(boolean wrap) 184 { 185 if ( wrap == true ) 186 addAttribute("nowrap", NO_ATTRIBUTE_VALUE); 187 else 188 removeAttribute("nowrap"); 189 190 return(this); 191 } 192 193 197 public TH setWidth(int width) 198 { 199 addAttribute("width",Integer.toString(width)); 200 return(this); 201 } 202 203 207 public TH setWidth(String width) 208 { 209 addAttribute("width",width); 210 return(this); 211 } 212 213 217 public TH setHeight(int height) 218 { 219 addAttribute("height",Integer.toString(height)); 220 return(this); 221 } 222 223 227 public TH setHeight(String height) 228 { 229 addAttribute("height",height); 230 return(this); 231 } 232 233 237 public TH setAlign(String align) 238 { 239 addAttribute("align",align); 240 return(this); 241 } 242 243 247 public TH setVAlign(String valign) 248 { 249 addAttribute("valign",valign); 250 return(this); 251 } 252 253 257 public TH setChar(String character) 258 { 259 addAttribute("char",character); 260 return(this); 261 } 262 263 268 public TH setCharOff(int char_off) 269 { 270 addAttribute("charoff",Integer.toString(char_off)); 271 return(this); 272 } 273 274 279 public TH setCharOff(String char_off) 280 { 281 addAttribute("charoff",char_off); 282 return(this); 283 } 284 285 289 public TH setBgColor(String color) 290 { 291 addAttribute("bgcolor",HtmlColor.convertColor(color)); 292 return(this); 293 } 294 295 300 public TH addElement(String hashcode,Element element) 301 { 302 addElementToRegistry(hashcode,element); 303 return(this); 304 } 305 306 311 public TH addElement(String hashcode,String element) 312 { 313 addElementToRegistry(hashcode,element); 314 return(this); 315 } 316 317 321 public TH addElement(Element element) 322 { 323 addElementToRegistry(element); 324 return(this); 325 } 326 327 331 public TH addElement(String element) 332 { 333 addElementToRegistry(element); 334 return(this); 335 } 336 340 public TH removeElement(String hashcode) 341 { 342 removeElementFromRegistry(hashcode); 343 return(this); 344 } 345 346 352 public void setOnClick(String script) 353 { 354 addAttribute ( "onClick", script ); 355 } 356 362 public void setOnDblClick(String script) 363 { 364 addAttribute ( "onDblClick", script ); 365 } 366 372 public void setOnMouseDown(String script) 373 { 374 addAttribute ( "onMouseDown", script ); 375 } 376 382 public void setOnMouseUp(String script) 383 { 384 addAttribute ( "onMouseUp", script ); 385 } 386 392 public void setOnMouseOver(String script) 393 { 394 addAttribute ( "onMouseOver", script ); 395 } 396 402 public void setOnMouseMove(String script) 403 { 404 addAttribute ( "onMouseMove", script ); 405 } 406 412 public void setOnMouseOut(String script) 413 { 414 addAttribute ( "onMouseOut", script ); 415 } 416 417 423 public void setOnKeyPress(String script) 424 { 425 addAttribute ( "onKeyPress", script ); 426 } 427 428 434 public void setOnKeyDown(String script) 435 { 436 addAttribute ( "onKeyDown", script ); 437 } 438 439 445 public void setOnKeyUp(String script) 446 { 447 addAttribute ( "onKeyUp", script ); 448 } 449 } 450 | Popular Tags |