1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 69 public class OptGroup extends MultiPartElement implements Printable, FocusEvents, FormEvents, MouseEvents, KeyEvents 70 { 71 72 75 { 76 setElementType("optgroup"); 77 } 78 79 83 public OptGroup() 84 { 85 } 86 87 93 public OptGroup(String label) 94 { 95 setLabel(label); 96 } 97 98 105 public OptGroup(String label, boolean disabled) 106 { 107 setLabel(label); 108 setDisabled(disabled); 109 } 110 111 115 public OptGroup setLabel(String label) 116 { 117 addAttribute("label",label); 118 return this; 119 } 120 121 125 public OptGroup setValue(String value) 126 { 127 addAttribute("value",value); 128 return this; 129 } 130 131 135 public OptGroup setDisabled(boolean disabled) 136 { 137 if ( disabled == true ) 138 addAttribute("disabled", NO_ATTRIBUTE_VALUE); 139 else 140 removeAttribute("disabled"); 141 142 return(this); 143 } 144 145 150 public OptGroup addElement(String hashcode,Element element) 151 { 152 addElementToRegistry(hashcode,element); 153 return(this); 154 } 155 156 161 public OptGroup addElement(String hashcode,String element) 162 { 163 addElementToRegistry(hashcode,element); 164 return(this); 165 } 166 167 171 public OptGroup addElement(Element element) 172 { 173 addElementToRegistry(element); 174 return(this); 175 } 176 177 181 public OptGroup addElement(String element) 182 { 183 addElementToRegistry(element); 184 return(this); 185 } 186 190 public OptGroup removeElement(String hashcode) 191 { 192 removeElementFromRegistry(hashcode); 193 return(this); 194 } 195 196 204 public void setOnFocus(String script) 205 { 206 addAttribute ( "onFocus", script ); 207 } 208 209 216 public void setOnBlur(String script) 217 { 218 addAttribute ( "onBlur", script ); 219 } 220 221 227 public void setOnSubmit(String script) 228 { 229 addAttribute ( "onSubmit", script ); 230 } 231 232 238 public void setOnReset(String script) 239 { 240 addAttribute ( "onReset", script ); 241 } 242 243 249 public void setOnSelect(String script) 250 { 251 addAttribute ( "onSelect", script ); 252 } 253 254 261 public void setOnChange(String script) 262 { 263 addAttribute ( "onChange", script ); 264 } 265 266 272 public void setOnClick(String script) 273 { 274 addAttribute ( "onClick", script ); 275 } 276 282 public void setOnDblClick(String script) 283 { 284 addAttribute ( "onDblClick", script ); 285 } 286 292 public void setOnMouseDown(String script) 293 { 294 addAttribute ( "onMouseDown", script ); 295 } 296 302 public void setOnMouseUp(String script) 303 { 304 addAttribute ( "onMouseUp", script ); 305 } 306 312 public void setOnMouseOver(String script) 313 { 314 addAttribute ( "onMouseOver", script ); 315 } 316 322 public void setOnMouseMove(String script) 323 { 324 addAttribute ( "onMouseMove", script ); 325 } 326 332 public void setOnMouseOut(String script) 333 { 334 addAttribute ( "onMouseOut", script ); 335 } 336 337 343 public void setOnKeyPress(String script) 344 { 345 addAttribute ( "onKeyPress", script ); 346 } 347 348 354 public void setOnKeyDown(String script) 355 { 356 addAttribute ( "onKeyDown", script ); 357 } 358 359 365 public void setOnKeyUp(String script) 366 { 367 addAttribute ( "onKeyUp", script ); 368 } 369 } 370 | Popular Tags |