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);
}
}
}
});
}
Aggregations