1 18 19 package org.apache.strutsel.taglib.html; 20 21 import org.apache.struts.taglib.html.OptionsTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 41 public class ELOptionsTag extends OptionsTag { 42 43 47 private String collectionExpr; 48 52 private String filterExpr; 53 57 private String labelNameExpr; 58 62 private String labelPropertyExpr; 63 67 private String nameExpr; 68 72 private String propertyExpr; 73 77 private String styleExpr; 78 82 private String styleClassExpr; 83 84 88 public String getCollectionExpr() { return (collectionExpr); } 89 93 public String getFilterExpr() { return (filterExpr); } 94 98 public String getLabelNameExpr() { return (labelNameExpr); } 99 103 public String getLabelPropertyExpr() { return (labelPropertyExpr); } 104 108 public String getNameExpr() { return (nameExpr); } 109 113 public String getPropertyExpr() { return (propertyExpr); } 114 118 public String getStyleExpr() { return (styleExpr); } 119 123 public String getStyleClassExpr() { return (styleClassExpr); } 124 125 129 public void setCollectionExpr(String collectionExpr) { this.collectionExpr = collectionExpr; } 130 134 public void setFilterExpr(String filterExpr) { this.filterExpr = filterExpr; } 135 139 public void setLabelNameExpr(String labelNameExpr) { this.labelNameExpr = labelNameExpr; } 140 144 public void setLabelPropertyExpr(String labelPropertyExpr) { this.labelPropertyExpr = labelPropertyExpr; } 145 149 public void setNameExpr(String nameExpr) { this.nameExpr = nameExpr; } 150 154 public void setPropertyExpr(String propertyExpr) { this.propertyExpr = propertyExpr; } 155 159 public void setStyleExpr(String styleExpr) { this.styleExpr = styleExpr; } 160 164 public void setStyleClassExpr(String styleClassExpr) { this.styleClassExpr = styleClassExpr; } 165 166 169 public void release() 170 { 171 super.release(); 172 setCollectionExpr(null); 173 setFilterExpr(null); 174 setLabelNameExpr(null); 175 setLabelPropertyExpr(null); 176 setNameExpr(null); 177 setPropertyExpr(null); 178 setStyleExpr(null); 179 setStyleClassExpr(null); 180 } 181 182 187 public int doStartTag() throws JspException { 188 evaluateExpressions(); 189 return(super.doStartTag()); 190 } 191 192 198 private void evaluateExpressions() throws JspException { 199 String string = null; 200 Boolean bool = null; 201 202 if ((string = EvalHelper.evalString("collection", getCollectionExpr(), 203 this, pageContext)) != null) 204 setCollection(string); 205 206 if ((bool = EvalHelper.evalBoolean("filter", getFilterExpr(), 207 this, pageContext)) != null) 208 setFilter(bool.booleanValue()); 209 210 if ((string = EvalHelper.evalString("labelName", getLabelNameExpr(), 211 this, pageContext)) != null) 212 setLabelName(string); 213 214 if ((string = EvalHelper.evalString("labelProperty", getLabelPropertyExpr(), 215 this, pageContext)) != null) 216 setLabelProperty(string); 217 218 if ((string = EvalHelper.evalString("name", getNameExpr(), 219 this, pageContext)) != null) 220 setName(string); 221 222 if ((string = EvalHelper.evalString("property", getPropertyExpr(), 223 this, pageContext)) != null) 224 setProperty(string); 225 226 if ((string = EvalHelper.evalString("style", getStyleExpr(), 227 this, pageContext)) != null) 228 setStyle(string); 229 230 if ((string = EvalHelper.evalString("styleClass", getStyleClassExpr(), 231 this, pageContext)) != null) 232 setStyleClass(string); 233 234 } 241 } 242 | Popular Tags |