Search in sources :

Example 1 with RunDashboardManager

use of com.intellij.execution.dashboard.RunDashboardManager in project intellij-community by JetBrains.

the class RunContentManagerImpl method init.

// must be called on EDT
private void init() {
    ToolWindowManagerEx toolWindowManager = ToolWindowManagerEx.getInstanceEx(myProject);
    if (toolWindowManager == null) {
        return;
    }
    for (Executor executor : ExecutorRegistry.getInstance().getRegisteredExecutors()) {
        registerToolWindow(executor, toolWindowManager);
    }
    RunDashboardManager dashboardManager = RunDashboardManager.getInstance(myProject);
    initToolWindow(null, dashboardManager.getToolWindowId(), dashboardManager.getToolWindowIcon(), dashboardManager.getDashboardContentManager());
    toolWindowManager.addToolWindowManagerListener(new ToolWindowManagerAdapter() {

        @Override
        public void stateChanged() {
            if (myProject.isDisposed()) {
                return;
            }
            ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
            Set<String> currentWindows = new THashSet<>();
            ContainerUtil.addAll(currentWindows, toolWindowManager.getToolWindowIds());
            myToolwindowIdZBuffer.retainAll(currentWindows);
            final String activeToolWindowId = toolWindowManager.getActiveToolWindowId();
            if (activeToolWindowId != null) {
                if (myToolwindowIdZBuffer.remove(activeToolWindowId)) {
                    myToolwindowIdZBuffer.addFirst(activeToolWindowId);
                }
            }
        }
    });
}
Also used : THashSet(gnu.trove.THashSet) ToolWindowManager(com.intellij.openapi.wm.ToolWindowManager) ToolWindowManagerAdapter(com.intellij.openapi.wm.ex.ToolWindowManagerAdapter) RunDashboardManager(com.intellij.execution.dashboard.RunDashboardManager) ToolWindowManagerEx(com.intellij.openapi.wm.ex.ToolWindowManagerEx)

Aggregations

RunDashboardManager (com.intellij.execution.dashboard.RunDashboardManager)1 ToolWindowManager (com.intellij.openapi.wm.ToolWindowManager)1 ToolWindowManagerAdapter (com.intellij.openapi.wm.ex.ToolWindowManagerAdapter)1 ToolWindowManagerEx (com.intellij.openapi.wm.ex.ToolWindowManagerEx)1 THashSet (gnu.trove.THashSet)1