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); }
@Override public void onScopeEnd(@NotNull BlazeContext context) { if (project.isDisposed()) { return; } if (context.isCancelled()) { context.output(new StatusOutput(notificationName + " cancelled")); return; } long duration = System.currentTimeMillis() - startTime; if (duration < NOTIFICATION_THRESHOLD_MS) { return; } String notificationText = !context.hasErrors() ? this.notificationText : this.notificationErrorText; SystemNotifications.getInstance().notify(notificationName, notificationTitle, notificationText); if (context.hasErrors()) { context.output(PrintOutput.error(notificationName + " failed")); } }
private void notify(final String msg, final MessageType type, final SMTestProxy.SMRootTestProxy testsRoot) { SwingUtilities.invokeLater(new Runnable() { public void run() { final Project project = myConsoleProperties.getProject(); if ( project.isDisposed()) { return; } if (myConsoleProperties == null) { return; } final String testRunDebugId = myConsoleProperties.isDebug() ? ToolWindowId.DEBUG : ToolWindowId.RUN; final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project); if (!Comparing.strEqual(toolWindowManager.getActiveToolWindowId(), testRunDebugId)) { toolWindowManager.notifyByBalloon(testRunDebugId, type, msg, null, null); } TestsUIUtil.NOTIFICATION_GROUP.createNotification(msg, type).notify(project); SystemNotifications.getInstance().notify("TestRunner", msg, TestsUIUtil.getTestShortSummary(testsRoot)); } }); }
public static void notifyByBalloon(@Nonnull 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); }
public static void showSystemNotificationIfNotActive( @NotNull Project project, @NotNull String notificationName, @NotNull String notificationTitle, @NotNull String notificationText ) { final JFrame frame = WindowManager.getInstance().getFrame(project); if (frame != null && !frame.hasFocus()) { SystemNotifications.getInstance().notify(notificationName, notificationTitle, notificationText); } }
public static void notifyByBalloon(@NotNull final Project project, boolean started, final AbstractTestProxy root, final TestConsoleProperties properties, @Nullable final String comment) { if (project.isDisposed()) return; if (properties == null) return; final String testRunDebugId = properties.isDebug() ? ToolWindowId.DEBUG : ToolWindowId.RUN; final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project); String title; String text; String balloonText; MessageType type; TestResultPresentation testResultPresentation = new TestResultPresentation(root, started, comment).getPresentation(); type = testResultPresentation.getType(); balloonText = testResultPresentation.getBalloonText(); title = testResultPresentation.getTitle(); text = testResultPresentation.getText(); 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); }
public static void notifySystemCommandFinished(String commandName, boolean processExitStatus) { SystemNotifications.getInstance() .notify( GROUP_DISPLAY_ID, StringUtil.capitalize(commandName) + " Finished", processExitStatus ? "Successful" : "Failed"); }
private static void systemNotify(@NotNull Task.NotificationInfo info) { SystemNotifications.getInstance().notify(info.getNotificationName(), info.getNotificationTitle(), info.getNotificationText()); }
private static void systemNotify(final Task.NotificationInfo notificationInfo) { SystemNotifications.getInstance().notify(notificationInfo.getNotificationName(), notificationInfo.getNotificationTitle(), notificationInfo.getNotificationText()); }
private static void systemNotify(@Nonnull Task.NotificationInfo info) { SystemNotifications.getInstance().notify(info.getNotificationName(), info.getNotificationTitle(), info.getNotificationText()); }