org.noos.xing.mydoggy
Interface ToolWindowManager

All Superinterfaces:
DockableManager<ToolWindow>

public interface ToolWindowManager
extends DockableManager<ToolWindow>

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 addToolWindowManagerListener(ToolWindowManagerListener listener)
          Registers listener so that it will receive events when the toolwindows and groups are registered or removed..
 boolean containsGroup(String name)
          Returns true if this manager contains a group for the specified name.
 Object getActiveToolWindowId()
          Returns the id of currently active tool window.
 ContentManager getContentManager()
          Returns the instance of ContentManager that manages main window contents.
 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(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(Object alias)
          Deprecated. use getToolWindow(Object) instead.
 ToolWindowGroup getToolWindowGroup()
          Returns a special group that contains all toolwindows registered in this manager.
 ToolWindowGroup getToolWindowGroup(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.
 Dockable lookupDockable(Object key)
          Returns the dockable to which a dockable manager (this manager, the content manager or a toolwindow) maps the specified id.
 ToolWindow registerToolWindow(String id, String title, Icon icon, Component component, ToolWindowAnchor anchor)
          Register a new tool window into this window manager based on the passed parameters.
 boolean removeToolWindowGroup(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(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
addAlias, addDockableManagerListener, getAliases, getDockableById, getDockableManagerListeners, getDockables, removeAlias, 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(String id,
                              String title,
                              Icon icon,
                              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:
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(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:
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

getToolWindowByAlias

ToolWindow getToolWindowByAlias(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

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(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(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(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(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

lookupDockable

Dockable lookupDockable(Object key)
Returns the dockable to which a dockable manager (this manager, the content manager or a toolwindow) maps the specified id. Returns null if the no manager contains a mapping for this id.

Parameters:
key - dockable's id or alias.
Returns:
registered dockable with specified id. If there is no registered dockable with specified id then the method returns null.
Since:
1.5.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:
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 © 2012. All Rights Reserved.