01: /*
02: * Created on 20-Mar-2003
03: */
04: package net.sf.jportlet.portlet;
05:
06: /**
07: * The <code>PortletWindow</code> contains information about the portlet's
08: * window state
09: *
10: * @author <a href="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
11: */
12: public interface PortletWindow {
13: //~ Methods ----------------------------------------------------------------
14:
15: /**
16: * Return the state of the window
17: *
18: * @return State
19: */
20: public PortletWindow.State getState();
21:
22: //~ Inner Classes ----------------------------------------------------------
23:
24: /**
25: * State of a Window
26: */
27: public static class State {
28: //~ Static fields/initializers -----------------------------------------
29:
30: public static final State MAXIMIZED = new State("maximized");
31: public static final State NORMAL = new State("normal");
32:
33: //~ Instance fields ----------------------------------------------------
34:
35: private String _name;
36:
37: //~ Constructors -------------------------------------------------------
38:
39: private State(String name) {
40: _name = name;
41: }
42:
43: //~ Methods ------------------------------------------------------------
44:
45: public static State fromString(String str) {
46: if (MAXIMIZED._name.equals(str)) {
47: return MAXIMIZED;
48: } else if (NORMAL._name.equals(str)) {
49: return NORMAL;
50: } else {
51: return null;
52: }
53: }
54:
55: public String toString() {
56: return _name;
57: }
58: }
59: }
|