Ejemplo n.º 1
0
 private static List<String> getMacrosFromExistingNotifications(Project project) {
   List<String> notified = ContainerUtil.newArrayList();
   NotificationsManager manager = NotificationsManager.getNotificationsManager();
   for (final UnknownMacroNotification notification :
       manager.getNotificationsOfType(UnknownMacroNotification.class, project)) {
     notified.addAll(notification.getMacros());
   }
   return notified;
 }
  private void showErrorNotification(boolean hasErrors) {
    NotificationsManager manager = NotificationsManager.getNotificationsManager();
    ErrorsFoundNotification[] notifications =
        manager.getNotificationsOfType(ErrorsFoundNotification.class, myProject);

    if (hasErrors) {
      // do not show notification if it is already shown
      if (notifications.length == 0) {
        new ErrorsFoundNotification(myProject).notify(myProject.isDefault() ? null : myProject);
      }
    } else {
      // expire notification
      for (ErrorsFoundNotification notification : notifications) {
        notification.expire();
      }
    }
  }