org.openide.windows
Class WindowManager

java.lang.Object
  |
  +--org.openide.windows.WindowManager
All Implemented Interfaces:
Serializable

public abstract class WindowManager
extends Object
implements Serializable

Manager of windows in the IDE. Handles the work with workspaces, allows to listen to workspace changes.

See Also:
Serialized Form

Inner Class Summary
protected static interface WindowManager.Component
          A manager that handles operations on top components.
 
Field Summary
static String PROP_CURRENT_WORKSPACE
          property change of current workspace
static String PROP_WORKSPACES
          property change of workspaces
 
Constructor Summary
WindowManager()
           
 
Method Summary
protected  void activateComponent(TopComponent tc)
          Activate a component.
abstract  void addPropertyChangeListener(PropertyChangeListener l)
          Attaches listener for changes in workspaces
protected  void componentCloseNotify(TopComponent tc)
          Notifies component that it was closed (and is not opened on any workspace anymore).
protected  void componentOpenNotify(TopComponent tc)
          Notifies component that it was opened (and wasn't opened on any workspace before).
protected abstract  TopComponent.Registry componentRegistry()
          Access method for registry of all components in the system.
protected abstract  WindowManager.Component createTopComponentManager(TopComponent c)
          Create a component manager for the given top component.
 Workspace createWorkspace(String name)
          Deprecated. please use method createWorkspace(String name, String displayName) instead
abstract  Workspace createWorkspace(String name, String displayName)
          Creates new workspace.
protected static WindowManager.Component findComponentManager(TopComponent tc)
          Finds top component manager for given top component.
abstract  Workspace findWorkspace(String name)
          Finds workspace given its name.
abstract  Workspace getCurrentWorkspace()
          Current workspace.
abstract  Frame getMainWindow()
          Get the Main Window of the IDE.
 TopComponent.Registry getRegistry()
          Getter for component registry.
abstract  Workspace[] getWorkspaces()
          List of all workspaces.
abstract  void removePropertyChangeListener(PropertyChangeListener l)
          Removes listener.
abstract  void setWorkspaces(Workspace[] workspaces)
          Sets new array of workspaces.
abstract  void updateUI()
          Called after a Look&Feel change to update the IDE's UI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_WORKSPACES

public static final String PROP_WORKSPACES
property change of workspaces

PROP_CURRENT_WORKSPACE

public static final String PROP_CURRENT_WORKSPACE
property change of current workspace
Constructor Detail

WindowManager

public WindowManager()
Method Detail

getMainWindow

public abstract Frame getMainWindow()
Get the Main Window of the IDE. This should ONLY be used for:
Returns:
the Main Window of the IDE

updateUI

public abstract void updateUI()
Called after a Look&Feel change to update the IDE's UI. Should call JComponent.updateUI() on all opened windows.

createTopComponentManager

protected abstract WindowManager.Component createTopComponentManager(TopComponent c)
Create a component manager for the given top component.
Parameters:
c - the component
Returns:
the manager to handle opening, closing and selecting the component

componentRegistry

protected abstract TopComponent.Registry componentRegistry()
Access method for registry of all components in the system.
Returns:
the registry

getRegistry

public TopComponent.Registry getRegistry()
Getter for component registry.
Returns:
the registry

createWorkspace

public final Workspace createWorkspace(String name)
Deprecated. please use method createWorkspace(String name, String displayName) instead

Creates new workspace.
Parameters:
name - the name of the workspace
Returns:
new workspace

createWorkspace

public abstract Workspace createWorkspace(String name,
                                          String displayName)
Creates new workspace. Note that it will not be displayed until setWorkspaces(org.openide.windows.Workspace[]) is called with an array containing the new workspace.
Parameters:
codeName - the code name (used for lookup)
displayName - the display name

findWorkspace

public abstract Workspace findWorkspace(String name)
Finds workspace given its name.
Parameters:
name - the name of workspace to find
Returns:
workspace or null if not found

getWorkspaces

public abstract Workspace[] getWorkspaces()
List of all workspaces.

setWorkspaces

public abstract void setWorkspaces(Workspace[] workspaces)
Sets new array of workspaces. In conjunction with getWorkspaces(), this may be used to reorder workspaces, or add or remove workspaces.
Parameters:
workspaces - An array consisting of new workspaces.

getCurrentWorkspace

public abstract Workspace getCurrentWorkspace()
Current workspace. Can be changed by calling Workspace.activate ()

addPropertyChangeListener

public abstract void addPropertyChangeListener(PropertyChangeListener l)
Attaches listener for changes in workspaces

removePropertyChangeListener

public abstract void removePropertyChangeListener(PropertyChangeListener l)
Removes listener.

findComponentManager

protected static final WindowManager.Component findComponentManager(TopComponent tc)
Finds top component manager for given top component.
Parameters:
tc - top component to find manager for.
Returns:
component manager for given top component.

activateComponent

protected void activateComponent(TopComponent tc)
Activate a component. The top component containers should inform the top component that it is active via a call to this method through derived window manager implementation.
Parameters:
tc - the top component to activate; or null to deactivate all top components

componentOpenNotify

protected void componentOpenNotify(TopComponent tc)
Notifies component that it was opened (and wasn't opened on any workspace before). Top component manager that implements Component inner interface of this class should send open notifications via calling this method
Parameters:
tc - the top component to be notified

componentCloseNotify

protected void componentCloseNotify(TopComponent tc)
Notifies component that it was closed (and is not opened on any workspace anymore). Top component manager that implements Component inner interface of this class should send close notifications via calling this method
Parameters:
tc - the top component to be notified


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