Coverage Report - javax.faces.component.html.HtmlPanelGroup
 
Classes in this File Line Coverage Branch Coverage Complexity
HtmlPanelGroup
100%
27/27
100%
8/8
1.571
 
 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 HtmlPanelGroup extends UIPanel {
 27  
 
 28  
     public static final String COMPONENT_TYPE = "javax.faces.HtmlPanelGroup";
 29  
 
 30  
     private static final String DEFAULT_RENDERER_TYPE = "javax.faces.Group";
 31  
 
 32  108
     private String style = null;
 33  
 
 34  108
     private String styleClass = null;
 35  
 
 36  108
     public HtmlPanelGroup() {
 37  108
         setRendererType(DEFAULT_RENDERER_TYPE);
 38  108
     }
 39  
 
 40  
     public void setStyle(String style) {
 41  4
         this.style = style;
 42  4
     }
 43  
 
 44  
     public String getStyle() {
 45  45
         if (style != null) {
 46  6
             return style;
 47  
         }
 48  39
         ValueBinding vb = getValueBinding("style");
 49  39
         return vb != null ? (String) vb.getValue(getFacesContext()) : null;
 50  
     }
 51  
 
 52  
     public void setStyleClass(String styleClass) {
 53  4
         this.styleClass = styleClass;
 54  4
     }
 55  
 
 56  
     public String getStyleClass() {
 57  49
         if (styleClass != null) {
 58  8
             return styleClass;
 59  
         }
 60  41
         ValueBinding vb = getValueBinding("styleClass");
 61  41
         return vb != null ? (String) vb.getValue(getFacesContext()) : null;
 62  
     }
 63  
 
 64  
     public Object saveState(FacesContext context) {
 65  3
         Object values[] = new Object[3];
 66  3
         values[0] = super.saveState(context);
 67  3
         values[1] = style;
 68  3
         values[2] = styleClass;
 69  3
         return ((Object) (values));
 70  
     }
 71  
 
 72  
     public void restoreState(FacesContext context, Object state) {
 73  2
         Object values[] = (Object[]) state;
 74  2
         super.restoreState(context, values[0]);
 75  2
         style = (String) values[1];
 76  2
         styleClass = (String) values[2];
 77  2
     }
 78  
 }