org.noos.xing.mydoggy
Interface ToolWindowManager

All Superinterfaces:
DockableManager

public interface ToolWindowManager
extends DockableManager

This interface is the main entry point to manager MyDoggy. Using this interface the user can register/unregister tool windows, groups. The user can get the content manager instance and type descriptor templates.

Since:
1.0.0
Author:
Angelo De Caro (angelo.decaro@gmail.com)
See Also:
ToolWindow, ToolWindowGroup, ContentManager, ToolWindowTypeDescriptor, ToolWindowManagerListener

Method Summary
 void addAlias(ToolWindow toolWindow, java.lang.Object alias)
          Associates the specified toolWindow with the specified alias in this manager.
 void addToolWindowManagerListener(ToolWindowManagerListener listener)
          Registers listener so that it will receive events when the toolwindows and groups are registered or removed..
 boolean containsGroup(java.lang.String name)
          Returns true if this manager contains a group for the specified name.
 java.lang.Object getActiveToolWindowId()
          Returns the id of currently active tool window.
 java.lang.Object[] getAliases(ToolWindow toolWindow)
          Returns all aliases associated to the passed toolwindow.
 ContentManager getContentManager()
          Returns the instance of ContentManager that manages main window contents.
 Dockable getDockable(java.lang.Object id)
          Returns the dockable to which this manager maps the specified id.
 PersistenceDelegate getPersistenceDelegate()
          Returns an instance of PersistenceDelegate relative to this manager.
 ToolWindow[] getToolsByAnchor(ToolWindowAnchor anchor)
          Returns an array of the toolwindows, registered into this manager, with the specified anchor.
 ToolWindow getToolWindow(int index)
          Returns the tool window whose index is index.
 ToolWindow getToolWindow(java.lang.Object key)
          Returns the tool window to which this manager maps the specified key (the key could be the id or an alias).
 ToolWindowBar getToolWindowBar(ToolWindowAnchor anchor)
          Returns the instance of ToolWindowBar related to the specified anchor.
 ToolWindow getToolWindowByAlias(java.lang.Object alias)
          Deprecated. use getToolWindow(Object) instead.
 ToolWindowGroup getToolWindowGroup()
          Returns a special group that contains all toolwindows registered in this manager.
 ToolWindowGroup getToolWindowGroup(java.lang.String name)
          Returns the tool window group to which this manager maps the specified name.
 ToolWindowGroup[] getToolWindowGroups()
          Returns an array of the toolwindows groups registered into this manager.
 ToolWindowManagerDescriptor getToolWindowManagerDescriptor()
          Returns the type descriptor for this manager.
 ToolWindowManagerListener[] getToolWindowManagerListeners()
          Returns an array of all the tool window manager listeners registered on this manager.
 ToolWindow[] getToolWindows()
          Returns an array of the toolwindows registered into this manager.
 ToolWindowTypeDescriptor getTypeDescriptorTemplate(ToolWindowType type)
          Returns the template type descrptor for type.
 ToolWindow registerToolWindow(java.lang.String id, java.lang.String title, javax.swing.Icon icon, java.awt.Component component, ToolWindowAnchor anchor)
          Register a new tool window into this window manager based on the passed parameters.
 boolean removeToolWindowGroup(java.lang.String name)
          Removes the tool window group for this name from this manager if it is present.
 boolean removeToolWindowGroup(ToolWindowGroup toolWindowGroup)
          Removes the tool window group from this manager if it is registered.
 void removeToolWindowManagerListener(ToolWindowManagerListener listener)
          Unregisters listener so that it will no longer receive events.
 void unregisterAllToolWindow()
          Removes all toolwindows from this window manager if there are any.
 void unregisterToolWindow(java.lang.String id)
          Removes the tool window for this id from this window manager if it is present.
 
Methods inherited from interface org.noos.xing.mydoggy.DockableManager
addDockableManagerListener, getDockableManagerListeners, removeDockableManagerListener
 

Method Detail

getContentManager

ContentManager getContentManager()
Returns the instance of ContentManager that manages main window contents.

Returns:
an instance of ContentManager.
Since:
1.0.0
See Also:
ContentManager

getToolWindowManagerDescriptor

ToolWindowManagerDescriptor getToolWindowManagerDescriptor()
Returns the type descriptor for this manager.

Returns:
type descrptor for this manager.
Since:
1.2.0

getPersistenceDelegate

PersistenceDelegate getPersistenceDelegate()
Returns an instance of PersistenceDelegate relative to this manager.

Returns:
an instance of PersistenceDelegate relative to this manager.
Since:
1.2.0

registerToolWindow

ToolWindow registerToolWindow(java.lang.String id,
                              java.lang.String title,
                              javax.swing.Icon icon,
                              java.awt.Component component,
                              ToolWindowAnchor anchor)
Register a new tool window into this window manager based on the passed parameters.

Parameters:
id - id of tool window to be registered.
title - title of tool window to be registered (can be null).
icon - icon of tool window to be registered (can be null).
component - component which represents tool window content.
anchor - anchor of tool window to be registered.
Returns:
the registered tool window.
Throws:
java.lang.IllegalArgumentException - if exist a tool window registered with the same id or one or more of the parameters is null.
Since:
1.0.0
See Also:
ToolWindowAnchor, ToolWindowManager, unregisterToolWindow(String)

unregisterToolWindow

void unregisterToolWindow(java.lang.String id)
Removes the tool window for this id from this window manager if it is present.

Parameters:
id - id of tool window to be removed.
Throws:
java.lang.IllegalArgumentException - - if tool window with specified id isn't registered.
Since:
1.0.0
See Also:
registerToolWindow(String,String,javax.swing.Icon,java.awt.Component,ToolWindowAnchor), unregisterAllToolWindow()

unregisterAllToolWindow

void unregisterAllToolWindow()
Removes all toolwindows from this window manager if there are any.

Since:
1.0.0

addAlias

void addAlias(ToolWindow toolWindow,
              java.lang.Object alias)
Associates the specified toolWindow with the specified alias in this manager. If the manager previously contained a mapping for this alias, the old toolWindow is replaced by the specified toolWindow.

Parameters:
toolWindow - toolWindow to be associated with the specified alias.
alias - alias with which the specified toolWindow is to be associated.
Since:
1.2.0
See Also:
getToolWindowByAlias(Object)

getAliases

java.lang.Object[] getAliases(ToolWindow toolWindow)
Returns all aliases associated to the passed toolwindow.

Parameters:
toolWindow - toolwindow whose aliases are to be returned.
Returns:
all aliases associated to the passed toolwindow.
Since:
1.4.1
See Also:
addAlias(ToolWindow, Object)

getToolWindowByAlias

ToolWindow getToolWindowByAlias(java.lang.Object alias)
Deprecated. use getToolWindow(Object) instead.

Returns the toolWindow to which this manager maps the specified alias. Returns null if the manager contains no mapping for this alias.

Parameters:
alias - alias whose associated toolWindow is to be returned.
Returns:
the toolWindow to which this manager maps the specified alias, or null if the manager contains no mapping for this alias.
Since:
1.2.0

getActiveToolWindowId

java.lang.Object getActiveToolWindowId()
Returns the id of currently active tool window.

Returns:
ID of currently active tool window or null if there is no active tool window.
Since:
1.0.0

getToolWindow

ToolWindow getToolWindow(java.lang.Object key)
Returns the tool window to which this manager maps the specified key (the key could be the id or an alias). Returns null if the manager contains no mapping for this id.

Parameters:
key - the key could be the id or an alias
Returns:
the tool window to which this manager maps the specified key. If there is no registered tool then the method returns null.
Since:
1.0.0

getToolWindow

ToolWindow getToolWindow(int index)
Returns the tool window whose index is index.

Parameters:
index - tool window index.
Returns:
the tool window whose index is index.
Since:
1.0.0

getToolWindows

ToolWindow[] getToolWindows()
Returns an array of the toolwindows registered into this manager.

Returns:
an array of the toolwindows registered into this manager. If there is no tool registered then it returns an empty array.
Since:
1.0.0

getToolsByAnchor

ToolWindow[] getToolsByAnchor(ToolWindowAnchor anchor)
Returns an array of the toolwindows, registered into this manager, with the specified anchor.

Parameters:
anchor - anchor which toolwindows are anchored.
Returns:
an array of the toolwindows, registered into this manager, anchored on passed anchor. If there is no registered tool window anchored on that anchor then it returns an empty array.
Since:
1.0.0
See Also:
ToolWindowAnchor

getToolWindowGroup

ToolWindowGroup getToolWindowGroup()
Returns a special group that contains all toolwindows registered in this manager.

Returns:
a group that contains all toolwindows registered in this manager.
Since:
1.2.0

getToolWindowGroup

ToolWindowGroup getToolWindowGroup(java.lang.String name)
Returns the tool window group to which this manager maps the specified name. If the manager contains no mapping for this name then the manager create a new instance of ToolWindowGroup and associates the group created with the specified name in this manager.

Parameters:
name - name of tool window group.
Returns:
the tool window group to which this manager maps the specified name.
Since:
1.0.0
See Also:
ToolWindowGroup, getToolWindowGroups()

getToolWindowGroups

ToolWindowGroup[] getToolWindowGroups()
Returns an array of the toolwindows groups registered into this manager.

Returns:
an array of the toolwindows groups registered into this manager. If there is no group registered then it returns an empty array.
Since:
1.0.0
See Also:
getToolWindowGroup(String)

removeToolWindowGroup

boolean removeToolWindowGroup(java.lang.String name)
Removes the tool window group for this name from this manager if it is present.

Parameters:
name - name whose group is to be removed from the manager.
Returns:
true if there exist a group for this name from this manager, false otherwise.
Since:
1.0.0
See Also:
getToolWindowGroup(String)

removeToolWindowGroup

boolean removeToolWindowGroup(ToolWindowGroup toolWindowGroup)
Removes the tool window group from this manager if it is registered.

Parameters:
toolWindowGroup - the group to be removed from the manager.
Returns:
true if the group is registered into this manager, false otherwise.
Since:
1.3.1
See Also:
getToolWindowGroup(String)

containsGroup

boolean containsGroup(java.lang.String name)
Returns true if this manager contains a group for the specified name.

Parameters:
name - name whose presence in this manager is to be tested.
Returns:
true if this manager contains a group for the specified name.
Since:
1.0.0

getDockable

Dockable getDockable(java.lang.Object id)
Returns the dockable to which this manager maps the specified id. Returns null if the manager contains no mapping for this id.

Parameters:
id - id of dockable.
Returns:
registered dockable with specified id. If there is no registered dockable with specified id then the method returns null.
Since:
1.4.0
See Also:
Dockable

getToolWindowBar

ToolWindowBar getToolWindowBar(ToolWindowAnchor anchor)
Returns the instance of ToolWindowBar related to the specified anchor.

Parameters:
anchor - for which the related instance of ToolWindowBar is to be returned.
Returns:
the instance of ToolWindowBar related to the specified anchor.
Since:
1.4.2

getTypeDescriptorTemplate

ToolWindowTypeDescriptor getTypeDescriptorTemplate(ToolWindowType type)
Returns the template type descrptor for type. Any modifications to those templates will be reflected on all registered tool windows.

Parameters:
type - type whose template is to be returned from the manager.
Returns:
the type descrptor for type.
Throws:
java.lang.IllegalArgumentException - - if doen't exist a template for type.
Since:
1.0.0
See Also:
ToolWindowType, ToolWindowTypeDescriptor

addToolWindowManagerListener

void addToolWindowManagerListener(ToolWindowManagerListener listener)
Registers listener so that it will receive events when the toolwindows and groups are registered or removed.. If listener listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the ToolWindowManagerListener to register.
Since:
1.0.0
See Also:
ToolWindowManagerListener

removeToolWindowManagerListener

void removeToolWindowManagerListener(ToolWindowManagerListener listener)
Unregisters listener so that it will no longer receive events. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this group. If listener listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the ToolWindowManagerListener to be removed
Since:
1.0.0
See Also:
addToolWindowManagerListener(ToolWindowManagerListener)

getToolWindowManagerListeners

ToolWindowManagerListener[] getToolWindowManagerListeners()
Returns an array of all the tool window manager listeners registered on this manager.

Returns:
all of the group's ToolWindowManagerListeners or an empty array if no tool window manager listeners are currently registered.
Since:
1.0.0
See Also:
addToolWindowManagerListener(ToolWindowManagerListener), removeToolWindowManagerListener(ToolWindowManagerListener)


Copyright © 2008. All Rights Reserved.