ToolWindow Types

A tool window can be showed in several ways. A ToolWindowType is used to choose between different viewing modes. Now we describe the types provided.

docked ToolWindowType.DOCKED - When DOCKED type is used, the tool window shares frame space and fixes to a docking area along one of the tool window bars (the one containing the corresponding representative button).

To set ToolWindowType.DOCKED type use the following:
ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
toolWindow.setType(ToolWindowType.DOCKED);
sliding ToolWindowType.SLIDING - When SLIDING type is used, the tool window overlaps the main frame and/or other tool windows. When it loses focus, the tool window hides itself.

To set ToolWindowType.SLIDING type use the following:
ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
toolWindow.setType(ToolWindowType.SLIDING);
floating ToolWindowType.FLOATING - This type enables a tool window to be detached from the main window frame. When Floating type is used, the tool window detaches to the position where it was last floated (or screen center or location used in toolwindow's FloatingTypeDescriptor , if never before floated)

To set ToolWindowType.FLOATING type use the following:
ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
toolWindow.setType(ToolWindowType.FLOATING);
floating free ToolWindowType.FLOATING_FREE - This type differs from FLOATING type for the absence of the representative button on the tool window bar.

To set ToolWindowType.FLOATING_FREE type use the following:
ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
toolWindow.setType(ToolWindowType.FLOATING_FREE);
floating live ToolWindowType.FLOATING_LIVE - This type enables a tool to be floating in the frame rather than having floating windows "out of the frame".

To set ToolWindowType.FLOATING_LIVE type use the following:
ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
toolWindow.setType(ToolWindowType.FLOATING_LIVE);

ToolWindow Type Descriptors

A ToolWindowTypeDescriptor is an interface to modify the behaviours of a specific tool window type. Go to the Using page to see how to use these interfaces.

  • DockedTypeDescriptor This interface is used to modify the behaviours of DOCKED type.

    To get a DockedTypeDescriptor instance use the following:
    ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
    DockedTypeDescriptor dockedTypeDescriptor = (DockedTypeDescriptor) toolWindow.getTypeDescriptor(ToolWindowType.DOCKED);
    // or
    DockedTypeDescriptor dockedTypeDescriptor = toolWindow.getTypeDescriptor(DockedTypeDescriptor.class);
                            
  • SlidingTypeDescriptor This interface is used to modify the behaviours of SLIDING type.

    To get a SlidingTypeDescriptor instance use the following:
    ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
    SlidingTypeDescriptor slidingTypeDescriptor = (SlidingTypeDescriptor) toolWindow.getTypeDescriptor(ToolWindowType.SLIDING);
  • FloatingTypeDescriptor This interface is used to modify the behaviours of FLOATING and FLOATING_FREE type.

    To get a FloatingTypeDescriptor instance use the following:
    ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
    FloatingTypeDescriptor typeDescriptor = (FloatingTypeDescriptor) toolWindow.getTypeDescriptor(ToolWindowType.FLOATING);
  • FloatingLiveTypeDescriptor This interface is used to modify the behaviours of FLOATING_LIVE type.

    To get a FloatingLiveTypeDescriptor instance use the following:
    ToolWindow toolWindow = toolWindowManager.getToolWindow("Debug");
    FloatingLiveTypeDescriptor typeDescriptor = (FloatingLiveTypeDescriptor) toolWindow.getTypeDescriptor(ToolWindowType.FLOATING_LIVE);