KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > core > Panel


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.core;
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletResponse JavaDoc;
24 import javax.servlet.jsp.PageContext JavaDoc;
25
26
27 /**
28  * <i>Panels</i> are blocks of HTML / JSP that may be added by plugins to
29  * one of the main areas of the SSL-Explorer layout.
30  * <p>
31  * Every panel must have a unique ID.
32  * <p>
33  * Each panel has a <i>Placement</i> that determines where it will appear,
34  * a weight for determining where it appears in relation to other panels with
35  * the same placement and a path to JSP / HTML fragment to include.
36  * <p>
37  * Before the panel is rendered, {@link #isAvailable(HttpServletRequest, HttpServletResponse, String)}
38  * is called to determine if the panel should be shown in the current context.
39  *
40  * @author Brett Smith <a HREF="mailto: brett@3sp.com">&lt;brett@3sp.com&gt;</a>
41  */

42 public interface Panel {
43     
44     /**
45      * Frame state of closed.
46      */

47     public final static String JavaDoc FRAME_CLOSED = "closed";
48     
49     /**
50      * Frame state of minimized.
51      */

52     public final static String JavaDoc FRAME_MINIMIZED = "minimized";
53     
54     /**
55      * Frame state of normal.
56      */

57     public final static String JavaDoc FRAME_NORMAL = "normal";
58     
59     /**
60      * The side bar. The menus and resource editing details go here. The
61      * default theme has this as a bar running down the left hand side
62      */

63     public final static int SIDEBAR = 0;
64     
65     /**
66      * The message area. Page tasks, errors, warnings, info etc all go here.
67      * Not yet supported by the default theme.
68      */

69     public final static int MESSAGES = 1;
70     
71     /**
72      * The header area. Not yet support by the default theme.
73      */

74     public final static int HEADER = 2;
75     
76     /**
77      * The footer area. Not yet supported by the default theme
78      */

79     public final static int FOOTER = 3;
80     
81     /**
82      * The information area. Not yet supported by the default theme
83      */

84     public final static int INFO = 4;
85     
86     /**
87      * The main content area
88      */

89     public final static int CONTENT = 5;
90     
91     /**
92      * A tab on the status page
93      */

94     public final static int STATUS_TAB = 6;
95     
96     /**
97      * Some panels may need to know th message resource bundle they are
98      * associated with. This method returns it.
99      *
100      * @return bundle
101      */

102     public String JavaDoc getBundle();
103     
104     /**
105      * Get the unique panel ID
106      *
107      * @return panel id
108      */

109     public String JavaDoc getId();
110     
111     /**
112      * Get the placement of the panel.
113      *
114      * @return placement
115      */

116     public int getPlacement();
117     
118     /**
119      * Get the weight used to determine this panel in relation to others with
120      * the same placement. Lowest values are rendered first.
121      *
122      * @return weight
123      */

124     public int getWeight();
125     
126     /**
127      * Get the path to the JSP / HTML fragment to include.
128      *
129      * @param pageContext page context
130      * @return include path
131      */

132     public String JavaDoc getTileIncludePath(PageContext JavaDoc pageContext);
133     
134     /**
135      * Get if this panel is available in the current context given the
136      * request and response.
137      *
138      * @param request request
139      * @param response response
140      * @param layout TODO
141      * @return available
142      */

143     public boolean isAvailable(HttpServletRequest JavaDoc request, HttpServletResponse JavaDoc response, String JavaDoc layout);
144     
145     /**
146      * Get if this panel is closable
147      *
148      * @return closable
149      */

150     public boolean isCloseable();
151     
152     /**
153      * Get if this frame is dragable
154      *
155      * @return draggable
156      */

157     public boolean isDragable();
158     
159     /**
160      * Get if this frame is dropable
161      *
162      * @return dropable
163      */

164     public boolean isDropable();
165     
166     /**
167      * Get the default frame state.
168      *
169      * @return default frame state
170      */

171     public String JavaDoc getDefaultFrameState();
172
173     /**
174      * Set whether the panel is dragable
175      *
176      * @param dragable dragable
177      */

178     public void setDragable(boolean dragable);
179
180
181     /**
182      * Set whether the panel is dropable
183      *
184      * @param dropable dropable
185      */

186     public void setDropable(boolean dropable);
187     
188     /**
189      * Set whether the panel is minimizalbe
190      *
191      * @param minimizable minimizable
192      */

193     public void setMinimizable(boolean minimizable);
194     
195     /**
196      * Get whether the panel is minimizalbe
197      *
198      * @return minimizable
199      */

200     public boolean isMinimizable();
201
202 }
203
Popular Tags