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