KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > taglib > WhereAreYouTag


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: WhereAreYouTag.java,v 1.7 2004/03/19 14:31:50 sauthieg Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.taglib;
27
28 import javax.servlet.http.HttpServletRequest JavaDoc;
29 import javax.servlet.http.HttpServletResponse JavaDoc;
30 import javax.servlet.jsp.tagext.BodyTagSupport JavaDoc;
31
32 import org.objectweb.jonas.webapp.jonasadmin.WhereAreYou;
33
34 /**
35  * @author Michel-Ange ANTON
36  */

37 public class WhereAreYouTag extends BodyTagSupport JavaDoc {
38
39 // ----------------------------------------------------- Instance Variables
40

41 // ----------------------------------------------------- Properties
42

43     private boolean usingWhere = false;
44
45     public boolean isUsingWhere() {
46         return usingWhere;
47     }
48
49     public boolean getUsingWhere() {
50         return usingWhere;
51     }
52
53     public void setUsingWhere(boolean usingWhere) {
54         this.usingWhere = usingWhere;
55     }
56
57 // --------------------------------------------------------- Public Methods
58

59     public String JavaDoc getSelectedNameNode() {
60         String JavaDoc sName = null;
61         WhereAreYou oWhere = getWhereAreYouInstance();
62         if (oWhere != null) {
63             sName = oWhere.getSelectedNameNode();
64         }
65         return sName;
66     }
67
68     public TreeControlNode getSelectedTreeControlNode() {
69         TreeControlNode oNode = null;
70         WhereAreYou oWhere = getWhereAreYouInstance();
71         if (oWhere != null) {
72             oNode = oWhere.getSelectedTreeControlNode();
73         }
74         return oNode;
75     }
76
77     public String JavaDoc getImagesRoot() {
78         String JavaDoc sImagesRoot = null;
79         WhereAreYou oWhere = getWhereAreYouInstance();
80         if (oWhere != null) {
81             sImagesRoot = oWhere.getImagesRoot();
82         }
83         return sImagesRoot;
84     }
85
86     public boolean isTreeToRefresh() {
87         boolean bRefresh = false;
88         WhereAreYou oWhere = getWhereAreYouInstance();
89         if (oWhere != null) {
90             bRefresh = oWhere.isTreeToRefresh();
91         }
92         return bRefresh;
93     }
94
95     public String JavaDoc getUrlToRefreshSelectedNode() {
96         String JavaDoc sUrl = null;
97         WhereAreYou oWhere = getWhereAreYouInstance();
98         if (oWhere != null) {
99             sUrl = oWhere.getUrlToRefreshSelectedNode((HttpServletRequest JavaDoc) pageContext.getRequest()
100                 , (HttpServletResponse JavaDoc) pageContext.getResponse());
101         }
102         return sUrl;
103     }
104
105 // --------------------------------------------------------- Protected Methods
106

107     protected WhereAreYou getWhereAreYouInstance() {
108         return (WhereAreYou) pageContext.getSession().getAttribute(WhereAreYou.SESSION_NAME);
109     }
110 }
111
Popular Tags