01: /*
02: * Copyright (C) 2004 NNL Technology AB
03: * Visit www.infonode.net for information about InfoNode(R)
04: * products and how to contact NNL Technology AB.
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program 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
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19: * MA 02111-1307, USA.
20: */
21:
22: // $Id: TabAreaVisiblePolicy.java,v 1.3 2005/12/04 13:46:05 jesper Exp $
23: package net.infonode.tabbedpanel;
24:
25: import net.infonode.util.Enum;
26:
27: /**
28: * TabAreaVisiblePolicy defines the visibility policies for the tab area of a tabbed panel.
29: *
30: * @author $Author: jesper $
31: * @version $Revision: 1.3 $
32: * @see TabbedPanel
33: * @see TabbedPanelProperties
34: * @since ITP 1.4.0
35: */
36: public class TabAreaVisiblePolicy extends Enum {
37: private static final long serialVersionUID = 1L;
38:
39: /**
40: * Always visible policy. This means that the tab area is always visible.
41: */
42: public static final TabAreaVisiblePolicy ALWAYS = new TabAreaVisiblePolicy(
43: 0, "Always");
44:
45: /**
46: * Never visible policy. This means that the tab area is never visible.
47: */
48: public static final TabAreaVisiblePolicy NEVER = new TabAreaVisiblePolicy(
49: 1, "Never");
50:
51: /**
52: * Tabs exist visible policy. This means that the tab area will only be visible if it contains tabs.
53: */
54: public static final TabAreaVisiblePolicy TABS_EXIST = new TabAreaVisiblePolicy(
55: 2, "Tabs Exist in Tab Area");
56:
57: /**
58: * More than one visible policy. This means that the tab area is visible when the tabbed
59: * panel contains more than one tab.
60: */
61: public static final TabAreaVisiblePolicy MORE_THAN_ONE_TAB = new TabAreaVisiblePolicy(
62: 3, "More than One Tab");
63:
64: private static final TabAreaVisiblePolicy[] VISIBLE_POLICIES = new TabAreaVisiblePolicy[] {
65: ALWAYS, NEVER, TABS_EXIST, MORE_THAN_ONE_TAB };
66:
67: private TabAreaVisiblePolicy(int value, String name) {
68: super (value, name);
69: }
70:
71: /**
72: * Gets the tab area visible policies.
73: *
74: * @return the tab layout policies
75: */
76: public static TabAreaVisiblePolicy[] getVisiblePolicies() {
77: return (TabAreaVisiblePolicy[]) VISIBLE_POLICIES.clone();
78: }
79: }
|