1 package fr.improve.struts.taglib.layout.event; 2 3 import javax.servlet.jsp.JspException ; 4 5 import fr.improve.struts.taglib.layout.LayoutTag; 6 import fr.improve.struts.taglib.layout.util.LayoutUtils; 7 import fr.improve.struts.taglib.layout.util.ParentFinder; 8 9 10 16 public class ComputeLayoutSpanEvent extends AbstractLayoutEvent { 17 private int col; 18 19 public ComputeLayoutSpanEvent(LayoutTag in_tag, int in_colspan) { 20 super(in_tag, null); 21 col = in_colspan; 22 } 23 27 public Object send() throws JspException { 28 return sendToParent(source); 29 } 30 31 public Object sendToParent(LayoutTag in_tag) throws JspException { 32 ComputeLayoutSpanEventListener lc_listener = (ComputeLayoutSpanEventListener) ParentFinder.findLayoutTag(in_tag, ComputeLayoutSpanEventListener.class); 33 34 if (lc_listener!=null) { 35 return lc_listener.computeColspan(this); 36 } else { 37 return consume(in_tag); 38 } 39 } 40 41 public int getColspan() { 42 return col; 43 } 44 45 public Object consume(LayoutTag in_tag) throws JspException { 46 int lc_colspan = LayoutUtils.getSkin(in_tag.getPageContext().getSession()).getFieldInterface().getColumnNumber() * col; 47 return new Integer (lc_colspan); 48 } 49 } 50 | Popular Tags |