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