KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > windows > Mode


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.openide.windows;
20
21 import java.awt.Image JavaDoc;
22 import java.awt.Rectangle JavaDoc;
23
24 import java.beans.PropertyChangeListener JavaDoc;
25
26 import java.io.Serializable JavaDoc;
27
28
29 /** Instances of this interface represent places or containers
30  * which <code>TopComponent</code> has to be added to
31  * in order to be managed by window system.
32  *
33  * <p>There is always present default document mode named "editor".
34  * Modules can add their own modes by declaring them using XML.
35  * <P>
36  * Modules can get a set of current modes by calling
37  * {@link WindowManager#getModes}.<p>
38  *
39  * <p>
40  * Each mode must have a unique name.
41  *
42  * <p><p>
43  * <b><font color="red"><em>Important note: Do not provide implementation of this interface unless you are window system provider!</em></font></b>
44  */

45 public interface Mode extends Serializable JavaDoc {
46     /** Name of property for bounds of the mode */
47     public static final String JavaDoc PROP_BOUNDS = "bounds"; // NOI18N
48

49     /** Name of property for the unique programmatic name of this mode.
50      * @deprecated Do not use. It is redundant, name can not be changed.*/

51     public static final String JavaDoc PROP_NAME = "name"; // NOI18N
52

53     /** Name of property for the display name of this mode.
54      * @deprecated Do not use. It is redundant. */

55     public static final String JavaDoc PROP_DISPLAY_NAME = "displayName"; // NOI18N
56

57     /** @deprecated Only public by accident. */
58
59     /* public static final */ long serialVersionUID = -2650968323666215654L;
60
61     /** Get the diplay name of the mode.
62      * This name will be used by a container to create its title.
63      * @return human-presentable name of the mode
64      * @deprecated Do not use. It is redudant. */

65     public String JavaDoc getDisplayName();
66
67     /** Get the programmatic name of the mode.
68      * This name should be unique, as it is used to find modes etc.
69      * @return programmatic name of the mode */

70     public String JavaDoc getName();
71
72     /** Get the icon of the mode. It will be used by component container
73      * implementations as the icon (e.g. for display in tabs).
74      * @return the icon of the mode (or <code>null</code> if no icon was specified)
75      * @deprecated Do not use. It is redundant. */

76     public Image JavaDoc getIcon();
77
78     /** Attaches a component to a mode for this workspace.
79     * If the component is in different mode on this workspace, it is
80     * removed from the original and moved to this one.
81     *
82     * @param c component
83     * @return true if top component was succesfully docked to this mode, false otherwise
84     */

85     public boolean dockInto(TopComponent c);
86
87     /** Allows implementor to specify some restrictive policy as to which
88      * top components can be docked into this mode.
89      * @return true if a given top component can be docked into this mode,
90      * false otherwise
91      */

92     public boolean canDock(TopComponent tc);
93
94     /** Sets the bounds of the mode.
95     * @param s the bounds for the mode
96     */

97     public void setBounds(Rectangle JavaDoc s);
98
99     /** Getter for current bounds of the mode.
100     * @return the bounds of the mode
101     */

102     public Rectangle JavaDoc getBounds();
103
104     /** Getter for asociated workspace.
105      * @return The workspace instance to which is this mode asociated.
106      * @deprecated Do not use. Worskpaces are not supporeted anymore. */

107     public Workspace getWorkspace();
108
109     /** Get all top components currently docked into this mode.
110      * @return the list of components; might be empty, but not null
111     */

112     public TopComponent[] getTopComponents();
113
114     /** Add a property change listener.
115     * @param list the listener to add
116     */

117     public void addPropertyChangeListener(PropertyChangeListener JavaDoc list);
118
119     /** Remove a property change listener.
120     * @param list the listener to remove
121     */

122     public void removePropertyChangeListener(PropertyChangeListener JavaDoc list);
123
124     /** Gets selected <code>TopComponent</code> in this mode.
125      * @since 4.13 */

126     public TopComponent getSelectedTopComponent();
127 }
128
Popular Tags