1 package albel.tags.table; 2 3 import albel.tags.table.controll.Manager; 4 import albel.tags.table.model.*; 5 import albel.tags.table.utils.HttpSessionAttributesMap; 6 import javax.servlet.http.HttpServletRequest ; 7 import javax.servlet.jsp.JspException ; 8 import javax.servlet.jsp.tagext.BodyTagSupport ; 9 10 11 15 public class ColumnHeaderTag extends BodyTagSupport 16 { 17 18 21 private String title; 22 23 26 private String align; 27 28 31 private String cssClass; 32 33 public ColumnHeaderTag() 34 { 35 super(); 36 } 37 38 46 47 55 public void otherDoStartTagOperations() 56 { 57 58 76 77 } 78 79 85 public boolean theBodyShouldBeEvaluated() 86 { 87 88 return true; 94 95 } 96 97 98 106 public void otherDoEndTagOperations() 107 { 108 109 117 118 } 119 120 127 public boolean shouldEvaluateRestOfPageAfterEndTag() 128 { 129 130 return true; 137 138 } 139 140 141 150 151 154 public int doStartTag() throws JspException 155 { 156 if(this.getParent() instanceof albel.tags.table.ColumnTag) 157 { 158 HttpServletRequest request=(HttpServletRequest )pageContext.getRequest(); 159 HttpSessionAttributesMap attrs=new HttpSessionAttributesMap(request.getSession()); 160 TableTag tableTag=(TableTag)this.getParent().getParent().getParent(); 161 ColumnTag colTag=(ColumnTag)this.getParent(); 162 Table table=Manager.getTable(attrs, tableTag.getId()); 163 Column col=table.getColumn(colTag.getProperty()); 164 if(col.getHeader()!=null) 165 { 166 ColumnHeader ch=new ColumnHeader(); 167 ch.setTitle(getTitle()); 168 ch.setAlign(getAlign()); 169 ch.setColumn(col); 170 ch.setCssClass(getCssClass()); 171 col.setHeader(ch); 172 } 173 } 174 return this.EVAL_BODY_INCLUDE; 175 } 176 177 180 public int doEndTag() throws JspException 181 { 182 return EVAL_PAGE; 184 } 185 186 190 public String getTitle() 191 { 192 return this.title; 193 } 194 195 199 public void setTitle(String title) 200 { 201 this.title = title; 202 } 203 204 208 public String getAlign() 209 { 210 return this.align; 211 } 212 213 217 public void setAlign(String align) 218 { 219 this.align = align; 220 } 221 222 226 public String getCssClass() 227 { 228 return this.cssClass; 229 } 230 231 235 public void setCssClass(String cssClass) 236 { 237 this.cssClass = cssClass; 238 } 239 240 } 241 | Popular Tags |