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