1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 70 public class body extends MultiPartElement implements Printable, PageEvents, MouseEvents, KeyEvents 71 { 72 75 { 76 setElementType("body"); 77 setCase(LOWERCASE); 78 setAttributeQuote(true); 79 } 80 81 85 public body() 86 { 87 } 88 89 94 public body(String color) 95 { 96 setBgColor(color); 97 } 98 99 103 public body setBgColor(String color) 104 { 105 addAttribute("bgcolor",HtmlColor.convertColor(color)); 106 return this; 107 } 108 109 113 public body setBackground(String url) 114 { 115 addAttribute("background",url); 116 return this; 117 } 118 119 123 public body setText(String text) 124 { 125 addAttribute("text",text); 126 return this; 127 } 128 129 133 public body setLink(String color) 134 { 135 addAttribute("link",HtmlColor.convertColor(color)); 136 return this; 137 } 138 139 143 public body setVlink(String color) 144 { 145 addAttribute("vlink",HtmlColor.convertColor(color)); 146 return this; 147 } 148 149 153 public body setAlink(String color) 154 { 155 addAttribute("alink",HtmlColor.convertColor(color)); 156 return this; 157 } 158 159 163 public Element setLang(String lang) 164 { 165 addAttribute("lang",lang); 166 addAttribute("xml:lang",lang); 167 return this; 168 } 169 170 175 public body addElement(String hashcode,Element element) 176 { 177 addElementToRegistry(hashcode,element); 178 return(this); 179 } 180 181 186 public body addElement(String hashcode,String element) 187 { 188 addElementToRegistry(hashcode,element); 189 return(this); 190 } 191 192 196 public body addElement(Element element) 197 { 198 addElementToRegistry(element); 199 return(this); 200 } 201 205 public body addElement(String element) 206 { 207 addElementToRegistry(element); 208 return(this); 209 } 210 214 public body removeElement(String hashcode) 215 { 216 removeElementFromRegistry(hashcode); 217 return(this); 218 } 219 220 227 public void setOnLoad(String script) 228 { 229 addAttribute ( "onload", script ); 230 } 231 232 239 public void setOnUnload(String script) 240 { 241 addAttribute ( "onunload", script ); 242 } 243 244 250 public void setOnClick(String script) 251 { 252 addAttribute ( "onclick", script ); 253 } 254 260 public void setOnDblClick(String script) 261 { 262 addAttribute ( "ondblclick", script ); 263 } 264 270 public void setOnMouseDown(String script) 271 { 272 addAttribute ( "onmousedown", script ); 273 } 274 280 public void setOnMouseUp(String script) 281 { 282 addAttribute ( "onmouseup", script ); 283 } 284 290 public void setOnMouseOver(String script) 291 { 292 addAttribute ( "onmouseover", script ); 293 } 294 300 public void setOnMouseMove(String script) 301 { 302 addAttribute ( "onmousemove", script ); 303 } 304 310 public void setOnMouseOut(String script) 311 { 312 addAttribute ( "onmouseout", script ); 313 } 314 315 321 public void setOnKeyPress(String script) 322 { 323 addAttribute ( "onkeypress", script ); 324 } 325 326 332 public void setOnKeyDown(String script) 333 { 334 addAttribute ( "onkeydown", script ); 335 } 336 337 343 public void setOnKeyUp(String script) 344 { 345 addAttribute ( "onkeyup", script ); 346 } 347 } 348 | Popular Tags |