當前位置: 首頁>>代碼示例>>Java>>正文


Java NotificationType.ERROR屬性代碼示例

本文整理匯總了Java中com.intellij.notification.NotificationType.ERROR屬性的典型用法代碼示例。如果您正苦於以下問題:Java NotificationType.ERROR屬性的具體用法?Java NotificationType.ERROR怎麽用?Java NotificationType.ERROR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.intellij.notification.NotificationType的用法示例。


在下文中一共展示了NotificationType.ERROR屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: UnableToSaveProjectNotification

public UnableToSaveProjectNotification(@NotNull final Project project, @NotNull VirtualFile[] readOnlyFiles) {
  super("Project Settings", "Could not save project", "Unable to save project files. Please ensure project files are writable and you have permissions to modify them." +
                                                       " <a href=\"\">Try to save project again</a>.", NotificationType.ERROR, new NotificationListener() {
    @Override
    public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
      final UnableToSaveProjectNotification unableToSaveProjectNotification = (UnableToSaveProjectNotification)notification;
      final Project _project = unableToSaveProjectNotification.myProject;
      notification.expire();

      if (_project != null && !_project.isDisposed()) {
        _project.save();
      }
    }
  });

  myProject = project;
  myFiles = readOnlyFiles;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ProjectManagerImpl.java

示例2: getMaximumType

@Nullable
private static NotificationType getMaximumType(List<Notification> notifications) {
  NotificationType result = null;
  for (Notification notification : notifications) {
    if (NotificationType.ERROR == notification.getType()) {
      return NotificationType.ERROR;
    }

    if (NotificationType.WARNING == notification.getType()) {
      result = NotificationType.WARNING;
    }
    else if (result == null && NotificationType.INFORMATION == notification.getType()) {
      result = NotificationType.INFORMATION;
    }
  }

  return result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:IdeNotificationArea.java

示例3: showErrorNotification

private static void showErrorNotification(@NotNull Project project, String message, String responseString) {
  final JsonObject details = new JsonParser().parse(responseString).getAsJsonObject();
  final String detailString = details.get("detail").getAsString();
  final Notification notification =
    new Notification("Push.course", message, detailString, NotificationType.ERROR);
  notification.notify(project);
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:7,代碼來源:CCStepicConnector.java

示例4: getNotificationTypeForMessage

private NotificationType getNotificationTypeForMessage(LogMessage message)
{
    if (message.error()) {
        return NotificationType.ERROR;
    } else if (message.notice()) {
        return NotificationType.INFORMATION;
    }

    return NotificationType.WARNING;
}
 
開發者ID:ben-gibson,項目名稱:GitLink,代碼行數:10,代碼來源:EventLogHandler.java

示例5: forTmcException

/**
 * Generates a human readable error message for a {@link TmcCoreException} and decides the
 * error's severity.
 */
static PresentableErrorMessage forTmcException(TmcCoreException exception) {
    String causeMessage;

    if (exception.getCause() != null) {
        causeMessage = exception.getCause().getMessage();
    } else {
        causeMessage = exception.getMessage();
    }

    String shownMessage;
    NotificationType type = NotificationType.WARNING;

    if (causeMessage.contains("Download failed")
            || causeMessage.contains("404")
            || causeMessage.contains("500")) {
        shownMessage = notifyAboutCourseServerAddressAndInternet();
    } else if (!TmcSettingsManager.get().userDataExists()) {
        shownMessage = notifyAboutUsernamePasswordAndServerAddress(causeMessage);
    } else if (causeMessage.contains("401")) {
        shownMessage = notifyAboutIncorrectUsernameOrPassword(causeMessage);
        type = NotificationType.ERROR;
    } else if (causeMessage.contains("Organization not selected")) {
        shownMessage = causeMessage;
    } else if (exception.getMessage().contains("Failed to fetch courses from the server")
            || exception.getMessage().contains("Failed to compress project")) {
        shownMessage = notifyAboutFailedSubmissionAttempt();
    } else if (TmcSettingsManager.get().getServerAddress().isEmpty()) {
        shownMessage = notifyAboutEmptyServerAddress(causeMessage);
    } else {
        shownMessage = causeMessage;
        type = NotificationType.ERROR;
    }
    System.out.println("error: " + shownMessage);

    return new PresentableErrorMessage(shownMessage, type);
}
 
開發者ID:testmycode,項目名稱:tmc-intellij,代碼行數:40,代碼來源:PresentableErrorMessage.java

示例6: iconForNotificationType

private Icon iconForNotificationType(NotificationType type) {
    if (type == NotificationType.WARNING) {
        return Messages.getWarningIcon();
    } else if (type == NotificationType.ERROR) {
        return Messages.getErrorIcon();
    } else if (type == NotificationType.INFORMATION) {
        return Messages.getInformationIcon();
    } else {
        return Messages.getErrorIcon();
    }
}
 
開發者ID:testmycode,項目名稱:tmc-intellij,代碼行數:11,代碼來源:ErrorMessageService.java

示例7: reportError

@Override
public synchronized void reportError(@NotNull String message) {
  super.reportError(message);
  final Notification notification = new Notification(
    AndroidDbManager.NOTIFICATION_GROUP_ID, "Data Source Synchronization Error",
    "Cannot " + (myUpload ? "upload" : "synchronize") + " '" + myDataSource.getName() + "': " + message,
    NotificationType.ERROR);
  Notifications.Bus.notify(notification, myProject);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:AndroidDbErrorReporterImpl.java

示例8: notifyUser

private static void notifyUser(DataContext context, MavenProject mavenProject, MavenProject aggregator) {
  String aggregatorDescription = " (" + aggregator.getMavenId().getDisplayString() + ')';
  Notification notification = new Notification(MavenUtil.MAVEN_NOTIFICATION_GROUP, "Failed to remove project",
                                               "You can not remove " + mavenProject.getName() + " because it's " +
                                               "imported as a module of another project" +
                                               aggregatorDescription
                                               + ". You can use Ignore action. Only root project can be removed.",
                                               NotificationType.ERROR
  );

  notification.setImportant(true);
  notification.notify(MavenActionUtil.getProject(context));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:RemoveManagedFilesAction.java

示例9: error_notification_is_shown

@Then("^(success|warning|error) notification is shown '(.+)'$")
public void error_notification_is_shown(String notificationType, String title, String content) {
  NotificationType type = notificationType.equals("success") ? NotificationType.INFORMATION :
                          notificationType.equals("warning") ? NotificationType.WARNING :
                          notificationType.equals("error") ? NotificationType.ERROR : null;
  Notification actualNotification = lastNotification();
  assertNotNull("Notification should be shown", actualNotification);
  assertEquals("Notification type is incorrect in " + actualNotification, type, actualNotification.getType());
  assertEquals("Notification title is incorrect in" + actualNotification, title, actualNotification.getTitle());
  assertNotificationContent(content, actualNotification.getContent());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:GeneralStepdefs.java

示例10: SvnAuthenticationNotifier

public SvnAuthenticationNotifier(final SvnVcs svnVcs) {
  super(svnVcs.getProject(), svnVcs.getDisplayName(), "Not Logged In to Subversion", NotificationType.ERROR);
  myVcs = svnVcs;
  myRootsToWorkingCopies = myVcs.getRootsToWorkingCopies();
  myCopiesPassiveResults = Collections.synchronizedMap(new HashMap<SVNURL, Boolean>());
  myVerificationInProgress = false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:SvnAuthenticationNotifier.java

示例11: error

public static void error(String title, String message) {
    Notification notification = new Notification(GreenCat.EVENT_LOG_GROUP_ID, title, message, NotificationType.ERROR);
    Notifications.Bus.notify(notification);
}
 
開發者ID:andreyfomenkov,項目名稱:green-cat,代碼行數:4,代碼來源:EventLog.java

示例12: showNotification

private void showNotification(String text, boolean error) {
    Notification n = new Notification("com.github.shchurov.gradlestop", TITLE, text,
            error ? NotificationType.ERROR : NotificationType.INFORMATION);
    Notifications.Bus.notify(n);
}
 
開發者ID:shchurov,項目名稱:GradleStop,代碼行數:5,代碼來源:GradleStopAction.java

示例13: HeaderFileParseErrorNotification

public HeaderFileParseErrorNotification(@NotNull Exception e) {
	super("Arma Plugin - Header Parse Error", "placeholder", "placeholder", NotificationType.ERROR);
	//using "placeholder" because if we don't, an exception gets thrown for having empty Strings for some reason
	//December 9, 2017
	this.e = e;
}
 
開發者ID:kayler-renslow,項目名稱:arma-intellij-plugin,代碼行數:6,代碼來源:ArmaPluginUserData.java

示例14: showError

public static void showError(Project project, String errorMsg) {
  Notification notification =
      new Notification("ClangFormatIJ", "Formatting Failed", errorMsg, NotificationType.ERROR);
  Notifications.Bus.notify(notification, project);
}
 
開發者ID:mprobst,項目名稱:ClangFormatIJ,代碼行數:5,代碼來源:ClangFormatAction.java

示例15: showErrorNotification

public static void showErrorNotification(String text) {
    Notification n = new Notification("com.github.shchurov.prefseditor", "SharedPreferencesEditor",
            text, NotificationType.ERROR);
    Notifications.Bus.notify(n);
}
 
開發者ID:shchurov,項目名稱:SharedPreferences-Editor-Plugin,代碼行數:5,代碼來源:Utils.java


注:本文中的com.intellij.notification.NotificationType.ERROR屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。