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