1 package fr.improve.struts.taglib.layout; 2 3 import javax.servlet.jsp.JspException ; 4 5 import fr.improve.struts.taglib.layout.event.ComputeLayoutSpanEvent; 6 import fr.improve.struts.taglib.layout.event.EndLayoutEvent; 7 import fr.improve.struts.taglib.layout.event.LayoutEventListener; 8 import fr.improve.struts.taglib.layout.event.StartLayoutEvent; 9 10 16 public class CellTag extends LayoutTagSupport implements LayoutEventListener { 17 protected String styleClass; 18 protected String width; 19 protected String height; 20 protected int colspan = 1; 21 private String align; 22 23 public int doStartLayoutTag() throws JspException { 24 int lc_colspan = ((Integer )new ComputeLayoutSpanEvent(this, colspan).send()).intValue(); 26 27 StringBuffer lc_buffer = new StringBuffer ("<td colspan=\""); 29 lc_buffer.append(lc_colspan); 30 if (styleClass!=null) { 31 lc_buffer.append("\" class=\""); 32 lc_buffer.append(styleClass); 33 } 34 if (width!=null){ 35 lc_buffer.append("\" width=\""); 36 lc_buffer.append(width); 37 } 38 if (height!=null){ 39 lc_buffer.append("\" height=\""); 40 lc_buffer.append(height); 41 } 42 if (align!=null) { 43 lc_buffer.append("\" align=\""); 44 lc_buffer.append(align); 45 } 46 lc_buffer.append("\">"); 47 48 new StartLayoutEvent(this, lc_buffer.toString()).send(); 49 return EVAL_BODY_INCLUDE; 50 } 51 52 public int doEndLayoutTag() throws JspException { 53 new EndLayoutEvent(this, "</td>").send(); 54 return EVAL_PAGE; 55 } 56 57 public void release() { 58 styleClass = null; 59 width = null; 60 height = null; 61 colspan = 1; 62 align = null; 63 } 64 65 public void setStyleClass(String in_styleClass) { 66 styleClass = in_styleClass; 67 } 68 69 public String getHeight() { 70 return height; 71 } 72 public void setHeight(String height) { 73 this.height = height; 74 } 75 public String getWidth() { 76 return width; 77 } 78 public void setWidth(String width) { 79 this.width = width; 80 } 81 public String getStyleClass() { 82 return styleClass; 83 } 84 public int getColspan() { 85 return colspan; 86 } 87 public void setColspan(int colspan) { 88 this.colspan = colspan; 89 } 90 93 public Object processEndLayoutEvent(EndLayoutEvent in_event) throws JspException { 94 return Boolean.FALSE; 95 } 96 97 100 public Object processStartLayoutEvent(StartLayoutEvent in_event) throws JspException { 101 return Boolean.FALSE; 102 } 103 104 public String getAlign() { 105 return align; 106 } 107 108 public void setAlign(String align) { 109 this.align = align; 110 } 111 } 112 | Popular Tags |