Using ToolWindow

To Show or Hide

Use the following :
ToolWindow tool = toolWindowManager.getToolWindow(0);
tool.setVisibile(true); // false to hide                    

The tool shows or hides the component in a way that depends on tool window type.

There is an another way to show a tool. You can use the aggregate methedo

ToolWindow tool = toolWindowManager.getToolWindow(0);
tool.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 than these two tools will be aggregate to be visible both.

To Activate

Use the following :
ToolWindow tool = toolWindowManager.getToolWindow(0);
tool.setActive(true); // false to deactivate

The tool grabs the focus from focus owner and becomes active.

To Move

Use the following :
ToolWindow tool = toolWindowManager.getToolWindow(0);
tool.setAnchor(ToolWindowAnchor.TOP);

The anchor specifies the position of the tool when it is anchored to the docking system.

Flashing

Use the following :
ToolWindow tool = toolWindowManager.getToolWindow(0);
tool.setFlashing(true); // false to disable

Sets the flashing mode. If the flashing mode is enabled then the toolwindow representative button will be flashing until the tool will be made visible. If the tool is visible but not active then the toolwindow title bar will be flashing until the tool will be made visible.

You can use setFlashing(int) to enable flashing for a specific duration.

Add PropertyChangeListener

Use the following :
ToolWindow tool = toolWindowManager.getToolWindow(0);
tool.setAnchor(ToolWindowAnchor.TOP);

Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class, including the following:

  • this tool's index ("index")
  • this tool's aailable status ("available")
  • this tool's visible status ("visible")
  • this tool's active status ("active")
  • this tool's anchor ("anchor")
  • this tool's autoHide ("autoHide")
  • this tool's type ("type")
  • this tool's icon ("icon")
  • this tool's title ("title")

Using ToolWindowTab

To add

Use the following :
ToolWindow tool = toolWindowManager.getToolWindow(0);
tool.addToolWindowTab("Title", component);
Adds a component represented by a title and no icon.

Using DockedTypeDescriptor

Enable/Disable PopupMenu

Use the following :
DockedTypeDescriptor desc = (DockedTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.DOCKED);
desc.setPopupMenuEnabled(true); // false to denie.
So you can Specifies whether the popup menu of the representative anchor button of the tool should be enabled.

Tools Menu

Use the following to retrieve the tools menu:
DockedTypeDescriptor desc = (DockedTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.DOCKED);
JMenu menu = desc.getToolsMenu();
menu.addJMenuItem(new JMenuItem("Hello World!!!");
The user can add specific menu items to the popup menu of the representative anchor button of the tool using the result of this method invocation.

Dock Panel Length

Use the following:
DockedTypeDescriptor desc = (DockedTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.DOCKED);
desc.setDockLength(150);
Sets the width or heigth, based on anchor of tool window, of the dock panel. This value is used by DOCKED and SLIDING tool window type.

ToolWindowActionHandler

Use the following:
DockedTypeDescriptor desc = (DockedTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.DOCKED);
desc.setToolWindowActionHandler(new ToolWindowActionHandler(){...});

Enable Preview Mode

Use the following :
DockedTypeDescriptor desc = (DockedTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.DOCKED);
desc.setPreviewEnabled(true); // false to disable
Sets the preview mode. If the preview mode is enabled then when the mouse waits on the toolwindow representative button after a delay time the preview will become visible.

You can use setPreviewTransparentRatio and setPreviewDelay methods to set transparency paramenters and delay.

Using SlidingTypeDescriptor

Enable Transparent Mode

Use the following :
SlidingTypeDescriptor desc = (SlidingTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.SLIDING);
desc.setTransparentMode(true); // false to disable
Sets the transparent mode. If the transparent mode is enabled then when the toolwindow's content losts the focus it becomes transparent. This facility is os-independent.

You can use setTransparentRatio and setTransparentDelay methods to set transparency paramenters and delay.

Enable/Disable

Use the following :
SlidingTypeDescriptor desc = (SlidingTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.SLIDING);
desc.setEnabled(true); // false to disable
Enables or disables this mode, depending on the value of the parameter enabled. An enabled mode can used by user. This Mode is enabled initially by default.

Using FloatingTypeDescriptor

Enable Transparent Mode

Use the following :
FloatingTypeDescriptor desc = (FloatingTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.SLIDING);
desc.setTransparentMode(true); // false to disable

Sets the transparent mode. If the transparent mode is enabled then when the window used by FLOATING and FLOATING_FREE type losts the focus it becomes transparent. This facility is os-dependent.

You can use setTransparentRatio and setTransparentDelay methods to set transparency paramenters and delay.

Enable/Disable

Use the following :
FloatingTypeDescriptor desc = (FloatingTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.SLIDING);
desc.setEnabled(true); // false to disable

Enables or disables this mode, depending on the value of the parameter enabled. An enabled mode can used by user. This Mode is enabled initially by default.

Change Window Position

Use the following :
FloatingTypeDescriptor desc = (FloatingTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.SLIDING);
desc.setPosition(150, 220);

Sets the window location. This location is also used the first time the window becomes visible. The top-left corner of the new location is specified by the x and y parameters in the system coordinate space.

Change Window Size

Use the following :
FloatingTypeDescriptor desc = (FloatingTypeDescriptor) debugTool.getTypeDescriptor(ToolWindowType.SLIDING);
desc.setSize(320, 200);

Sets the window size. This size is also used the first time the window becomes visible.