1 17 package org.alfresco.web.ui.common.tag; 18 19 import javax.faces.FacesException; 20 import javax.faces.component.UICommand; 21 import javax.faces.component.UIComponent; 22 import javax.faces.el.MethodBinding; 23 import javax.servlet.jsp.JspException ; 24 25 import org.alfresco.web.ui.common.component.UIPanel; 26 27 30 public class PanelTag extends HtmlComponentTag 31 { 32 35 public String getComponentType() 36 { 37 return "org.alfresco.faces.Panel"; 38 } 39 40 43 public String getRendererType() 44 { 45 return null; 47 } 48 49 52 protected void setProperties(UIComponent component) 53 { 54 super.setProperties(component); 55 56 setStringProperty(component, "label", this.label); 57 setStringProperty(component, "border", this.border); 58 setBooleanProperty(component, "progressive", this.progressive); 59 setStringProperty(component, "bgcolor", this.bgcolor); 60 setStringProperty(component, "titleBorder", this.titleBorder); 61 setStringProperty(component, "titleBgcolor", this.titleBgcolor); 62 setBooleanProperty(component, "expanded", this.expanded); 63 setStringProperty(component, "facetsId", this.facetsId); 64 if (expandedActionListener != null) 65 { 66 if (isValueReference(expandedActionListener)) 67 { 68 MethodBinding vb = getFacesContext().getApplication().createMethodBinding(expandedActionListener, ACTION_CLASS_ARGS); 69 ((UIPanel)component).setExpandedActionListener(vb); 70 } 71 else 72 { 73 throw new FacesException("Expanded Action listener method binding incorrectly specified: " + expandedActionListener); 74 } 75 } 76 } 77 78 81 public void release() 82 { 83 super.release(); 84 this.label = null; 85 this.border = null; 86 this.progressive = null; 87 this.bgcolor = null; 88 this.expanded = null; 89 this.expandedActionListener = null; 90 this.facetsId = null; 91 } 92 93 104 protected int getDoStartValue() throws JspException 105 { 106 UIComponent component = getComponentInstance(); 107 if (component instanceof UIPanel) 108 { 109 if (((UIPanel)component).isExpanded() == true && component.isRendered() == true) 110 { 111 return EVAL_BODY_INCLUDE; 112 } 113 else 114 { 115 return SKIP_BODY; 116 } 117 } 118 return EVAL_BODY_INCLUDE; 119 } 120 121 126 public void setBorder(String border) 127 { 128 this.border = border; 129 } 130 131 136 public void setProgressive(String progressive) 137 { 138 this.progressive = progressive; 139 } 140 141 146 public void setLabel(String label) 147 { 148 this.label = label; 149 } 150 151 156 public void setBgcolor(String bgcolor) 157 { 158 this.bgcolor = bgcolor; 159 } 160 161 164 public void setTitleBgcolor(String titleBgcolor) 165 { 166 this.titleBgcolor = titleBgcolor; 167 } 168 169 172 public void setTitleBorder(String titleBorder) 173 { 174 this.titleBorder = titleBorder; 175 } 176 177 182 public void setExpanded(String expanded) 183 { 184 this.expanded = expanded; 185 } 186 187 192 public void setExpandedActionListener(String expandedActionListener) 193 { 194 this.expandedActionListener = expandedActionListener; 195 } 196 197 202 public void setFacetsId(String facetsId) 203 { 204 this.facetsId = facetsId; 205 } 206 207 208 209 private String facetsId; 210 211 212 private String expandedActionListener; 213 214 215 private String expanded; 216 217 218 private String border; 219 220 221 private String progressive; 222 223 224 private String label; 225 226 227 private String bgcolor; 228 229 230 private String titleBorder; 231 232 233 private String titleBgcolor; 234 } 235 | Popular Tags |