Example usage for com.intellij.openapi.wm ToolWindowType WINDOWED

List of usage examples for com.intellij.openapi.wm ToolWindowType WINDOWED

Introduction

In this page you can find the example usage for com.intellij.openapi.wm ToolWindowType WINDOWED.

Prototype

ToolWindowType WINDOWED

To view the source code for com.intellij.openapi.wm ToolWindowType WINDOWED.

Click Source Link

Usage

From source file:com.intellij.ide.actions.ToggleWindowedModeAction.java

License:Apache License

@Override
public boolean isSelected(AnActionEvent event) {
    Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
    if (project == null) {
        return false;
    }//from w w w .ja v a 2  s. co m
    ToolWindowManager windowManager = ToolWindowManager.getInstance(project);
    String id = windowManager.getActiveToolWindowId();
    if (id == null) {
        return false;
    }
    return ToolWindowType.WINDOWED == windowManager.getToolWindow(id).getType();
}

From source file:com.intellij.ide.actions.ToggleWindowedModeAction.java

License:Apache License

@Override
public void setSelected(AnActionEvent event, boolean flag) {
    Project project = CommonDataKeys.PROJECT.getData(event.getDataContext());
    if (project == null) {
        return;/*from  www  .  jav  a2 s .c o m*/
    }
    String id = ToolWindowManager.getInstance(project).getActiveToolWindowId();
    if (id == null) {
        return;
    }
    ToolWindowManagerEx mgr = ToolWindowManagerEx.getInstanceEx(project);
    ToolWindowEx toolWindow = (ToolWindowEx) mgr.getToolWindow(id);
    ToolWindowType type = toolWindow.getType();
    if (ToolWindowType.WINDOWED == type) {
        toolWindow.setType(toolWindow.getInternalType(), null);
    } else {
        toolWindow.setType(ToolWindowType.WINDOWED, null);
    }
}