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