1 21 package net.mlw.vlh.web.tag; 22 23 import java.util.ArrayList ; 24 import java.util.Collection ; 25 26 import javax.servlet.jsp.JspException ; 27 28 import net.mlw.vlh.ValueListInfo; 29 import net.mlw.vlh.web.util.JspUtils; 30 31 37 public abstract class DefaultColumnsTag extends ConfigurableTag 38 { 39 40 42 protected Integer defaultSort; 43 44 45 protected Collection include = new ArrayList (); 46 47 48 protected Collection exclude = new ArrayList (); 49 50 56 public void setSortable(String value) 57 { 58 if ("asc".equals(value)) 59 { 60 defaultSort = ValueListInfo.ASCENDING; 61 } 62 else if ("desc".equals(value)) 63 { 64 defaultSort = ValueListInfo.DESCENDING; 65 } 66 } 67 68 74 public void setInclude(String included) 75 { 76 include = JspUtils.toCollection(included, "|"); 77 } 78 79 85 public void setExclude(String excluded) 86 { 87 exclude = JspUtils.toCollection(excluded, "|"); 88 } 89 90 93 public int doEndTag() throws JspException 94 { 95 int result = super.doEndTag(); 96 reset(); 97 return result; 98 } 99 100 private void reset() 101 { 102 this.defaultSort = null; 103 this.exclude.clear(); 104 this.include.clear(); 105 } 106 107 115 public void release() 116 { 117 super.release(); 118 reset(); 119 } 120 } | Popular Tags |