KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > collection > header > CollectionTitleTag


1 /*
2  * Copyrights Improve SA 2005
3  * All rights reserved
4  */

5 package fr.improve.struts.taglib.layout.collection.header;
6
7 import javax.servlet.jsp.JspException JavaDoc;
8
9 import fr.improve.struts.taglib.layout.LayoutTagSupport;
10 import fr.improve.struts.taglib.layout.collection.BaseCollectionTag;
11
12 /**
13  * Tag allowing to specify multiple level of collection headers.
14  * @author JN Ribette
15  */

16 public class CollectionTitleTag extends LayoutTagSupport implements MultiLevelTitleHandler {
17     protected String JavaDoc title;
18     protected String JavaDoc tooltip;
19     protected String JavaDoc arg0;
20     protected String JavaDoc arg1;
21     protected String JavaDoc 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 JavaDoc {
37         if (collectionTag.isFirst()) {
38             new CollectionItemEvent(this, header).send();
39         }
40         return EVAL_PAGE;
41     }
42     
43     public Object JavaDoc 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 JavaDoc in_arg0) {
58         this.arg0 = in_arg0;
59     }
60     public void setArg1(String JavaDoc in_arg1) {
61         this.arg1 = in_arg1;
62     }
63     public void setTitle(String JavaDoc in_title) {
64         this.title = in_title;
65     }
66     public void setStyleClass(String JavaDoc in_styleClass) {
67         this.styleClass = in_styleClass;
68     }
69     public void setTooltip(String JavaDoc tooltip) {
70         this.tooltip = tooltip;
71     }
72 }
73
Popular Tags