1 5 package fr.improve.struts.taglib.layout.collection.header; 6 7 import javax.servlet.jsp.JspException ; 8 9 import fr.improve.struts.taglib.layout.LayoutTagSupport; 10 import fr.improve.struts.taglib.layout.collection.BaseCollectionTag; 11 12 16 public class CollectionTitleTag extends LayoutTagSupport implements MultiLevelTitleHandler { 17 protected String title; 18 protected String tooltip; 19 protected String arg0; 20 protected String arg1; 21 protected String styleClass; 22 23 protected MultiLevelHeader header; 24 protected BaseCollectionTag collectionTag; 25 26 public int doStartLayoutTag() { 27 collectionTag = 28 (BaseCollectionTag) findAncestorWithClass(this, BaseCollectionTag.class); 29 if (collectionTag.isFirst()) { 30 header = new MultiLevelHeader(title, arg0, arg1, styleClass, false); 31 header.setTooltip(tooltip); 32 } 33 return EVAL_BODY_INCLUDE; 34 } 35 36 public int doEndLayoutTag() throws JspException { 37 if (collectionTag.isFirst()) { 38 new CollectionItemEvent(this, header).send(); 39 } 40 return EVAL_PAGE; 41 } 42 43 public Object addCollectionTitle(CollectionItemEvent in_event) { 44 header.addHeader((MultiLevelHeader) in_event.getValue()); 45 return null; 46 } 47 48 49 public void release() { 50 title= null; 51 tooltip = null; 52 arg0 = null; 53 arg1 = null; 54 styleClass = null; 55 } 56 57 public void setArg0(String in_arg0) { 58 this.arg0 = in_arg0; 59 } 60 public void setArg1(String in_arg1) { 61 this.arg1 = in_arg1; 62 } 63 public void setTitle(String in_title) { 64 this.title = in_title; 65 } 66 public void setStyleClass(String in_styleClass) { 67 this.styleClass = in_styleClass; 68 } 69 public void setTooltip(String tooltip) { 70 this.tooltip = tooltip; 71 } 72 } 73 | Popular Tags |