1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 69 70 public class button extends MultiPartElement implements Printable, FocusEvents, MouseEvents, KeyEvents 71 { 72 public final static String reset = "reset"; 74 public final static String submit = "submit"; 75 public final static String button = "button"; 76 77 80 { 81 setElementType("button"); 82 setCase(LOWERCASE); 83 setAttributeQuote(true); 84 } 85 86 public button() 87 { 88 } 89 90 94 public button setName(String name) 95 { 96 addAttribute("name",name); 97 return(this); 98 } 99 100 104 public button setValue(String value) 105 { 106 addAttribute("value",value); 107 return(this); 108 } 109 110 115 public button setType(String type) 116 { 117 addAttribute("type",type); 118 return(this); 119 } 120 121 125 public button setDisabled(boolean disabled) 126 { 127 if(disabled) 128 addAttribute("disabled","disabled"); 129 else 130 removeAttribute("disabled"); 131 return(this); 132 } 133 134 138 public button setTabIndex(int number) 139 { 140 addAttribute("tabindex",Integer.toString(number)); 141 return(this); 142 } 143 144 148 public button setTabIndex(String number) 149 { 150 addAttribute("tabindex",number); 151 return(this); 152 } 153 154 158 public Element setLang(String lang) 159 { 160 addAttribute("lang",lang); 161 addAttribute("xml:lang",lang); 162 return this; 163 } 164 165 170 public button addElement(String hashcode,Element element) 171 { 172 addElementToRegistry(hashcode,element); 173 return(this); 174 } 175 176 181 public button addElement(String hashcode,String element) 182 { 183 addElementToRegistry(hashcode,element); 184 return(this); 185 } 186 187 191 public button addElement(Element element) 192 { 193 addElementToRegistry(element); 194 return(this); 195 } 196 197 201 public button addElement(String element) 202 { 203 addElementToRegistry(element); 204 return(this); 205 } 206 210 public button removeElement(String hashcode) 211 { 212 removeElementFromRegistry(hashcode); 213 return(this); 214 } 215 216 224 public void setOnFocus(String script) 225 { 226 addAttribute ( "onfocus", script ); 227 } 228 229 236 public void setOnBlur(String script) 237 { 238 addAttribute ( "onblur", script ); 239 } 240 241 247 public void setOnClick(String script) 248 { 249 addAttribute ( "onclick", script ); 250 } 251 257 public void setOnDblClick(String script) 258 { 259 addAttribute ( "ondblclick", script ); 260 } 261 267 public void setOnMouseDown(String script) 268 { 269 addAttribute ( "onmousedown", script ); 270 } 271 277 public void setOnMouseUp(String script) 278 { 279 addAttribute ( "onmouseup", script ); 280 } 281 287 public void setOnMouseOver(String script) 288 { 289 addAttribute ( "onmouseover", script ); 290 } 291 297 public void setOnMouseMove(String script) 298 { 299 addAttribute ( "onmousemove", script ); 300 } 301 307 public void setOnMouseOut(String script) 308 { 309 addAttribute ( "onmouseout", script ); 310 } 311 312 318 public void setOnKeyPress(String script) 319 { 320 addAttribute ( "onkeypress", script ); 321 } 322 323 329 public void setOnKeyDown(String script) 330 { 331 addAttribute ( "onkeydown", script ); 332 } 333 334 340 public void setOnKeyUp(String script) 341 { 342 addAttribute ( "onkeyup", script ); 343 } 344 } 345 | Popular Tags |