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