1 18 19 package org.apache.strutsel.taglib.html; 20 21 import org.apache.struts.taglib.html.OptionTag; 22 import javax.servlet.jsp.JspException ; 23 import org.apache.strutsel.taglib.utils.EvalHelper; 24 25 38 public class ELOptionTag extends OptionTag { 39 40 44 private String bundleExpr; 45 49 private String disabledExpr; 50 54 private String keyExpr; 55 59 private String localeExpr; 60 64 private String styleExpr; 65 69 private String styleClassExpr; 70 74 private String styleIdExpr; 75 79 private String valueExpr; 80 81 85 public String getBundleExpr() { return (bundleExpr); } 86 90 public String getDisabledExpr() { return (disabledExpr); } 91 95 public String getKeyExpr() { return (keyExpr); } 96 100 public String getLocaleExpr() { return (localeExpr); } 101 105 public String getStyleExpr() { return (styleExpr); } 106 110 public String getStyleClassExpr() { return (styleClassExpr); } 111 115 public String getStyleIdExpr() { return (styleIdExpr); } 116 120 public String getValueExpr() { return (valueExpr); } 121 122 126 public void setBundleExpr(String bundleExpr) { this.bundleExpr = bundleExpr; } 127 131 public void setDisabledExpr(String disabledExpr) { this.disabledExpr = disabledExpr; } 132 136 public void setKeyExpr(String keyExpr) { this.keyExpr = keyExpr; } 137 141 public void setLocaleExpr(String localeExpr) { this.localeExpr = localeExpr; } 142 146 public void setStyleExpr(String styleExpr) { this.styleExpr = styleExpr; } 147 151 public void setStyleClassExpr(String styleClassExpr) { this.styleClassExpr = styleClassExpr; } 152 156 public void setStyleIdExpr(String styleIdExpr) { this.styleIdExpr = styleIdExpr; } 157 161 public void setValueExpr(String valueExpr) { this.valueExpr = valueExpr; } 162 163 166 public void release() 167 { 168 super.release(); 169 setBundleExpr(null); 170 setDisabledExpr(null); 171 setKeyExpr(null); 172 setLocaleExpr(null); 173 setStyleExpr(null); 174 setStyleClassExpr(null); 175 setStyleIdExpr(null); 176 setValueExpr(null); 177 } 178 179 184 public int doStartTag() throws JspException { 185 evaluateExpressions(); 186 return(super.doStartTag()); 187 } 188 189 195 private void evaluateExpressions() throws JspException { 196 String string = null; 197 Boolean bool = null; 198 199 if ((string = EvalHelper.evalString("bundle", getBundleExpr(), 200 this, pageContext)) != null) 201 setBundle(string); 202 203 if ((bool = EvalHelper.evalBoolean("disabled", getDisabledExpr(), 204 this, pageContext)) != null) 205 setDisabled(bool.booleanValue()); 206 207 if ((string = EvalHelper.evalString("key", getKeyExpr(), 208 this, pageContext)) != null) 209 setKey(string); 210 211 if ((string = EvalHelper.evalString("locale", getLocaleExpr(), 212 this, pageContext)) != null) 213 setLocale(string); 214 215 if ((string = EvalHelper.evalString("style", getStyleExpr(), 216 this, pageContext)) != null) 217 setStyle(string); 218 219 if ((string = EvalHelper.evalString("styleClass", getStyleClassExpr(), 220 this, pageContext)) != null) 221 setStyleClass(string); 222 223 if ((string = EvalHelper.evalString("styleId", getStyleIdExpr(), 224 this, pageContext)) != null) 225 setStyleId(string); 226 227 if ((string = EvalHelper.evalString("value", getValueExpr(), 228 this, pageContext)) != null) 229 setValue(string); 230 } 231 } 232
| Popular Tags
|