Java 类com.intellij.ui.SystemNotifications 实例源码

项目:intellij-ce-playground    文件:TestsUIUtil.java   
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);
}
项目:intellij    文件:NotificationScope.java   
@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"));
  }
}
项目:tools-idea    文件:SMTRunnerNotificationsHandler.java   
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));
    }
  });
}
项目:consulo    文件:TestsUIUtil.java   
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);
}
项目:hybris-integration-intellij-idea-plugin    文件:NotificationUtil.java   
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);
    }
}
项目:tools-idea    文件:TestsUIUtil.java   
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);
}
项目:buck    文件:BuckPluginNotifications.java   
public static void notifySystemCommandFinished(String commandName, boolean processExitStatus) {
  SystemNotifications.getInstance()
      .notify(
          GROUP_DISPLAY_ID,
          StringUtil.capitalize(commandName) + " Finished",
          processExitStatus ? "Successful" : "Failed");
}
项目:intellij-ce-playground    文件:ProgressManagerImpl.java   
private static void systemNotify(@NotNull Task.NotificationInfo info) {
  SystemNotifications.getInstance().notify(info.getNotificationName(), info.getNotificationTitle(), info.getNotificationText());
}
项目:tools-idea    文件:ProgressManagerImpl.java   
private static void systemNotify(final Task.NotificationInfo notificationInfo) {
  SystemNotifications.getInstance().notify(notificationInfo.getNotificationName(),
                                           notificationInfo.getNotificationTitle(),
                                           notificationInfo.getNotificationText());
}
项目:consulo    文件:ProgressManagerImpl.java   
private static void systemNotify(@Nonnull Task.NotificationInfo info) {
  SystemNotifications.getInstance().notify(info.getNotificationName(), info.getNotificationTitle(), info.getNotificationText());
}