1 58 package org.apache.ecs.html; 59 60 import org.apache.ecs.*; 61 62 69 public class TextArea extends MultiPartElement implements PageEvents, FormEvents, MouseEvents, KeyEvents, FocusEvents 70 { 71 public final static String off = "off"; 72 public final static String physical = "physical"; 73 public final static String virtual = "virtual"; 74 public final static String OFF = "OFF"; 75 public final static String PHYSICAL = "PHYSICAL"; 76 public final static String VIRTUAL = "VIRTUAL"; 77 78 81 { 82 setElementType("textarea"); 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", NO_ATTRIBUTE_VALUE); 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", NO_ATTRIBUTE_VALUE); 241 else 242 removeAttribute("disabled"); 243 244 return(this); 245 } 246 247 252 public TextArea addElement(String hashcode,Element element) 253 { 254 addElementToRegistry(hashcode,element); 255 return(this); 256 } 257 258 263 public TextArea addElement(String hashcode,String element) 264 { 265 addElementToRegistry(hashcode,element); 266 return(this); 267 } 268 269 273 public TextArea addElement(Element element) 274 { 275 addElementToRegistry(element); 276 return(this); 277 } 278 279 283 public TextArea addElement(String element) 284 { 285 addElementToRegistry(element); 286 return(this); 287 } 288 292 public TextArea removeElement(String hashcode) 293 { 294 removeElementFromRegistry(hashcode); 295 return(this); 296 } 297 298 305 public void setOnLoad(String script) 306 { 307 addAttribute ( "onLoad", script ); 308 } 309 310 317 public void setOnUnload(String script) 318 { 319 addAttribute ( "onUnload", script ); 320 } 321 322 328 public void setOnSubmit(String script) 329 { 330 addAttribute ( "onSubmit", script ); 331 } 332 333 339 public void setOnReset(String script) 340 { 341 addAttribute ( "onReset", script ); 342 } 343 344 350 public void setOnSelect(String script) 351 { 352 addAttribute ( "onSelect", script ); 353 } 354 355 362 public void setOnChange(String script) 363 { 364 addAttribute ( "onChange", script ); 365 } 366 367 373 public void setOnClick(String script) 374 { 375 addAttribute ( "onClick", script ); 376 } 377 383 public void setOnDblClick(String script) 384 { 385 addAttribute ( "onDblClick", script ); 386 } 387 393 public void setOnMouseDown(String script) 394 { 395 addAttribute ( "onMouseDown", script ); 396 } 397 403 public void setOnMouseUp(String script) 404 { 405 addAttribute ( "onMouseUp", script ); 406 } 407 413 public void setOnMouseOver(String script) 414 { 415 addAttribute ( "onMouseOver", script ); 416 } 417 423 public void setOnMouseMove(String script) 424 { 425 addAttribute ( "onMouseMove", script ); 426 } 427 433 public void setOnMouseOut(String script) 434 { 435 addAttribute ( "onMouseOut", script ); 436 } 437 438 444 public void setOnKeyPress(String script) 445 { 446 addAttribute ( "onKeyPress", script ); 447 } 448 449 455 public void setOnKeyDown(String script) 456 { 457 addAttribute ( "onKeyDown", script ); 458 } 459 460 466 public void setOnKeyUp(String script) 467 { 468 addAttribute ( "onKeyUp", script ); 469 } 470 471 477 public void setOnFocus(String script) 478 { 479 addAttribute ( "onFocus", script ); 480 } 481 482 488 public void setOnBlur(String script) 489 { 490 addAttribute ( "onBlur", script ); 491 } 492 } 493 | Popular Tags |