KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jresearch > gossip > tags > navbar > NavElementTag


1 /*
2  * $$Id$$
3  *
4  * ***** BEGIN LICENSE BLOCK *****
5  * The contents of this file are subject to the Mozilla Public License
6  * Version 1.1 (the "License"); you may not use this file except in
7  * compliance with the License. You may obtain a copy of the License
8  * at http://www.mozilla.org/MPL/
9  *
10  * Software distributed under the License is distributed on an "AS IS"
11  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12  * the License for the specific language governing rights and
13  * limitations under the License.
14  *
15  * The Original Code is JGossip forum code.
16  *
17  * The Initial Developer of the Original Code is the JResearch, Org.
18  * Portions created by the Initial Developer are Copyright (C) 2004
19  * the Initial Developer. All Rights Reserved.
20  *
21  * Contributor(s):
22  * Dmitry Belov <bel@jresearch.org>
23  *
24  * ***** END LICENSE BLOCK ***** */

25 /*
26  * Created on Oct 6, 2003
27  *
28  */

29 package org.jresearch.gossip.tags.navbar;
30
31 import javax.servlet.jsp.JspException JavaDoc;
32 import javax.servlet.jsp.tagext.TagSupport JavaDoc;
33
34 /**
35  * DOCUMENT ME!
36  *
37  * @author Bel
38  */

39 public class NavElementTag extends TagSupport JavaDoc {
40     private NavElement navElement;
41
42     /**
43      * DOCUMENT ME!
44      *
45      * @return DOCUMENT ME!
46      *
47      * @throws JspException
48      * DOCUMENT ME!
49      */

50     public int doStartTag() throws JspException JavaDoc {
51         try {
52             this.navElement = new NavElement();
53         } catch (Exception JavaDoc ex) {
54             throw new JspException JavaDoc("error in BlockOptionsTag tag:", ex);
55         }
56
57         return (super.EVAL_BODY_INCLUDE);
58     }
59
60     /**
61      * DOCUMENT ME!
62      *
63      * @return DOCUMENT ME!
64      *
65      * @throws JspException
66      * DOCUMENT ME!
67      */

68     public int doEndTag() throws JspException JavaDoc {
69         try {
70             ((NavBarTag) super.findAncestorWithClass(this, NavBarTag.class))
71                     .addNavElement(this.navElement);
72         } catch (Exception JavaDoc ex) {
73             throw new JspException JavaDoc("error in BlockOptionsTag tag:", ex);
74         }
75
76         return (super.EVAL_PAGE);
77     }
78
79     /**
80      * DOCUMENT ME!
81      *
82      * @param string
83      */

84     public void setLink(String JavaDoc string) {
85         this.navElement.setLink(string);
86     }
87
88     /**
89      * DOCUMENT ME!
90      *
91      * @param string
92      */

93     public void setTitle(String JavaDoc string) {
94         this.navElement.setTitle(string);
95     }
96 }
97
Popular Tags