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