org.openide.windows
Interface Mode

All Superinterfaces:
Serializable

public interface Mode
extends Serializable

A window-management mode in which a TopComponent can be.

Some default modes are always present. Modules can add their own modes by calling Workspace.createMode(java.lang.String, java.lang.String, java.net.URL) in their initialization code, or by declaring them using XML.

Modules can also get a list of current modes by calling Workspace.getModes().

A mode is valid so long as someone keeps a reference to it.

Each mode must have a unique name.

Importatnt note: Do not provide implementation of this interface unless you are window system provider!


Field Summary
static String PROP_BOUNDS
          Name of property for bounds of the mode
static String PROP_DISPLAY_NAME
          Deprecated. XXX Do not use. It is redundant.
static String PROP_NAME
          Deprecated. XXX Do not use. It is redundant, name can not be changed.
static long serialVersionUID
          Deprecated. Only public by accident.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener list)
          Add a property change listener.
 boolean canDock(TopComponent tc)
          Allows implementor to specify some restrictive policy as to which top components can be docked into this mode.
 boolean dockInto(TopComponent c)
          Attaches a component to a mode for this workspace.
 Rectangle getBounds()
          Getter for current bounds of the mode.
 String getDisplayName()
          Deprecated. XXX Do not use. It is redudant.
 Image getIcon()
          Deprecated. XXX Do not use. It is redundant.
 String getName()
          Get the programmatic name of the mode.
 TopComponent getSelectedTopComponent()
          XXX Gets selected TopComponent in this mode.
 TopComponent[] getTopComponents()
          Get all top components currently docked into this mode.
 Workspace getWorkspace()
          Deprecated. XXX Do not use. Worskpaces are not supporeted anymore.
 void removePropertyChangeListener(PropertyChangeListener list)
          Remove a property change listener.
 void setBounds(Rectangle s)
          Sets the bounds of the mode.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Deprecated. Only public by accident.

See Also:
Constant Field Values

PROP_BOUNDS

public static final String PROP_BOUNDS
Name of property for bounds of the mode

See Also:
Constant Field Values

PROP_NAME

public static final String PROP_NAME
Deprecated. XXX Do not use. It is redundant, name can not be changed.

Name of property for the unique programmatic name of this mode.

See Also:
Constant Field Values

PROP_DISPLAY_NAME

public static final String PROP_DISPLAY_NAME
Deprecated. XXX Do not use. It is redundant.

Name of property for the display name of this mode.

See Also:
Constant Field Values
Method Detail

getDisplayName

public String getDisplayName()
Deprecated. XXX Do not use. It is redudant.

Get the diplay name of the mode. This name will be used by a container to create its title.

Returns:
human-presentable name of the mode

getName

public String getName()
Get the programmatic name of the mode. This name should be unique, as it is used to find modes etc.

Returns:
programmatic name of the mode

getIcon

public Image getIcon()
Deprecated. XXX Do not use. It is redundant.

Get the icon of the mode. It will be used by component container implementations as the icon (e.g. for display in tabs).

Returns:
the icon of the mode (or null if no icon was specified)

dockInto

public boolean dockInto(TopComponent c)
Attaches a component to a mode for this workspace. If the component is in different mode on this workspace, it is removed from the original and moved to this one.

Parameters:
c - component
Returns:
true if top component was succesfully docked to this mode, false otherwise

canDock

public boolean canDock(TopComponent tc)
Allows implementor to specify some restrictive policy as to which top components can be docked into this mode.

Returns:
true if a given top component can be docked into this mode, false otherwise

setBounds

public void setBounds(Rectangle s)
Sets the bounds of the mode.

Parameters:
s - the bounds for the mode

getBounds

public Rectangle getBounds()
Getter for current bounds of the mode.

Returns:
the bounds of the mode

getWorkspace

public Workspace getWorkspace()
Deprecated. XXX Do not use. Worskpaces are not supporeted anymore.

Getter for asociated workspace.

Returns:
The workspace instance to which is this mode asociated.

getTopComponents

public TopComponent[] getTopComponents()
Get all top components currently docked into this mode.

Returns:
the list of components; might be empty, but not null

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener list)
Add a property change listener.

Parameters:
list - the listener to add

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener list)
Remove a property change listener.

Parameters:
list - the listener to remove

getSelectedTopComponent

public TopComponent getSelectedTopComponent()
XXX Gets selected TopComponent in this mode.

Since:
XXX

 

Built on October 24 2003.  |  Portions Copyright 1997-2003 Sun Microsystems, Inc. All rights reserved.