1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 70 public class optgroup extends MultiPartElement implements Printable, FocusEvents, FormEvents, MouseEvents, KeyEvents 71 { 72 73 76 { 77 setElementType("optgroup"); 78 setCase(LOWERCASE); 79 setAttributeQuote(true); 80 } 81 82 86 public optgroup() 87 { 88 } 89 90 96 public optgroup(String label) 97 { 98 setLabel(label); 99 } 100 101 108 public optgroup(String label, boolean disabled) 109 { 110 setLabel(label); 111 setDisabled(disabled); 112 } 113 114 118 public optgroup setLabel(String label) 119 { 120 addAttribute("label",label); 121 return this; 122 } 123 124 128 public optgroup setValue(String value) 129 { 130 addAttribute("value",value); 131 return this; 132 } 133 134 138 public optgroup setDisabled(boolean disabled) 139 { 140 if ( disabled == true ) 141 addAttribute("disabled", "disabled"); 142 else 143 removeAttribute("disabled"); 144 145 return(this); 146 } 147 148 152 public Element setLang(String lang) 153 { 154 addAttribute("lang",lang); 155 addAttribute("xml:lang",lang); 156 return this; 157 } 158 159 164 public optgroup addElement(String hashcode,Element element) 165 { 166 addElementToRegistry(hashcode,element); 167 return(this); 168 } 169 170 175 public optgroup addElement(String hashcode,String element) 176 { 177 addElementToRegistry(hashcode,element); 178 return(this); 179 } 180 181 185 public optgroup addElement(Element element) 186 { 187 addElementToRegistry(element); 188 return(this); 189 } 190 191 195 public optgroup addElement(String element) 196 { 197 addElementToRegistry(element); 198 return(this); 199 } 200 204 public optgroup removeElement(String hashcode) 205 { 206 removeElementFromRegistry(hashcode); 207 return(this); 208 } 209 210 218 public void setOnFocus(String script) 219 { 220 addAttribute ( "onfocus", script ); 221 } 222 223 230 public void setOnBlur(String script) 231 { 232 addAttribute ( "onblur", script ); 233 } 234 235 241 public void setOnSubmit(String script) 242 { 243 addAttribute ( "onsubmit", script ); 244 } 245 246 252 public void setOnReset(String script) 253 { 254 addAttribute ( "onreset", script ); 255 } 256 257 263 public void setOnSelect(String script) 264 { 265 addAttribute ( "onselect", script ); 266 } 267 268 275 public void setOnChange(String script) 276 { 277 addAttribute ( "onchange", script ); 278 } 279 280 286 public void setOnClick(String script) 287 { 288 addAttribute ( "onclick", script ); 289 } 290 296 public void setOnDblClick(String script) 297 { 298 addAttribute ( "ondblclick", script ); 299 } 300 306 public void setOnMouseDown(String script) 307 { 308 addAttribute ( "onmousedown", script ); 309 } 310 316 public void setOnMouseUp(String script) 317 { 318 addAttribute ( "onmouseup", script ); 319 } 320 326 public void setOnMouseOver(String script) 327 { 328 addAttribute ( "onmouseover", script ); 329 } 330 336 public void setOnMouseMove(String script) 337 { 338 addAttribute ( "onmousemove", script ); 339 } 340 346 public void setOnMouseOut(String script) 347 { 348 addAttribute ( "onmouseout", script ); 349 } 350 351 357 public void setOnKeyPress(String script) 358 { 359 addAttribute ( "onkeypress", script ); 360 } 361 362 368 public void setOnKeyDown(String script) 369 { 370 addAttribute ( "onkeydown", script ); 371 } 372 373 379 public void setOnKeyUp(String script) 380 { 381 addAttribute ( "onkeyup", script ); 382 } 383 } 384 | Popular Tags |