org.noos.xing.mydoggy
Interface ToolWindow

All Superinterfaces:
Dockable<ToolWindowManager>, DockableManager, Observable

public interface ToolWindow
extends Dockable<ToolWindowManager>, DockableManager

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 addToolWindowListener(ToolWindowListener listener)
          Adds the specified toolwindow listener to receive toolwindow events from this tool.
 ToolWindowTab addToolWindowTab(Dockable dockable)
          Adds a dockable.
 ToolWindowTab addToolWindowTab(java.lang.String title, java.awt.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 aggregationPosition)
          Agggregate this tool to the already visible tools using the specified aggregation position.
 void aggregate(ToolWindow toolWindow, AggregationPosition aggregationPosition)
          Aggregate this tool to the already visible tools using the specified toolwindow as a relative position and the aggregation position as the position relative to the specified toolwindow.
 ToolWindowAnchor getAnchor()
          Returns the anchor which the tool is anchored.
 int getAnchorIndex()
          Returns the anchor index.
 int getIndex()
          Returns the tool's index.
 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(java.lang.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 use to modify the behaviours of the 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 isRepresentativeAnchorButtonVisible()
          Returns true if the representative anchor button is visible, false otherwise.
 boolean isVisible()
          Returns true is the tool is visible.
 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 setIndex(int index)
          This method is used to set the index for the tool.
 void setRepresentativeAnchorButtonVisible(boolean visible)
          Enable or disable the representative anchor button.
 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
addDockableManagerListener, getDockableManagerListeners, 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.

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 aggregationPosition)
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:
aggregationPosition - the position used to aggregate the tool.
Since:
1.4.0

aggregate

void aggregate(ToolWindow toolWindow,
               AggregationPosition aggregationPosition)
Aggregate this tool to the already visible tools using the specified toolwindow 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:
toolWindow - the toolwindow used as relative position.
aggregationPosition - the position used to aggregate the tool.
Since:
1.4.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:
()

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 showed, 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

setRepresentativeAnchorButtonVisible

void setRepresentativeAnchorButtonVisible(boolean visible)
Enable or disable the representative anchor button. The method throw an exception when it is called on a tool whose type is FLOATING_FREE.

Parameters:
visible - true to enable make visible the representative anchor button, false otherwise.
Since:
1.4.0

isRepresentativeAnchorButtonVisible

boolean isRepresentativeAnchorButtonVisible()
Returns true if the representative anchor button is visible, false otherwise.

Returns:
true if the representative anchor button is visible, false otherwise.

addToolWindowTab

ToolWindowTab addToolWindowTab(java.lang.String title,
                               java.awt.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

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 use to modify the behaviours of the 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(java.lang.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


Copyright © 2008. All Rights Reserved.