当前位置: 首页>>代码示例>>Java>>正文


Java NotificationType.WARNING属性代码示例

本文整理汇总了Java中com.intellij.notification.NotificationType.WARNING属性的典型用法代码示例。如果您正苦于以下问题:Java NotificationType.WARNING属性的具体用法?Java NotificationType.WARNING怎么用?Java NotificationType.WARNING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.intellij.notification.NotificationType的用法示例。


在下文中一共展示了NotificationType.WARNING属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: validateLocale

@Nullable
private Notification validateLocale() throws SvnBindException {
  ProcessOutput versionOutput = getVersionClient().runCommand(false);
  Notification result = null;

  Matcher matcher = INVALID_LOCALE_WARNING_PATTERN.matcher(versionOutput.getStderr());
  if (matcher.find()) {
    LOG.info(matcher.group());

    result = new ExecutableNotValidNotification(prepareDescription(UIUtil.getHtmlBody(matcher.group()), false), NotificationType.WARNING);
  }
  else if (!isEnglishOutput(versionOutput.getStdout())) {
    LOG.info("\"svn --version\" command contains non-English output " + versionOutput.getStdout());

    result = new ExecutableNotValidNotification(prepareDescription(SvnBundle.message("non.english.locale.detected.warning"), false),
                                                NotificationType.WARNING);
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SvnExecutableChecker.java

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: getIcon

@NotNull
private static Icon getIcon(@NotNull NotificationType type) {
    return type == NotificationType.INFORMATION ? Icons.BLUE_FILE : (type == NotificationType.WARNING ? Icons.YELLOW_FILE : Icons.RML_FILE);
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:4,代码来源:RmlNotification.java

示例8: sendNotification

public static void sendNotification(String title, String content) {
    Notification n = new Notification("SmartIM", title, content, NotificationType.WARNING);
    Notifications.Bus.notify(n);
}
 
开发者ID:Jamling,项目名称:SmartQQ4IntelliJ,代码行数:4,代码来源:LOG.java

示例9: warn

public static void warn(String title, String message) {
    Notification notification = new Notification(GreenCat.EVENT_LOG_GROUP_ID, title, message, NotificationType.WARNING);
    Notifications.Bus.notify(notification);
}
 
开发者ID:andreyfomenkov,项目名称:green-cat,代码行数:4,代码来源:EventLog.java

示例10: toNotificationType

@NotNull
public NotificationType toNotificationType() {
  return this == ERROR ? NotificationType.ERROR : this == WARNING ? NotificationType.WARNING : NotificationType.INFORMATION;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:MessageType.java

示例11: resolveNotificationType

private static NotificationType resolveNotificationType(@NotNull GeneralCommitProcessor processor) {
  boolean hasExceptions = !processor.getVcsExceptions().isEmpty();
  boolean hasOnlyWarnings = doesntContainErrors(processor.getVcsExceptions());

  return hasExceptions ? (hasOnlyWarnings ? NotificationType.WARNING : NotificationType.ERROR) : NotificationType.INFORMATION;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:CommitHelper.java


注:本文中的com.intellij.notification.NotificationType.WARNING属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。