1 58 package org.apache.ecs.xhtml; 59 60 import org.apache.ecs.*; 61 62 70 public class textarea extends MultiPartElement implements PageEvents, FormEvents, MouseEvents, KeyEvents 71 { 72 public final static String off = "off"; 73 public final static String physical = "physical"; 74 public final static String virtual = "virtual"; 75 76 79 { 80 setElementType("textarea"); 81 setCase(LOWERCASE); 82 setAttributeQuote(true); 83 } 84 87 public textarea() 88 { 89 } 90 91 96 public textarea(int rows, int cols) 97 { 98 setRows(rows); 99 setCols(cols); 100 } 101 102 107 public textarea(String rows, String cols) 108 { 109 setRows(rows); 110 setCols(cols); 111 } 112 113 119 public textarea(String name, int rows, int cols) 120 { 121 setName(name); 122 setRows(rows); 123 setCols(cols); 124 } 125 126 132 public textarea(String name, String rows, String cols) 133 { 134 setName(name); 135 setRows(rows); 136 setCols(cols); 137 } 138 139 143 public textarea setRows(int rows) 144 { 145 setRows(Integer.toString(rows)); 146 return(this); 147 } 148 149 153 public textarea setRows(String rows) 154 { 155 addAttribute("rows",rows); 156 return(this); 157 } 158 159 163 public textarea setWrap(String wrap) 164 { 165 addAttribute("wrap",wrap); 166 return(this); 167 } 168 169 173 public textarea setCols(int cols) 174 { 175 setCols(Integer.toString(cols)); 176 return(this); 177 } 178 179 183 public textarea setCols(String cols) 184 { 185 addAttribute("cols",cols); 186 return(this); 187 } 188 189 193 public textarea setName(String name) 194 { 195 addAttribute("name",name); 196 return(this); 197 } 198 199 203 public textarea setTabindex(String index) 204 { 205 addAttribute("tabindex",index); 206 return this; 207 } 208 209 213 public textarea setTabindex(int index) 214 { 215 setTabindex(Integer.toString(index)); 216 return this; 217 } 218 219 223 public textarea setReadOnly(boolean readonly) 224 { 225 if ( readonly == true ) 226 addAttribute("readonly", "readonly"); 227 else 228 removeAttribute("readonly"); 229 230 return(this); 231 } 232 233 237 public textarea setDisabled(boolean disabled) 238 { 239 if ( disabled == true ) 240 addAttribute("disabled", "disabled"); 241 else 242 removeAttribute("disabled"); 243 244 return(this); 245 } 246 247 251 public Element setLang(String lang) 252 { 253 addAttribute("lang",lang); 254 addAttribute("xml:lang",lang); 255 return this; 256 } 257 258 263 public textarea addElement(String hashcode,Element element) 264 { 265 addElementToRegistry(hashcode,element); 266 return(this); 267 } 268 269 274 public textarea addElement(String hashcode,String element) 275 { 276 addElementToRegistry(hashcode,element); 277 return(this); 278 } 279 280 284 public textarea addElement(Element element) 285 { 286 addElementToRegistry(element); 287 return(this); 288 } 289 290 294 public textarea addElement(String element) 295 { 296 addElementToRegistry(element); 297 return(this); 298 } 299 303 public textarea removeElement(String hashcode) 304 { 305 removeElementFromRegistry(hashcode); 306 return(this); 307 } 308 309 316 public void setOnLoad(String script) 317 { 318 addAttribute ( "onload", script ); 319 } 320 321 328 public void setOnUnload(String script) 329 { 330 addAttribute ( "onunload", script ); 331 } 332 333 339 public void setOnSubmit(String script) 340 { 341 addAttribute ( "onsubmit", script ); 342 } 343 344 350 public void setOnReset(String script) 351 { 352 addAttribute ( "onreset", script ); 353 } 354 355 361 public void setOnSelect(String script) 362 { 363 addAttribute ( "onselect", script ); 364 } 365 366 373 public void setOnChange(String script) 374 { 375 addAttribute ( "onchange", script ); 376 } 377 378 384 public void setOnClick(String script) 385 { 386 addAttribute ( "onclick", script ); 387 } 388 394 public void setOnDblClick(String script) 395 { 396 addAttribute ( "ondblclick", script ); 397 } 398 404 public void setOnMouseDown(String script) 405 { 406 addAttribute ( "onmousedown", script ); 407 } 408 414 public void setOnMouseUp(String script) 415 { 416 addAttribute ( "onmouseup", script ); 417 } 418 424 public void setOnMouseOver(String script) 425 { 426 addAttribute ( "onmouseover", script ); 427 } 428 434 public void setOnMouseMove(String script) 435 { 436 addAttribute ( "onmousemove", script ); 437 } 438 444 public void setOnMouseOut(String script) 445 { 446 addAttribute ( "onmouseout", script ); 447 } 448 449 455 public void setOnKeyPress(String script) 456 { 457 addAttribute ( "onkeypress", script ); 458 } 459 460 466 public void setOnKeyDown(String script) 467 { 468 addAttribute ( "onkeydown", script ); 469 } 470 471 477 public void setOnKeyUp(String script) 478 { 479 addAttribute ( "onkeyup", script ); 480 } 481 } 482 | Popular Tags |