use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class TestsUIUtil method notifyByBalloon.
public static void notifyByBalloon(@NotNull final Project project, final AbstractTestProxy root, final TestConsoleProperties properties, TestResultPresentation testResultPresentation) {
if (project.isDisposed())
return;
if (properties == null)
return;
TestStatusListener.notifySuiteFinished(root, properties.getProject());
final String testRunDebugId = properties.isDebug() ? ToolWindowId.DEBUG : ToolWindowId.RUN;
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
final String title = testResultPresentation.getTitle();
final String text = testResultPresentation.getText();
final String balloonText = testResultPresentation.getBalloonText();
final MessageType type = testResultPresentation.getType();
if (!Comparing.strEqual(toolWindowManager.getActiveToolWindowId(), testRunDebugId)) {
toolWindowManager.notifyByBalloon(testRunDebugId, type, balloonText, null, null);
}
NOTIFICATION_GROUP.createNotification(balloonText, type).notify(project);
SystemNotifications.getInstance().notify("TestRunner", title, text);
}
use of com.intellij.openapi.wm.ToolWindowManager in project intellij-community by JetBrains.
the class NextSplitAction method update.
public void update(final AnActionEvent event) {
final Project project = event.getProject();
final Presentation presentation = event.getPresentation();
if (project == null) {
presentation.setEnabled(false);
return;
}
final FileEditorManagerEx manager = FileEditorManagerEx.getInstanceEx(project);
final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
presentation.setEnabled(toolWindowManager.isEditorComponentActive() && manager.isInSplitter() && manager.getCurrentWindow() != null);
}
use of com.intellij.openapi.wm.ToolWindowManager 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.ToolWindowManager in project intellij-community by JetBrains.
the class BaseToolWindowToggleAction method isSelected.
@Override
public final boolean isSelected(AnActionEvent e) {
Project project = e.getProject();
if (project == null || project.isDisposed()) {
return false;
}
ToolWindowManager mgr = ToolWindowManager.getInstance(project);
String id = mgr.getActiveToolWindowId();
if (id == null) {
return false;
}
return isSelected(mgr.getToolWindow(id));
}
use of com.intellij.openapi.wm.ToolWindowManager 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);
}
Aggregations