1 16 package javax.faces.component.html; 17 18 import javax.faces.component.UIInput; 19 import javax.faces.context.FacesContext; 20 import javax.faces.el.ValueBinding; 21 22 26 public class HtmlInputTextarea extends UIInput 27 { 28 30 public static final String COMPONENT_TYPE = "javax.faces.HtmlInputTextarea"; 31 private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Textarea"; 32 private static final int DEFAULT_COLS = Integer.MIN_VALUE; 33 private static final boolean DEFAULT_DISABLED = false; 34 private static final boolean DEFAULT_READONLY = false; 35 private static final int DEFAULT_ROWS = Integer.MIN_VALUE; 36 37 private String _accesskey = null; 38 private Integer _cols = null; 39 private String _dir = null; 40 private Boolean _disabled = null; 41 private String _lang = null; 42 private String _onblur = null; 43 private String _onchange = null; 44 private String _onclick = null; 45 private String _ondblclick = null; 46 private String _onfocus = null; 47 private String _onkeydown = null; 48 private String _onkeypress = null; 49 private String _onkeyup = null; 50 private String _onmousedown = null; 51 private String _onmousemove = null; 52 private String _onmouseout = null; 53 private String _onmouseover = null; 54 private String _onmouseup = null; 55 private String _onselect = null; 56 private Boolean _readonly = null; 57 private Integer _rows = null; 58 private String _style = null; 59 private String _styleClass = null; 60 private String _tabindex = null; 61 private String _title = null; 62 63 public HtmlInputTextarea() 64 { 65 setRendererType(DEFAULT_RENDERER_TYPE); 66 } 67 68 69 public void setAccesskey(String accesskey) 70 { 71 _accesskey = accesskey; 72 } 73 74 public String getAccesskey() 75 { 76 if (_accesskey != null) return _accesskey; 77 ValueBinding vb = getValueBinding("accesskey"); 78 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 79 } 80 81 public void setCols(int cols) 82 { 83 _cols = new Integer (cols); 84 } 85 86 public int getCols() 87 { 88 if (_cols != null) return _cols.intValue(); 89 ValueBinding vb = getValueBinding("cols"); 90 Integer v = vb != null ? (Integer )vb.getValue(getFacesContext()) : null; 91 return v != null ? v.intValue() : DEFAULT_COLS; 92 } 93 94 public void setDir(String dir) 95 { 96 _dir = dir; 97 } 98 99 public String getDir() 100 { 101 if (_dir != null) return _dir; 102 ValueBinding vb = getValueBinding("dir"); 103 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 104 } 105 106 public void setDisabled(boolean disabled) 107 { 108 _disabled = Boolean.valueOf(disabled); 109 } 110 111 public boolean isDisabled() 112 { 113 if (_disabled != null) return _disabled.booleanValue(); 114 ValueBinding vb = getValueBinding("disabled"); 115 Boolean v = vb != null ? (Boolean )vb.getValue(getFacesContext()) : null; 116 return v != null ? v.booleanValue() : DEFAULT_DISABLED; 117 } 118 119 public void setLang(String lang) 120 { 121 _lang = lang; 122 } 123 124 public String getLang() 125 { 126 if (_lang != null) return _lang; 127 ValueBinding vb = getValueBinding("lang"); 128 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 129 } 130 131 public void setOnblur(String onblur) 132 { 133 _onblur = onblur; 134 } 135 136 public String getOnblur() 137 { 138 if (_onblur != null) return _onblur; 139 ValueBinding vb = getValueBinding("onblur"); 140 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 141 } 142 143 public void setOnchange(String onchange) 144 { 145 _onchange = onchange; 146 } 147 148 public String getOnchange() 149 { 150 if (_onchange != null) return _onchange; 151 ValueBinding vb = getValueBinding("onchange"); 152 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 153 } 154 155 public void setOnclick(String onclick) 156 { 157 _onclick = onclick; 158 } 159 160 public String getOnclick() 161 { 162 if (_onclick != null) return _onclick; 163 ValueBinding vb = getValueBinding("onclick"); 164 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 165 } 166 167 public void setOndblclick(String ondblclick) 168 { 169 _ondblclick = ondblclick; 170 } 171 172 public String getOndblclick() 173 { 174 if (_ondblclick != null) return _ondblclick; 175 ValueBinding vb = getValueBinding("ondblclick"); 176 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 177 } 178 179 public void setOnfocus(String onfocus) 180 { 181 _onfocus = onfocus; 182 } 183 184 public String getOnfocus() 185 { 186 if (_onfocus != null) return _onfocus; 187 ValueBinding vb = getValueBinding("onfocus"); 188 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 189 } 190 191 public void setOnkeydown(String onkeydown) 192 { 193 _onkeydown = onkeydown; 194 } 195 196 public String getOnkeydown() 197 { 198 if (_onkeydown != null) return _onkeydown; 199 ValueBinding vb = getValueBinding("onkeydown"); 200 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 201 } 202 203 public void setOnkeypress(String onkeypress) 204 { 205 _onkeypress = onkeypress; 206 } 207 208 public String getOnkeypress() 209 { 210 if (_onkeypress != null) return _onkeypress; 211 ValueBinding vb = getValueBinding("onkeypress"); 212 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 213 } 214 215 public void setOnkeyup(String onkeyup) 216 { 217 _onkeyup = onkeyup; 218 } 219 220 public String getOnkeyup() 221 { 222 if (_onkeyup != null) return _onkeyup; 223 ValueBinding vb = getValueBinding("onkeyup"); 224 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 225 } 226 227 public void setOnmousedown(String onmousedown) 228 { 229 _onmousedown = onmousedown; 230 } 231 232 public String getOnmousedown() 233 { 234 if (_onmousedown != null) return _onmousedown; 235 ValueBinding vb = getValueBinding("onmousedown"); 236 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 237 } 238 239 public void setOnmousemove(String onmousemove) 240 { 241 _onmousemove = onmousemove; 242 } 243 244 public String getOnmousemove() 245 { 246 if (_onmousemove != null) return _onmousemove; 247 ValueBinding vb = getValueBinding("onmousemove"); 248 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 249 } 250 251 public void setOnmouseout(String onmouseout) 252 { 253 _onmouseout = onmouseout; 254 } 255 256 public String getOnmouseout() 257 { 258 if (_onmouseout != null) return _onmouseout; 259 ValueBinding vb = getValueBinding("onmouseout"); 260 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 261 } 262 263 public void setOnmouseover(String onmouseover) 264 { 265 _onmouseover = onmouseover; 266 } 267 268 public String getOnmouseover() 269 { 270 if (_onmouseover != null) return _onmouseover; 271 ValueBinding vb = getValueBinding("onmouseover"); 272 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 273 } 274 275 public void setOnmouseup(String onmouseup) 276 { 277 _onmouseup = onmouseup; 278 } 279 280 public String getOnmouseup() 281 { 282 if (_onmouseup != null) return _onmouseup; 283 ValueBinding vb = getValueBinding("onmouseup"); 284 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 285 } 286 287 public void setOnselect(String onselect) 288 { 289 _onselect = onselect; 290 } 291 292 public String getOnselect() 293 { 294 if (_onselect != null) return _onselect; 295 ValueBinding vb = getValueBinding("onselect"); 296 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 297 } 298 299 public void setReadonly(boolean readonly) 300 { 301 _readonly = Boolean.valueOf(readonly); 302 } 303 304 public boolean isReadonly() 305 { 306 if (_readonly != null) return _readonly.booleanValue(); 307 ValueBinding vb = getValueBinding("readonly"); 308 Boolean v = vb != null ? (Boolean )vb.getValue(getFacesContext()) : null; 309 return v != null ? v.booleanValue() : DEFAULT_READONLY; 310 } 311 312 public void setRows(int rows) 313 { 314 _rows = new Integer (rows); 315 } 316 317 public int getRows() 318 { 319 if (_rows != null) return _rows.intValue(); 320 ValueBinding vb = getValueBinding("rows"); 321 Integer v = vb != null ? (Integer )vb.getValue(getFacesContext()) : null; 322 return v != null ? v.intValue() : DEFAULT_ROWS; 323 } 324 325 public void setStyle(String style) 326 { 327 _style = style; 328 } 329 330 public String getStyle() 331 { 332 if (_style != null) return _style; 333 ValueBinding vb = getValueBinding("style"); 334 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 335 } 336 337 public void setStyleClass(String styleClass) 338 { 339 _styleClass = styleClass; 340 } 341 342 public String getStyleClass() 343 { 344 if (_styleClass != null) return _styleClass; 345 ValueBinding vb = getValueBinding("styleClass"); 346 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 347 } 348 349 public void setTabindex(String tabindex) 350 { 351 _tabindex = tabindex; 352 } 353 354 public String getTabindex() 355 { 356 if (_tabindex != null) return _tabindex; 357 ValueBinding vb = getValueBinding("tabindex"); 358 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 359 } 360 361 public void setTitle(String title) 362 { 363 _title = title; 364 } 365 366 public String getTitle() 367 { 368 if (_title != null) return _title; 369 ValueBinding vb = getValueBinding("title"); 370 return vb != null ? (String )vb.getValue(getFacesContext()) : null; 371 } 372 373 374 public Object saveState(FacesContext context) 375 { 376 Object values[] = new Object [26]; 377 values[0] = super.saveState(context); 378 values[1] = _accesskey; 379 values[2] = _cols; 380 values[3] = _dir; 381 values[4] = _disabled; 382 values[5] = _lang; 383 values[6] = _onblur; 384 values[7] = _onchange; 385 values[8] = _onclick; 386 values[9] = _ondblclick; 387 values[10] = _onfocus; 388 values[11] = _onkeydown; 389 values[12] = _onkeypress; 390 values[13] = _onkeyup; 391 values[14] = _onmousedown; 392 values[15] = _onmousemove; 393 values[16] = _onmouseout; 394 values[17] = _onmouseover; 395 values[18] = _onmouseup; 396 values[19] = _onselect; 397 values[20] = _readonly; 398 values[21] = _rows; 399 values[22] = _style; 400 values[23] = _styleClass; 401 values[24] = _tabindex; 402 values[25] = _title; 403 return ((Object ) (values)); 404 } 405 406 public void restoreState(FacesContext context, Object state) 407 { 408 Object values[] = (Object [])state; 409 super.restoreState(context, values[0]); 410 _accesskey = (String )values[1]; 411 _cols = (Integer )values[2]; 412 _dir = (String )values[3]; 413 _disabled = (Boolean )values[4]; 414 _lang = (String )values[5]; 415 _onblur = (String )values[6]; 416 _onchange = (String )values[7]; 417 _onclick = (String )values[8]; 418 _ondblclick = (String )values[9]; 419 _onfocus = (String )values[10]; 420 _onkeydown = (String )values[11]; 421 _onkeypress = (String )values[12]; 422 _onkeyup = (String )values[13]; 423 _onmousedown = (String )values[14]; 424 _onmousemove = (String )values[15]; 425 _onmouseout = (String )values[16]; 426 _onmouseover = (String )values[17]; 427 _onmouseup = (String )values[18]; 428 _onselect = (String )values[19]; 429 _readonly = (Boolean )values[20]; 430 _rows = (Integer )values[21]; 431 _style = (String )values[22]; 432 _styleClass = (String )values[23]; 433 _tabindex = (String )values[24]; 434 _title = (String )values[25]; 435 } 436 } 438 | Popular Tags |