Coverage Report - javax.faces.component.html.HtmlForm
 
Classes in this File Line Coverage Branch Coverage Complexity
HtmlForm
100%
178/178
100%
44/44
1.933
 
 1  
 /*
 2  
  * Copyright 2004-2011 the Seasar Foundation and the Others.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *     http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 13  
  * either express or implied. See the License for the specific language
 14  
  * governing permissions and limitations under the License.
 15  
  */
 16  
 package javax.faces.component.html;
 17  
 
 18  
 import javax.faces.component.ComponentUtil_;
 19  
 import javax.faces.component.UIForm;
 20  
 import javax.faces.context.FacesContext;
 21  
 
 22  
 import org.seasar.teeda.core.JsfConstants;
 23  
 
 24  
 /**
 25  
  * @author shot
 26  
  */
 27  
 public class HtmlForm extends UIForm {
 28  
 
 29  
     public static final String COMPONENT_TYPE = "javax.faces.HtmlForm";
 30  
 
 31  
     private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Form";
 32  
 
 33  
     private static final String DEFAULT_ENCTYPE = "application/x-www-form-urlencoded";
 34  
 
 35  166
     private String accept = null;
 36  
 
 37  166
     private String acceptcharset = null;
 38  
 
 39  166
     private String dir = null;
 40  
 
 41  166
     private String enctype = null;
 42  
 
 43  166
     private String lang = null;
 44  
 
 45  166
     private String onclick = null;
 46  
 
 47  166
     private String ondblclick = null;
 48  
 
 49  166
     private String onkeydown = null;
 50  
 
 51  166
     private String onkeypress = null;
 52  
 
 53  166
     private String onkeyup = null;
 54  
 
 55  166
     private String onmousedown = null;
 56  
 
 57  166
     private String onmousemove = null;
 58  
 
 59  166
     private String onmouseout = null;
 60  
 
 61  166
     private String onmouseover = null;
 62  
 
 63  166
     private String onmouseup = null;
 64  
 
 65  166
     private String onreset = null;
 66  
 
 67  166
     private String onsubmit = null;
 68  
 
 69  166
     private String style = null;
 70  
 
 71  166
     private String styleClass = null;
 72  
 
 73  166
     private String target = null;
 74  
 
 75  166
     private String title = null;
 76  
 
 77  166
     public HtmlForm() {
 78  166
         setRendererType(DEFAULT_RENDERER_TYPE);
 79  166
     }
 80  
 
 81  
     public void setAccept(String accept) {
 82  4
         this.accept = accept;
 83  4
     }
 84  
 
 85  
     public String getAccept() {
 86  15
         if (accept != null) {
 87  3
             return accept;
 88  
         }
 89  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 90  
                 JsfConstants.ACCEPT_ATTR);
 91  
     }
 92  
 
 93  
     public void setAcceptcharset(String acceptcharset) {
 94  4
         this.acceptcharset = acceptcharset;
 95  4
     }
 96  
 
 97  
     public String getAcceptcharset() {
 98  15
         if (acceptcharset != null) {
 99  3
             return acceptcharset;
 100  
         }
 101  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 102  
                 JsfConstants.ACCEPTCHARSET_ATTR);
 103  
     }
 104  
 
 105  
     public void setDir(String dir) {
 106  3
         this.dir = dir;
 107  3
     }
 108  
 
 109  
     public String getDir() {
 110  15
         if (dir != null) {
 111  3
             return dir;
 112  
         }
 113  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 114  
                 JsfConstants.DIR_ATTR);
 115  
     }
 116  
 
 117  
     public void setEnctype(String enctype) {
 118  32
         this.enctype = enctype;
 119  32
     }
 120  
 
 121  
     public String getEnctype() {
 122  17
         if (enctype != null) {
 123  3
             return enctype;
 124  
         }
 125  14
         String s = ComponentUtil_.getValueBindingValueAsString(this,
 126  
                 JsfConstants.ENCTYPE_ATTR);
 127  14
         return (s != null) ? s : DEFAULT_ENCTYPE;
 128  
     }
 129  
 
 130  
     public void setLang(String lang) {
 131  3
         this.lang = lang;
 132  3
     }
 133  
 
 134  
     public String getLang() {
 135  15
         if (lang != null) {
 136  3
             return lang;
 137  
         }
 138  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 139  
                 JsfConstants.LANG_ATTR);
 140  
     }
 141  
 
 142  
     public void setOnclick(String onclick) {
 143  3
         this.onclick = onclick;
 144  3
     }
 145  
 
 146  
     public String getOnclick() {
 147  15
         if (onclick != null) {
 148  3
             return onclick;
 149  
         }
 150  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 151  
                 JsfConstants.ONCLICK_ATTR);
 152  
     }
 153  
 
 154  
     public void setOndblclick(String ondblclick) {
 155  3
         this.ondblclick = ondblclick;
 156  3
     }
 157  
 
 158  
     public String getOndblclick() {
 159  15
         if (ondblclick != null) {
 160  3
             return ondblclick;
 161  
         }
 162  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 163  
                 JsfConstants.ONDBLCLICK_ATTR);
 164  
     }
 165  
 
 166  
     public void setOnkeydown(String onkeydown) {
 167  3
         this.onkeydown = onkeydown;
 168  3
     }
 169  
 
 170  
     public String getOnkeydown() {
 171  15
         if (onkeydown != null) {
 172  3
             return onkeydown;
 173  
         }
 174  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 175  
                 JsfConstants.ONKEYDOWN_ATTR);
 176  
     }
 177  
 
 178  
     public void setOnkeypress(String onkeypress) {
 179  3
         this.onkeypress = onkeypress;
 180  3
     }
 181  
 
 182  
     public String getOnkeypress() {
 183  15
         if (onkeypress != null) {
 184  3
             return onkeypress;
 185  
         }
 186  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 187  
                 JsfConstants.ONKEYPRESS_ATTR);
 188  
     }
 189  
 
 190  
     public void setOnkeyup(String onkeyup) {
 191  3
         this.onkeyup = onkeyup;
 192  3
     }
 193  
 
 194  
     public String getOnkeyup() {
 195  15
         if (onkeyup != null) {
 196  3
             return onkeyup;
 197  
         }
 198  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 199  
                 JsfConstants.ONKEYUP_ATTR);
 200  
     }
 201  
 
 202  
     public void setOnmousedown(String onmousedown) {
 203  3
         this.onmousedown = onmousedown;
 204  3
     }
 205  
 
 206  
     public String getOnmousedown() {
 207  15
         if (onmousedown != null) {
 208  3
             return onmousedown;
 209  
         }
 210  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 211  
                 JsfConstants.ONMOUSEDOWN_ATTR);
 212  
     }
 213  
 
 214  
     public void setOnmousemove(String onmousemove) {
 215  3
         this.onmousemove = onmousemove;
 216  3
     }
 217  
 
 218  
     public String getOnmousemove() {
 219  15
         if (onmousemove != null) {
 220  3
             return onmousemove;
 221  
         }
 222  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 223  
                 JsfConstants.ONMOUSEMOVE_ATTR);
 224  
     }
 225  
 
 226  
     public void setOnmouseout(String onmouseout) {
 227  3
         this.onmouseout = onmouseout;
 228  3
     }
 229  
 
 230  
     public String getOnmouseout() {
 231  15
         if (onmouseout != null) {
 232  3
             return onmouseout;
 233  
         }
 234  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 235  
                 JsfConstants.ONMOUSEOUT_ATTR);
 236  
     }
 237  
 
 238  
     public void setOnmouseover(String onmouseover) {
 239  3
         this.onmouseover = onmouseover;
 240  3
     }
 241  
 
 242  
     public String getOnmouseover() {
 243  15
         if (onmouseover != null) {
 244  3
             return onmouseover;
 245  
         }
 246  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 247  
                 JsfConstants.ONMOUSEOVER_ATTR);
 248  
     }
 249  
 
 250  
     public void setOnmouseup(String onmouseup) {
 251  3
         this.onmouseup = onmouseup;
 252  3
     }
 253  
 
 254  
     public String getOnmouseup() {
 255  15
         if (onmouseup != null) {
 256  3
             return onmouseup;
 257  
         }
 258  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 259  
                 JsfConstants.ONMOUSEUP_ATTR);
 260  
     }
 261  
 
 262  
     public void setOnreset(String onreset) {
 263  4
         this.onreset = onreset;
 264  4
     }
 265  
 
 266  
     public String getOnreset() {
 267  15
         if (onreset != null) {
 268  3
             return onreset;
 269  
         }
 270  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 271  
                 JsfConstants.ONRESET_ATTR);
 272  
     }
 273  
 
 274  
     public void setOnsubmit(String onsubmit) {
 275  4
         this.onsubmit = onsubmit;
 276  4
     }
 277  
 
 278  
     public String getOnsubmit() {
 279  15
         if (onsubmit != null) {
 280  3
             return onsubmit;
 281  
         }
 282  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 283  
                 JsfConstants.ONSUBMIT_ATTR);
 284  
     }
 285  
 
 286  
     public void setStyle(String style) {
 287  3
         this.style = style;
 288  3
     }
 289  
 
 290  
     public String getStyle() {
 291  15
         if (style != null) {
 292  3
             return style;
 293  
         }
 294  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 295  
                 JsfConstants.STYLE_ATTR);
 296  
     }
 297  
 
 298  
     public void setStyleClass(String styleClass) {
 299  3
         this.styleClass = styleClass;
 300  3
     }
 301  
 
 302  
     public String getStyleClass() {
 303  15
         if (styleClass != null) {
 304  3
             return styleClass;
 305  
         }
 306  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 307  
                 JsfConstants.STYLE_CLASS_ATTR);
 308  
     }
 309  
 
 310  
     public void setTarget(String target) {
 311  5
         this.target = target;
 312  5
     }
 313  
 
 314  
     public String getTarget() {
 315  30
         if (target != null) {
 316  6
             return target;
 317  
         }
 318  24
         return ComponentUtil_.getValueBindingValueAsString(this,
 319  
                 JsfConstants.TARGET_ATTR);
 320  
     }
 321  
 
 322  
     public void setTitle(String title) {
 323  3
         this.title = title;
 324  3
     }
 325  
 
 326  
     public String getTitle() {
 327  15
         if (title != null) {
 328  3
             return title;
 329  
         }
 330  12
         return ComponentUtil_.getValueBindingValueAsString(this,
 331  
                 JsfConstants.TITLE_ATTR);
 332  
     }
 333  
 
 334  
     public Object saveState(FacesContext context) {
 335  3
         Object values[] = new Object[22];
 336  3
         values[0] = super.saveState(context);
 337  3
         values[1] = accept;
 338  3
         values[2] = acceptcharset;
 339  3
         values[3] = dir;
 340  3
         values[4] = enctype;
 341  3
         values[5] = lang;
 342  3
         values[6] = onclick;
 343  3
         values[7] = ondblclick;
 344  3
         values[8] = onkeydown;
 345  3
         values[9] = onkeypress;
 346  3
         values[10] = onkeyup;
 347  3
         values[11] = onmousedown;
 348  3
         values[12] = onmousemove;
 349  3
         values[13] = onmouseout;
 350  3
         values[14] = onmouseover;
 351  3
         values[15] = onmouseup;
 352  3
         values[16] = onreset;
 353  3
         values[17] = onsubmit;
 354  3
         values[18] = style;
 355  3
         values[19] = styleClass;
 356  3
         values[20] = target;
 357  3
         values[21] = title;
 358  3
         return ((Object) (values));
 359  
     }
 360  
 
 361  
     public void restoreState(FacesContext context, Object state) {
 362  2
         Object values[] = (Object[]) state;
 363  2
         super.restoreState(context, values[0]);
 364  2
         accept = (String) values[1];
 365  2
         acceptcharset = (String) values[2];
 366  2
         dir = (String) values[3];
 367  2
         enctype = (String) values[4];
 368  2
         lang = (String) values[5];
 369  2
         onclick = (String) values[6];
 370  2
         ondblclick = (String) values[7];
 371  2
         onkeydown = (String) values[8];
 372  2
         onkeypress = (String) values[9];
 373  2
         onkeyup = (String) values[10];
 374  2
         onmousedown = (String) values[11];
 375  2
         onmousemove = (String) values[12];
 376  2
         onmouseout = (String) values[13];
 377  2
         onmouseover = (String) values[14];
 378  2
         onmouseup = (String) values[15];
 379  2
         onreset = (String) values[16];
 380  2
         onsubmit = (String) values[17];
 381  2
         style = (String) values[18];
 382  2
         styleClass = (String) values[19];
 383  2
         target = (String) values[20];
 384  2
         title = (String) values[21];
 385  2
     }
 386  
 
 387  
 }