use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class TestResultsPanel method splitVertically.
private boolean splitVertically() {
final String windowId = myProperties.getExecutor().getToolWindowId();
final ToolWindow toolWindow = ToolWindowManager.getInstance(myProperties.getProject()).getToolWindow(windowId);
boolean splitVertically = false;
if (toolWindow != null) {
final ToolWindowAnchor anchor = toolWindow.getAnchor();
splitVertically = anchor == ToolWindowAnchor.LEFT || anchor == ToolWindowAnchor.RIGHT;
}
return splitVertically;
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class ShowContentAction method getWindow.
@Nullable
private ToolWindow getWindow(AnActionEvent event) {
if (myWindow != null)
return myWindow;
Project project = event.getProject();
if (project == null)
return null;
ToolWindowManager manager = ToolWindowManager.getInstance(project);
final ToolWindow window = manager.getToolWindow(manager.getActiveToolWindowId());
if (window == null)
return null;
final Component context = PlatformDataKeys.CONTEXT_COMPONENT.getData(event.getDataContext());
if (context == null)
return null;
return SwingUtilities.isDescendingFrom(window.getComponent(), context) ? window : null;
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class BaseToolWindowToggleAction method update.
@Override
public final void update(AnActionEvent e) {
super.update(e);
Presentation presentation = e.getPresentation();
Project project = e.getProject();
if (project == null) {
presentation.setEnabled(false);
return;
}
ToolWindowManager mgr = ToolWindowManager.getInstance(project);
String id = mgr.getActiveToolWindowId();
if (id == null) {
presentation.setEnabled(false);
return;
}
ToolWindow window = mgr.getToolWindow(id);
if (window == null) {
presentation.setEnabled(false);
return;
}
update(window, presentation);
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class CloseActiveTabAction method actionPerformed.
public void actionPerformed(AnActionEvent e) {
ContentManager contentManager = ContentManagerUtil.getContentManagerFromContext(e.getDataContext(), true);
boolean processed = false;
if (contentManager != null && contentManager.canCloseContents()) {
final Content selectedContent = contentManager.getSelectedContent();
if (selectedContent != null && selectedContent.isCloseable()) {
contentManager.removeContent(selectedContent, true);
processed = true;
}
}
if (!processed && contentManager != null) {
final DataContext context = DataManager.getInstance().getDataContext(contentManager.getComponent());
final ToolWindow tw = PlatformDataKeys.TOOL_WINDOW.getData(context);
if (tw != null) {
tw.hide(null);
}
}
}
use of com.intellij.openapi.wm.ToolWindow in project intellij-community by JetBrains.
the class LafManagerImpl method updateToolWindows.
public static void updateToolWindows() {
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
for (String id : toolWindowManager.getToolWindowIds()) {
final ToolWindow toolWindow = toolWindowManager.getToolWindow(id);
for (Content content : toolWindow.getContentManager().getContents()) {
final JComponent component = content.getComponent();
if (component != null) {
IJSwingUtilities.updateComponentTreeUI(component);
}
}
final JComponent c = toolWindow.getComponent();
if (c != null) {
IJSwingUtilities.updateComponentTreeUI(c);
}
}
}
}
Aggregations