1 16 17 18 package org.apache.webapp.admin; 19 20 21 import java.io.IOException ; 22 import java.net.URLEncoder ; 23 import java.util.ArrayList ; 24 import javax.servlet.http.HttpServletResponse ; 25 import javax.servlet.jsp.JspException ; 26 import javax.servlet.jsp.JspWriter ; 27 import javax.servlet.jsp.PageContext ; 28 import javax.servlet.jsp.tagext.BodyTagSupport ; 29 import javax.servlet.jsp.tagext.Tag ; 30 31 32 50 51 public class RowTag extends BodyTagSupport { 52 53 56 protected boolean header = false; 57 58 public boolean getHeader() { 59 return (this.header); 60 } 61 62 public void setHeader(boolean header) { 63 this.header = header; 64 } 65 66 69 protected String label = null; 70 71 public void setLabel(String label) { 72 this.label = label; 73 } 74 75 76 79 protected String data = null; 80 81 public void setData(String data) { 82 this.data = data; 83 } 84 85 88 protected String labelStyle = null; 89 90 public String getLabelStyle() { 91 return (this.labelStyle); 92 } 93 94 public void setLabelStyle(String labelStyle) { 95 this.labelStyle = labelStyle; 96 } 97 98 99 102 protected String dataStyle = null; 103 104 public String getdataStyle() { 105 return (this.dataStyle); 106 } 107 108 public void setdataStyle(String dataStyle) { 109 this.dataStyle = dataStyle; 110 } 111 112 115 protected String styleId = null; 116 117 public String getStyleId() { 118 return (this.styleId); 119 } 120 121 public void setStyleId(String styleId) { 122 this.styleId = styleId; 123 } 124 125 126 128 129 134 public int doStartTag() throws JspException { 135 136 return (EVAL_BODY_TAG); 138 139 } 140 141 142 147 public int doAfterBody() throws JspException { 148 149 return (SKIP_BODY); 150 151 } 152 153 154 159 public int doEndTag() throws JspException { 160 161 Tag parent = getParent(); 163 while ((parent != null) && !(parent instanceof TableTag)) { 164 parent = parent.getParent(); 165 } 166 if (parent == null) { 167 throw new JspException ("Must be nested in a TableTag instance"); 168 } 169 TableTag table = (TableTag) parent; 170 171 HttpServletResponse response = 174 (HttpServletResponse ) pageContext.getResponse(); 175 table.addRow(header, label, data, labelStyle, dataStyle, styleId); 176 177 return (EVAL_PAGE); 178 179 } 180 181 182 185 public void release() { 186 187 189 this.header= false; 190 this.label = null; 191 this.data = null; 192 this.labelStyle = null; 193 this.dataStyle = null; 194 this.styleId = null; 195 196 } 197 198 199 } 200 | Popular Tags |