1 33 34 package com.icesoft.faces.component.panelseries; 35 36 import com.icesoft.faces.component.CSS_DEFAULT; 37 import com.icesoft.faces.component.ext.taglib.Util; 38 39 import javax.faces.component.UIComponent; 40 import javax.faces.component.UIData; 41 import javax.faces.context.FacesContext; 42 import javax.faces.el.ValueBinding; 43 44 59 public class PanelSeries extends UISeries { 60 public static final String COMPONENT_TYPE = "com.icesoft.faces.PanelSeries"; 61 public static final String RENDERER_TYPE = "com.icesoft.faces.PanelSeriesRenderer"; 62 public static final String COMPONENT_FAMILY = "javax.faces.Panel"; 63 private String style = null; 64 private String styleClass = null; 65 66 67 public PanelSeries() { 68 super(); 69 setRendererType(RENDERER_TYPE); 70 } 71 75 public String getFamily() { 76 return (COMPONENT_FAMILY); 77 } 78 79 83 public boolean isRendered() { 84 if (!Util.isRenderedOnUserRole(this)) { 85 return false; 86 } 87 return super.isRendered(); 88 } 89 90 91 96 public String getStyleClass() { 97 return Util.getQualifiedStyleClass(this, 98 styleClass, 99 CSS_DEFAULT.PANEL_SERIES_DEFAULT_CLASS, 100 "styleClass"); 101 } 102 103 106 public void setStyleClass(String styleClass) { 107 this.styleClass = styleClass; 108 } 109 110 115 public String getStyle() { 116 if (style != null) { 117 return style; 118 } 119 ValueBinding vb = getValueBinding("style"); 120 return vb != null ? (String ) vb.getValue(getFacesContext()) : null; 121 } 122 123 126 public void setStyle(String style) { 127 this.style = style; 128 } 129 130 134 protected void restoreChild(FacesContext facesContext, 135 UIComponent uiComponent) { 136 super.restoreChild(facesContext, uiComponent); 137 if (uiComponent instanceof UIData) { 138 String clientId = uiComponent.getClientId(facesContext); 139 Object value = savedChildren.get(clientId); 140 ((UIData) uiComponent).setValue(value); 141 } 142 } 143 144 148 protected void saveChild(FacesContext facesContext, 149 UIComponent uiComponent) { 150 super.saveChild(facesContext, uiComponent); 151 if (uiComponent instanceof UIData) { 152 String clientId = uiComponent.getClientId(facesContext); 153 savedChildren.put(clientId, ((UIData) uiComponent).getValue()); 154 } 155 } 156 } 157 | Popular Tags |