org.openide.windows
Interface Workspace

All Superinterfaces:
Serializable

public interface Workspace
extends Serializable

Represents one user workspace that holds a list of modes into which components can be assigned. Created by WindowManager. When serialized only keeps "weak" reference to this workspace does not stores the content of the workspace (it is responsibility of window manager).


Field Summary
static String PROP_DISPLAY_NAME
          Name of property for the display name of this workspace.
static String PROP_MODES
          Name of property for modes in the workspace
static String PROP_NAME
          Name of property for the programmatic name of this workspace.
static long serialVersionUID
          generated Serialized Version UID
 
Method Summary
 void activate()
          Activates this workspace to be current one.
 void addPropertyChangeListener(PropertyChangeListener list)
          Add a property change listener.
 Mode createMode(String name, String displayName, URL icon)
          Create a new mode.
 Mode findMode(String name)
          Search all modes on this workspace by name.
 Mode findMode(TopComponent c)
          Finds mode the component is in on this workspace.
 Rectangle getBounds()
          Get bounds of the workspace.
 String getDisplayName()
          Get human-presentable name of the workspace which will be used for displaying.
 Set getModes()
          Array of all modes on this workspace.
 String getName()
          Get unique programmatical name of this workspace.
 void remove()
          Removes this workspace from set of workspaces in window manager.
 void removePropertyChangeListener(PropertyChangeListener list)
          Remove a property change listener.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
generated Serialized Version UID

PROP_MODES

public static final String PROP_MODES
Name of property for modes in the workspace

PROP_NAME

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

PROP_DISPLAY_NAME

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

getName

public String getName()
Get unique programmatical name of this workspace.
Returns:
unique name of the workspace

getDisplayName

public String getDisplayName()
Get human-presentable name of the workspace which will be used for displaying.
Returns:
the display name of the workspace

getModes

public Set getModes()
Array of all modes on this workspace.

getBounds

public Rectangle getBounds()
Get bounds of the workspace. Returned value has slighly different meaning for SDI and MDI mode. Modules should use this method for correct positioning of their windows.
Returns:
In SDI, returns bounds relative to whole screen, returns bounds of the part of screen below main window (or above main window, if main window is on bottom part of the screen).
In MDI, bounds are relative to the main window; returned value represents 'client area' of the main window

activate

public void activate()
Activates this workspace to be current one. This leads to change of current workspace of the WindowManager.

createMode

public Mode createMode(String name,
                       String displayName,
                       URL icon)
Create a new mode.
Parameters:
name - a unique programmatic name of the mode
displayName - a human presentable (probably localized) name of the mode (may be used by the Dock Into submenu, e.g.)
icon - a URL to the icon to use for the mode (e.g. on a tab or window corner); may be null
Returns:
the new mode

findMode

public Mode findMode(String name)
Search all modes on this workspace by name.
Parameters:
name - the name of the mode to search for
Returns:
the mode with that name, or null if no such mode can be found

findMode

public Mode findMode(TopComponent c)
Finds mode the component is in on this workspace.
Parameters:
c - component to find mode for
Returns:
the mode or null if the component is not visible on this workspace

remove

public void remove()
Removes this workspace from set of workspaces in window manager.

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.