use of com.intellij.openapi.wm.ToolWindow in project android by JetBrains.
the class AndroidMonitorToolWindow method updateToolWindow.
public void updateToolWindow() {
ToolWindowManager manager = ToolWindowManager.getInstance(myProject);
ToolWindow window = manager.getToolWindow(AndroidMonitorToolWindowFactory.ID);
boolean maximize = myProfilers.getMode() == ProfilerMode.EXPANDED;
if (maximize != manager.isMaximized(window)) {
manager.setMaximized(window, maximize);
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class GitShowCommitInLogAction method actionPerformed.
@Override
public void actionPerformed(@NotNull AnActionEvent event) {
final Project project = event.getRequiredData(CommonDataKeys.PROJECT);
final VcsRevisionNumber revision = getRevisionNumber(event);
if (revision == null) {
return;
}
boolean logReady = findLog(project) != null;
final ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ChangesViewContentManager.TOOLWINDOW_ID);
ContentManager cm = window.getContentManager();
Content[] contents = cm.getContents();
for (Content content : contents) {
if (VcsLogContentProvider.TAB_NAME.equals(content.getDisplayName())) {
cm.setSelectedContent(content);
break;
}
}
final VcsLog log = findLog(project);
if (log == null) {
showLogNotReadyMessage(project);
return;
}
Runnable selectAndOpenLog = new Runnable() {
@Override
public void run() {
Runnable selectCommit = new Runnable() {
@Override
public void run() {
jumpToRevisionUnderProgress(project, log, revision);
}
};
if (!window.isVisible()) {
window.activate(selectCommit, true);
} else {
selectCommit.run();
}
}
};
if (logReady) {
selectAndOpenLog.run();
return;
}
VcsProjectLog projectLog = VcsProjectLog.getInstance(project);
if (projectLog == null) {
showLogNotReadyMessage(project);
return;
}
VcsLogUiImpl logUi = projectLog.getMainLogUi();
if (logUi == null) {
showLogNotReadyMessage(project);
return;
}
logUi.invokeOnChange(selectAndOpenLog);
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ExternalSystemUtil method ensureToolWindowInitialized.
public static void ensureToolWindowInitialized(@NotNull Project project, @NotNull ProjectSystemId externalSystemId) {
try {
ToolWindowManager manager = ToolWindowManager.getInstance(project);
if (!(manager instanceof ToolWindowManagerEx)) {
return;
}
ToolWindowManagerEx managerEx = (ToolWindowManagerEx) manager;
String id = externalSystemId.getReadableName();
ToolWindow window = manager.getToolWindow(id);
if (window != null) {
return;
}
ToolWindowEP[] beans = Extensions.getExtensions(ToolWindowEP.EP_NAME);
for (final ToolWindowEP bean : beans) {
if (id.equals(bean.id)) {
managerEx.initToolWindow(bean);
}
}
} catch (Exception e) {
LOG.error(String.format("Unable to initialize %s tool window", externalSystemId.getReadableName()), e);
}
}
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);
}
Aggregations