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