KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > improve > struts > taglib > layout > crumb > CrumbTag


1 package fr.improve.struts.taglib.layout.crumb;
2
3 import javax.servlet.jsp.JspException JavaDoc;
4 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
5
6 import fr.improve.struts.taglib.layout.util.TagUtils;
7
8 /**
9  * Render one crumb in a bread crumb panel.
10  * Creation date: (17/07/2001 13:05:46)
11  * @author: Jean-NoŽl Ribette
12  */

13 public class CrumbTag extends TagSupport JavaDoc {
14     /**
15      * the link
16      */

17     protected String JavaDoc link;
18
19     /**
20      * the key of the message to display
21      */

22     protected String JavaDoc key;
23
24     /**
25      * the target
26      */

27     protected String JavaDoc target;
28     
29     /**
30      * the bundle
31      */

32     protected String JavaDoc bundle;
33     
34     public int doStartTag() throws JspException JavaDoc {
35         CrumbImpl lc_crumb = new CrumbImpl();
36         lc_crumb.setTarget(target);
37         lc_crumb.setLink(link);
38         lc_crumb.setKey(key);
39         lc_crumb.setBundle(bundle);
40         
41         StringBuffer JavaDoc buffer = new StringBuffer JavaDoc();
42         CrumbsTag lc_tag = (CrumbsTag) findAncestorWithClass(this, CrumbsTag.class);
43         if (lc_tag==null) {
44             throw new JspException JavaDoc("Invalid use of <layout:crumb> tag");
45         }
46         lc_tag.printCrumb(buffer, lc_crumb);
47         TagUtils.write(pageContext, buffer.toString());
48         return SKIP_BODY;
49     }
50 /**
51  * Insert the method's description here.
52  * Creation date: (17/07/2001 15:08:21)
53  * @return java.lang.String
54  */

55 public java.lang.String JavaDoc getKey() {
56     return key;
57 }
58 /**
59  * Insert the method's description here.
60  * Creation date: (17/07/2001 15:08:21)
61  * @return java.lang.String
62  */

63 public java.lang.String JavaDoc getLink() {
64     return link;
65 }
66 /**
67  * Insert the method's description here.
68  * Creation date: (17/07/2001 15:25:47)
69  * @return java.lang.String
70  */

71 public java.lang.String JavaDoc getTarget() {
72     return target;
73 }
74     public void release() {
75         super.release();
76         
77         link = null;
78         key = null;
79         target = null;
80         bundle = null;
81     }
82 /**
83  * Insert the method's description here.
84  * Creation date: (17/07/2001 15:08:21)
85  * @param newKey java.lang.String
86  */

87 public void setKey(java.lang.String JavaDoc newKey) {
88     key = newKey;
89 }
90 /**
91  * Insert the method's description here.
92  * Creation date: (17/07/2001 15:08:21)
93  * @param newLink java.lang.String
94  */

95 public void setLink(java.lang.String JavaDoc newLink) {
96     link = newLink;
97 }
98 /**
99  * Insert the method's description here.
100  * Creation date: (17/07/2001 15:25:47)
101  * @param newTarget java.lang.String
102  */

103 public void setTarget(java.lang.String JavaDoc newTarget) {
104     target = newTarget;
105 }
106     /**
107      * @return Returns the bundle.
108      */

109     public String JavaDoc getBundle() {
110         return bundle;
111     }
112
113     /**
114      * @param bundle The bundle to set.
115      */

116     public void setBundle(String JavaDoc bundle) {
117         this.bundle = bundle;
118     }
119
120 }
121
Popular Tags