01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13:
14: package com.sun.portal.container;
15:
16: /**
17: * The <CODE>WindowState</CODE> class represents
18: * the possible window states that a channel window can assume.
19: * <P>
20: * This class defines a standard set of the most basic channel window states.
21: * Additional window states may be defined by calling the constructorof
22: * this class.
23: */
24:
25: public class WindowState {
26: /**
27: * The standard "one-of many" window state on a page.
28: * <p>
29: * The string value for this state is "NORMAL".
30: */
31: public final static WindowState NORMAL = new WindowState("NORMAL");
32:
33: /**
34: * In this window state the channel is displayed maximized
35: * which means that it is the only channel shown on the page.
36: * <p>
37: * The string value for this state is "MAXIMIZED".
38: */
39: public final static WindowState MAXIMIZED = new WindowState(
40: "MAXIMIZED");
41:
42: /**
43: * In this window state the channel is displayed minimzed
44: * which means that only the channel title is shown
45: * <p>
46: * The string value for this state is "MINIMIZED".
47: */
48: public final static WindowState MINIMIZED = new WindowState(
49: "MINIMIZED");
50:
51: private String _name;
52:
53: private WindowState() {
54: };
55:
56: /**
57: * Creates a new window state with the given name.<br>
58: * Lower case letters in the name will be converted to
59: * upper case letters.
60: *
61: * @param name The name of the channel mode
62: */
63: public WindowState(String name) {
64: if (name == null) {
65: throw new IllegalArgumentException(
66: "WindowState name can not be NULL");
67: }
68: _name = name.toUpperCase();
69: }
70:
71: public String toString() {
72: return _name;
73: }
74:
75: public int hashCode() {
76: return _name.hashCode();
77: }
78:
79: public boolean equals(Object object) {
80: return _name.equals(((WindowState) object)._name);
81: }
82: }
|