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.

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.


Field Summary
static String PROP_BOUNDS
          Name of property for bounds of the mode
static String PROP_DISPLAY_NAME
          Name of property for the display name of this mode.
static String PROP_NAME
          Name of property for the unique programmatic name of this mode.
static long serialVersionUID
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener list)
          Add a property change listener.
 boolean canDock(TopComponent tc)
           
 boolean dockInto(TopComponent c)
          Attaches a component to a mode for this workspace.
 Rectangle getBounds()
          Getter for current bounds of the mode.
 String getDisplayName()
          Get the diplay name of the mode.
 Image getIcon()
          Get the icon of the mode.
 String getName()
          Get the programmatic name of the mode.
 TopComponent[] getTopComponents()
           
 Workspace getWorkspace()
          Getter for asociated workspace.
 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

PROP_BOUNDS

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

PROP_NAME

public static final String PROP_NAME
Name of property for the unique programmatic name of this mode.

PROP_DISPLAY_NAME

public static final String PROP_DISPLAY_NAME
Name of property for the display name of this mode.
Method Detail

getDisplayName

public String getDisplayName()
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()
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 desktop, it is removed from the original and moved to this one.
Parameters:
c - component

canDock

public boolean canDock(TopComponent tc)

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()
Getter for asociated workspace.
Returns:
The workspace instance to which is this mode asociated.

getTopComponents

public TopComponent[] getTopComponents()
Returns:
array of top components which are currently docked in this mode. May return empty array if no top component is docked in this mode.

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


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.