01: /*
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: RefreshTreeTag.java 4408 2004-03-19 14:31:54Z sauthieg $
23: * --------------------------------------------------------------------------
24: */
25:
26: package org.objectweb.jonas.webapp.taglib;
27:
28: import java.io.IOException;
29:
30: import javax.servlet.jsp.JspException;
31: import javax.servlet.jsp.JspWriter;
32:
33: /**
34: * @author Michel-Ange ANTON
35: */
36: public class RefreshTreeTag extends WhereAreYouTag {
37:
38: // ----------------------------------------------------- Constants
39:
40: // ----------------------------------------------------- Instance Variables
41:
42: // ----------------------------------------------------- Properties
43:
44: // ----------------------------------------------------- Public Methods
45:
46: /**
47: * Render this instant actions control.
48: *
49: * @return Constant EVAL_PAGE
50: * @exception JspException if a processing error occurs
51: */
52: public int doEndTag() throws JspException {
53: JspWriter out = pageContext.getOut();
54: try {
55: render(out);
56: } catch (IOException e) {
57: throw new JspException(e);
58: }
59: return (EVAL_PAGE);
60: }
61:
62: // -------------------------------------------------------- Protected Methods
63:
64: protected void render(JspWriter out) throws IOException,
65: JspException {
66: // Action to refresh associate tree
67: if (isTreeToRefresh() == true) {
68: out.print("<script language=\"JavaScript\">");
69: out.print("refreshTree(\"");
70: out.print(getUrlToRefreshSelectedNode());
71: out.print("\");");
72: out.println("</script>");
73: }
74: }
75: }
|