org.noos.xing.mydoggy
Interface ToolWindow

All Superinterfaces:
Dockable<ToolWindowManager>, DockableManager<ToolWindowTab>, Observable

public interface ToolWindow
extends Dockable<ToolWindowManager>, DockableManager<ToolWindowTab>

Tool Windows are secondary windows within the main window that provide access to and/or support for a particular functionality. This interface is the main entry point to modify tool window properties. Moreover there are methods to make the tool available, visible and active. A PropertyChangeEvent is fired for the following properties:

Since:
1.0.0
Author:
Angelo De Caro (angelo.decaro@gmail.com)
See Also:
ToolWindowManager

Method Summary
 void addToolWindowAction(ToolWindowAction toolWindowAction)
          Adds the passed toolwindow action to all the type descriptors.
 void addToolWindowListener(ToolWindowListener listener)
          Adds the specified toolwindow listener to receive toolwindow events from this tool.
 ToolWindowTab addToolWindowTab(Dockable dockable)
          Adds a dockable.
 ToolWindowTab addToolWindowTab(String title, Component component)
          Adds a component represented by a title and no icon.
 void aggregate()
          The method is used to set to the true value the visible property of the tool.
 void aggregate(AggregationPosition onPosition)
          Agggregate this tool to the already visible tools using the specified aggregation position.
 void aggregate(ToolWindow onToolWindow, AggregationPosition onPosition)
          Aggregate this tool using onToolWindow as a relative position and the aggregation position as the position relative to the specified toolwindow.
 void aggregateByReference(ToolWindow refToolWindow, AggregationPosition onPosition)
          This method is used when the user want to aggregate the toolwindow to another toolwindow whose type is FLOATING, FLOATING_FREE or FLOATING_LIVE.
 ToolWindowAnchor getAnchor()
          Returns the anchor which the tool is anchored.
 int getAnchorIndex()
          Returns the anchor index.
 int getIndex()
          Returns the tool's index.
 RepresentativeAnchorDescriptor<ToolWindow> getRepresentativeAnchorDescriptor()
          Returns the representative anchor descriptor used to modify the behaviours of that object.
 ToolWindowListener[] getToolWindowListeners()
          Returns an array of all the toolwindow listeners registered on this tool.
 ToolWindowTab[] getToolWindowTabs()
          Gets all the tabs in this toolwindow.
 ToolWindowType getType()
          Returns the tool type.
<T extends ToolWindowTypeDescriptor>
T
getTypeDescriptor(Class<T> descriptorClass)
          This method retrieves the TypeDescriptor for the descriptorClass.
 ToolWindowTypeDescriptor getTypeDescriptor(ToolWindowType type)
          This method retrieves the TypeDescriptor for type that the tool uses to modify the behaviours of that type.
 boolean isActive()
          Returns true is the tool is active.
 boolean isAggregateMode()
          Returns aggregateEnabled property value.
 boolean isAutoHide()
          Returns the autoHide property value of the tool.
 boolean isAvailable()
          Returns true is the tool is available.
 boolean isHideOnZeroTabs()
          Return the "hideOnZeroTabs" property value.
 boolean isLockedOnAnchor()
          Returns true if the toolwindow's representative anchor is bonded to a subset of the available anchors, false otherwise.
 boolean isVisible()
          Returns true is the tool is visible.
 void removeToolWindowAction(String id)
          Removes the toolwindow action by id from all the type descriptors.
 void removeToolWindowListener(ToolWindowListener listener)
          Removes the specified toolwindow listener so that it no longer receives toolwindow events from this tool.
 boolean removeToolWindowTab(ToolWindowTab toolWindowTab)
          Removes the specified tab from this toolwindow.
 void setActive(boolean active)
          The method is used to set the active property of the tool.
 void setAggregateMode(boolean aggregateEnabled)
          The method is used to set the aggregateEnabled property of the tool.
 void setAnchor(ToolWindowAnchor anchor)
          This method is used to set the anchor for the tool.
 void setAnchor(ToolWindowAnchor anchor, int index)
          This method is used to set the anchor for the tool.
 void setAutoHide(boolean autoHide)
          This method is used to set the autoHide property for the tool.
 void setAvailable(boolean available)
          The method is used to set the available property of the tool.
 void setHideOnZeroTabs(boolean hideOnZeroTabs)
          Sets the "hideOnZeroTabs" property.
 void setIndex(int index)
          This method is used to set the index for the tool.
 void setLockedOnAnchor(boolean lockedOnAnchor)
          Bounds or not the toolwindow's representative anchro to stay in a subset of the available anchors.
 void setType(ToolWindowType type)
          This method is used to set the type for the tool.
 void setVisible(boolean visible)
          The method is used to set the visible property of the tool.
 
Methods inherited from interface org.noos.xing.mydoggy.Dockable
ensureVisible, getComponent, getDockableManager, getIcon, getId, getTitle, isDetached, isFlashing, isMaximized, isMinimized, isSelected, setDetached, setFlashing, setFlashing, setIcon, setMaximized, setMinimized, setSelected, setTitle
 
Methods inherited from interface org.noos.xing.mydoggy.Observable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.noos.xing.mydoggy.DockableManager
addAlias, addDockableManagerListener, getAliases, getDockableById, getDockableManagerListeners, getDockables, removeAlias, removeDockableManagerListener
 

Method Detail

setIndex

void setIndex(int index)
This method is used to set the index for the tool. The index is used to activate or hide the tool with that index when the user uses the key combination ALT-index. Valid indexs are -1 or [1..9] where -1 means no index for the tool.

Parameters:
index - the new index for the tool.
Since:
1.0.0
See Also:
Dockable.getIcon()

getIndex

int getIndex()
Returns the tool's index.

Returns:
tool's index.
Since:
1.0.0
See Also:
setIndex(int)

setAvailable

void setAvailable(boolean available)
The method is used to set the available property of the tool. If available is true then tool becomes available in a way that depends on tool window type. If available is false then tool becomes not available in a way that depends on tool window type.

Parameters:
available - true to make the tool available, false to make the tool not available.
Since:
1.0.0
See Also:
isAvailable(), setVisible(boolean)

isAvailable

boolean isAvailable()
Returns true is the tool is available.

Returns:
true is the tool is available, false otherwise.
Since:
1.0.0
See Also:
setAvailable(boolean)

setVisible

void setVisible(boolean visible)
The method is used to set the visible property of the tool. If visible is true then tool becomes available if not already was. Moreover the tool shows the component in a way that depends on tool window type and becomes visible. If visible is false then tool becomes not available if not already was. Moreover the tool hides the component in a way that depends on tool window type and becomes not visible.

Parameters:
visible - true to make the tool visible, false to make the tool not visible.
Since:
1.0.0
See Also:
isVisible()

isVisible

boolean isVisible()
Returns true is the tool is visible.

Specified by:
isVisible in interface Dockable<ToolWindowManager>
Returns:
true is the tool is vixible, false otherwise.
Since:
1.0.0
See Also:
setVisible(boolean)

aggregate

void aggregate()
The method is used to set to the true value the visible property of the tool. The tool becomes visible in a special way. In fact, if there is another tool visible with the same anchor then these two tools will be aggregate to be visible both.

Since:
1.2.0

aggregate

void aggregate(AggregationPosition onPosition)
Agggregate this tool to the already visible tools using the specified aggregation position. This method is usable also when the tool is already visible.

Parameters:
onPosition - the position used to aggregate the tool.
Since:
1.4.0

aggregate

void aggregate(ToolWindow onToolWindow,
               AggregationPosition onPosition)
Aggregate this tool using onToolWindow as a relative position and the aggregation position as the position relative to the specified toolwindow. This method is usable also when the tool is already visible.

Parameters:
onToolWindow - the toolwindow used as relative position. It must be already visible.
onPosition - the position used to aggregate the tool.
Since:
1.4.0

aggregateByReference

void aggregateByReference(ToolWindow refToolWindow,
                          AggregationPosition onPosition)
This method is used when the user want to aggregate the toolwindow to another toolwindow whose type is FLOATING, FLOATING_FREE or FLOATING_LIVE.

Parameters:
refToolWindow - the floating toolwindow used as aggregation target.
onPosition - the position used to aggregate the tool.
Since:
1.5.0

setAggregateMode

void setAggregateMode(boolean aggregateEnabled)
The method is used to set the aggregateEnabled property of the tool. If aggregateEnabled is true then every call to setVisible(true) will have the same behaviout of a call to aggregate() method.
Default value is false.

Parameters:
aggregateEnabled - true to translate every call to setVisible(true) to a call to aggregate() method, false to disable the translation.
Since:
1.3.0
See Also:
isAggregateMode()

isAggregateMode

boolean isAggregateMode()
Returns aggregateEnabled property value.

Returns:
the value of aggregateEnabled property.
Since:
1.3.0
See Also:
setAggregateMode(boolean)

setActive

void setActive(boolean active)
The method is used to set the active property of the tool. If active is true then tool becomes available and visibile if not already was. Moreover the tool grabs the focus from focus owner and becomes active. If active is false then the focus is passed to another component outer the tool and tool becomes not active.

Parameters:
active - true to make the tool active, false to deactivate the tool.
Since:
1.0.0
See Also:
setAvailable(boolean), setVisible(boolean)

isActive

boolean isActive()
Returns true is the tool is active.

Returns:
true is the tool is active, false otherwise.
Since:
1.0.0
See Also:
setActive(boolean)

setAnchor

void setAnchor(ToolWindowAnchor anchor)
This method is used to set the anchor for the tool. The anchor specifies the position of the tool when it is anchored to the docking system. The behaviour is equivalent to a call of the method setAnchor(anchor, -1).

Parameters:
anchor - the new anchor.
Since:
1.0.0
See Also:
ToolWindowAnchor, getAnchor()

setAnchor

void setAnchor(ToolWindowAnchor anchor,
               int index)
This method is used to set the anchor for the tool. The anchor specifies the position of the tool when it is anchored to the docking system. The index specifies the position relative to the other tools on the same anchor.

Parameters:
anchor - the new anchor.
index - the position relative to the other tools on the same anchor. Use 0 for the first position, -1 for the last position.
Since:
1.3.0
See Also:
ToolWindowAnchor, getAnchor()

getAnchor

ToolWindowAnchor getAnchor()
Returns the anchor which the tool is anchored.

Returns:
the anchor for the tool.
Since:
1.0.0
See Also:
s, ToolWindowAnchor

getAnchorIndex

int getAnchorIndex()
Returns the anchor index.

Returns:
anchor index.
Since:
1.4.0

setAutoHide

void setAutoHide(boolean autoHide)
This method is used to set the autoHide property for the tool.

Parameters:
autoHide - true to hide the tool when the tool losts focus; false to make inactive the tool when the tool losts focus.
Since:
1.0.0
See Also:
()

setLockedOnAnchor

void setLockedOnAnchor(boolean lockedOnAnchor)
Bounds or not the toolwindow's representative anchro to stay in a subset of the available anchors.

Parameters:
lockedOnAnchor - true if the toolwindow's representative anchor is bonded to a subset of the available anchors, false otherwise.
Since:
1.5.0

isLockedOnAnchor

boolean isLockedOnAnchor()
Returns true if the toolwindow's representative anchor is bonded to a subset of the available anchors, false otherwise.

Returns:
true if the toolwindow's representative anchor is bonded to a subset of the available anchors, false otherwise.
Since:
1.5.0

isAutoHide

boolean isAutoHide()
Returns the autoHide property value of the tool.

Returns:
autoHide property value.
Since:
1.0.0
See Also:
setAutoHide(boolean)

setType

void setType(ToolWindowType type)
This method is used to set the type for the tool. The type specifies the way the tool is shown, made available, etc.

Parameters:
type - the new type.
Since:
1.0.0
See Also:
ToolWindowType, getType()

getType

ToolWindowType getType()
Returns the tool type.

Returns:
the type for the tool.
Since:
1.0.0
See Also:
setType(ToolWindowType), ToolWindowType

setHideOnZeroTabs

void setHideOnZeroTabs(boolean hideOnZeroTabs)
Sets the "hideOnZeroTabs" property. When true is used this means that the tool is hidden when no tabs are available on it.

Parameters:
hideOnZeroTabs - true to hide the tool when no tabs are available on it, false otherwise.
Since:
1.5.0
See Also:
isHideOnZeroTabs()

isHideOnZeroTabs

boolean isHideOnZeroTabs()
Return the "hideOnZeroTabs" property value.

Returns:
true if the the tool is hidden when no tabs are available on it, false otherwise.
Since:
1.5.0
See Also:
setHideOnZeroTabs(boolean)

addToolWindowTab

ToolWindowTab addToolWindowTab(String title,
                               Component component)
Adds a component represented by a title and no icon.

Parameters:
title - the title to be displayed in this tab
component - the component to be displayed when this tab is clicked
Returns:
a ToolWindowTab instance
Since:
1.3.0

addToolWindowTab

ToolWindowTab addToolWindowTab(Dockable dockable)
Adds a dockable. A toolwindow tab is created to accommodate the dockable.

Parameters:
dockable - the dockable to be accommodated.
Returns:
a ToolWindowTab instance that represents the accommodated dockable.
Since:
1.4.0

removeToolWindowTab

boolean removeToolWindowTab(ToolWindowTab toolWindowTab)
Removes the specified tab from this toolwindow.

Parameters:
toolWindowTab - the tab to be removed
Returns:
true if this toolwindow contained the specified tab.
Since:
1.3.0
See Also:
addToolWindowTab(String, java.awt.Component)

getToolWindowTabs

ToolWindowTab[] getToolWindowTabs()
Gets all the tabs in this toolwindow.

Returns:
an array of all the tabs in this toolwindow.
Since:
1.3.0

addToolWindowAction

void addToolWindowAction(ToolWindowAction toolWindowAction)
Adds the passed toolwindow action to all the type descriptors.

Parameters:
toolWindowAction - the action to be added to all the type desccriptors.
Since:
1.5.0
See Also:
removeToolWindowAction(String)

removeToolWindowAction

void removeToolWindowAction(String id)
Removes the toolwindow action by id from all the type descriptors.

Parameters:
id - the id of the action to be removed from all the type descriptors.
Since:
1.5.0
See Also:
addToolWindowAction(ToolWindowAction)

addToolWindowListener

void addToolWindowListener(ToolWindowListener listener)
Adds the specified toolwindow listener to receive toolwindow events from this tool. If listener l is null, no exception is thrown and no action is performed.

Parameters:
listener - the toolwindow listener
Since:
1.3.0
See Also:
ToolWindowListener, removeToolWindowListener(ToolWindowListener), getToolWindowListeners()

removeToolWindowListener

void removeToolWindowListener(ToolWindowListener listener)
Removes the specified toolwindow listener so that it no longer receives toolwindow events from this tool. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this tool. If listener listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the toolwindow listener
Since:
1.3.0
See Also:
addToolWindowListener(ToolWindowListener)

getToolWindowListeners

ToolWindowListener[] getToolWindowListeners()
Returns an array of all the toolwindow listeners registered on this tool.

Returns:
all of this toolwindowt's ToolWindowListeners or an empty array if no toolwindow listeners are currently registered
Since:
1.3.0
See Also:
addToolWindowListener(ToolWindowListener)

getTypeDescriptor

ToolWindowTypeDescriptor getTypeDescriptor(ToolWindowType type)
This method retrieves the TypeDescriptor for type that the tool uses to modify the behaviours of that type. The modifications are visible only for this tool.

Parameters:
type - tool window type.
Returns:
the type descriptor for type.
Since:
1.0.0

getTypeDescriptor

<T extends ToolWindowTypeDescriptor> T getTypeDescriptor(Class<T> descriptorClass)
This method retrieves the TypeDescriptor for the descriptorClass.

Parameters:
descriptorClass - the descriptor class.
Returns:
the type descriptor for the descriptorClass.
Since:
1.4.0

getRepresentativeAnchorDescriptor

RepresentativeAnchorDescriptor<ToolWindow> getRepresentativeAnchorDescriptor()
Returns the representative anchor descriptor used to modify the behaviours of that object.

Returns:
the representative anchor descriptor used to modify the behaviours of that object.
Since:
1.5.0


Copyright © 2012. All Rights Reserved.