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