use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ExternalSystemUtil method ensureToolWindowContentInitialized.
@Nullable
public static ToolWindow ensureToolWindowContentInitialized(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
if (toolWindowManager == null)
return null;
final ToolWindow toolWindow = toolWindowManager.getToolWindow(externalSystemId.getReadableName());
if (toolWindow == null)
return null;
if (toolWindow instanceof ToolWindowImpl) {
((ToolWindowImpl) toolWindow).ensureContentInitialized();
}
return toolWindow;
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class SliceManager method createToolWindow.
public void createToolWindow(boolean dataFlowToThis, @NotNull SliceRootNode rootNode, boolean splitByLeafExpressions, @NotNull String displayName) {
final SliceToolwindowSettings sliceToolwindowSettings = SliceToolwindowSettings.getInstance(myProject);
final ContentManager contentManager = getContentManager(dataFlowToThis);
final Content[] myContent = new Content[1];
ToolWindow toolWindow = ToolWindowManager.getInstance(myProject).getToolWindow(dataFlowToThis ? BACK_TOOLWINDOW_ID : FORTH_TOOLWINDOW_ID);
final SlicePanel slicePanel = new SlicePanel(myProject, dataFlowToThis, rootNode, splitByLeafExpressions, toolWindow) {
@Override
protected void close() {
super.close();
contentManager.removeContent(myContent[0], true);
}
@Override
public boolean isAutoScroll() {
return sliceToolwindowSettings.isAutoScroll();
}
@Override
public void setAutoScroll(boolean autoScroll) {
sliceToolwindowSettings.setAutoScroll(autoScroll);
}
@Override
public boolean isPreview() {
return sliceToolwindowSettings.isPreview();
}
@Override
public void setPreview(boolean preview) {
sliceToolwindowSettings.setPreview(preview);
}
};
myContent[0] = contentManager.getFactory().createContent(slicePanel, displayName, true);
contentManager.addContent(myContent[0]);
contentManager.setSelectedContent(myContent[0]);
toolWindow.activate(null);
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ExternalToolWindowManager method getToolWindow.
@Nullable
private static ToolWindow getToolWindow(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
if (toolWindowManager == null) {
return null;
}
ToolWindow result = toolWindowManager.getToolWindow(externalSystemId.getReadableName());
if (result instanceof ToolWindowImpl) {
((ToolWindowImpl) result).ensureContentInitialized();
}
return result;
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class RunDashboardManagerImpl method updateDashboard.
private void updateDashboard(final boolean withStructure) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(myProject);
toolWindowManager.invokeLater(() -> {
if (myProject.isDisposed()) {
return;
}
if (withStructure) {
boolean available = hasContent();
ToolWindow toolWindow = toolWindowManager.getToolWindow(getToolWindowId());
if (toolWindow == null) {
if (available) {
createToolWindow();
}
return;
}
boolean doShow = !toolWindow.isAvailable() && available;
toolWindow.setAvailable(available, null);
if (doShow) {
toolWindow.show(null);
}
}
if (myDashboardContent != null) {
myDashboardContent.updateContent(withStructure);
}
});
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ExecutionHelper method descriptorToFront.
private static void descriptorToFront(@NotNull final Project project, @NotNull final RunContentDescriptor descriptor) {
ApplicationManager.getApplication().invokeLater(() -> {
RunContentManager manager = ExecutionManager.getInstance(project).getContentManager();
ToolWindow toolWindow = manager.getToolWindowByDescriptor(descriptor);
if (toolWindow != null) {
toolWindow.show(null);
manager.selectRunContent(descriptor);
}
}, project.getDisposed());
}
Aggregations