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


Java NotificationType.INFORMATION屬性代碼示例

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


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

示例1: notifyEnableMessage

public static void notifyEnableMessage(@NotNull final Project project) {
    Notification notification = new Notification("Grav Plugin", "Grav Plugin",
            "<a href=\"enable\">Enable</a> the Grav Plugin now, or open <a href=\"config\">Project Settings</a>. <br/>" +
                    "<a href=\"dismiss\">Do not</a> ask again.", NotificationType.INFORMATION, (notification1, event) -> {
        // handle html click events
        if ("config".equals(event.getDescription())) {
            // open settings dialog and show panel
            GravProjectConfigurable.show(project);
        } else if ("enable".equals(event.getDescription())) {
            enablePluginAndConfigure(project);
            Notifications.Bus.notify(new Notification("Grav Plugin", "Grav Plugin", "Plugin enabled", NotificationType.INFORMATION), project);
        } else if ("dismiss".equals(event.getDescription())) {
            // user dont want to show notification again
            GravProjectSettings.getInstance(project).dismissEnableNotification = true;
        }
        notification1.expire();
    });

    Notifications.Bus.notify(notification, project);
}
 
開發者ID:PioBeat,項目名稱:GravSupport,代碼行數:20,代碼來源:IdeHelper.java

示例2: actionPerformed

@Override
public void actionPerformed(AnActionEvent e) {
  final DataContext dataContext = e.getDataContext();
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);
  List<String> fileNames = findTestDataFiles(dataContext);
  if (fileNames == null || fileNames.isEmpty()) {
    String testData = guessTestData(dataContext);
    if (testData == null) {
      String message = "Cannot find testdata files for class";
      final Notification notification = new Notification("testdata", "Found no testdata files", message, NotificationType.INFORMATION);
      Notifications.Bus.notify(notification, project);
      return;
    }
    fileNames = Collections.singletonList(testData);
  }

  final Editor editor = e.getData(CommonDataKeys.EDITOR);
  final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
  final RelativePoint point = editor != null ? popupFactory.guessBestPopupLocation(editor) : popupFactory.guessBestPopupLocation(dataContext);

  TestDataNavigationHandler.navigate(point, fileNames, project);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:NavigateToTestDataAction.java

示例3: createNotification

@NonNull
@Override
public Notification createNotification(@NotNull final String groupDisplayId,
                                       @Nullable NotificationListener listener) {
  final String fullProductName = ApplicationNamesInfo.getInstance().getFullProductName();
  final String companyName = ApplicationInfo.getInstance().getCompanyName();

  String text =
    "<html>Please click <a href='allow'>I agree</a> if you want to help make " + fullProductName +
    " better or <a href='decline'>I don't agree</a> otherwise. <a href='settings'>more...</a></html>";

  String title = "Help improve " + fullProductName + " by sending usage statistics to " + companyName;

  return new Notification(groupDisplayId, title,
                          text,
                          NotificationType.INFORMATION,
                          listener);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:AndroidStatisticsService.java

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

示例5: notice

public static void notice(String message) {
   Notification n = new Notification(
         "extras",
         "Notice",
         String.format("%s - %s", MESSAGE_PREFIX, message),
         NotificationType.INFORMATION);
   Notifications.Bus.notify(n);
}
 
開發者ID:allandequeiroz,項目名稱:random_image_background_any_jetbrains_plugin,代碼行數:8,代碼來源:NotificationCenter.java

示例6: notify

public static void notify(final IMPanel contactView,
                          final IContact target, final String title,
                          final CharSequence text) {
    com.intellij.notification.Notifications.Bus.register("SmartIM", NotificationDisplayType.BALLOON);
    Notification n = new Notification("SmartIM", title, StringUtils.isEmpty(text) ? "" : text.toString(), NotificationType.INFORMATION);
    com.intellij.notification.Notifications.Bus.notify(n);
}
 
開發者ID:Jamling,項目名稱:SmartQQ4IntelliJ,代碼行數:7,代碼來源:Notifications.java

示例7: log

public static void log(String msg) {
	Notification notification = new Notification(GROUP_ID, TITLE, msg, NotificationType.INFORMATION);//build a notification
	//notification.hideBalloon();//didn't work
	Notifications.Bus.notify(notification);//use the default bus to notify (application level)
	Balloon balloon = notification.getBalloon();
	if (balloon != null) {//fix: #20 潛在的NPE
		balloon.hide(true);//try to hide the balloon immediately.
	}
}
 
開發者ID:xusida,項目名稱:yaml-format,代碼行數:9,代碼來源:FormatYamlAction.java

示例8: showPopupNotification

private static void showPopupNotification(Project project) {
  String msg =
      "Some relevant files (e.g. BUILD files, .blazeproject file) have changed "
          + "since the last sync. Please press the 'Sync' button in the toolbar to "
          + "re-sync your IntelliJ project.";
  Notification notification =
      new Notification(
          NOTIFICATION_GROUP.getDisplayId(),
          String.format("Changes since last %s sync", Blaze.buildSystemName(project)),
          msg,
          NotificationType.INFORMATION);
  notification.setImportant(true);
  Notifications.Bus.notify(notification, project);
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:14,代碼來源:IncrementalSyncProjectAction.java

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

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

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

示例12: IncomingTipNotification

public IncomingTipNotification(IncomingAnswer incomingTip) {
    super(GroupId,
            MessageService.message("samebug.notification.incomingTip.title", incomingTip.getSolution().getDocument().getAuthor().getDisplayName()),
            incomingTip.getSolution().getDocument().getMessage(),
            NotificationType.INFORMATION,
            null);

    whenExpired(new Runnable() {
        @Override
        public void run() {
            hideBalloon();
        }
    });
}
 
開發者ID:samebug,項目名稱:samebug-idea-plugin,代碼行數:14,代碼來源:IncomingTipNotification.java

示例13: IncomingHelpRequestNotification

public IncomingHelpRequestNotification(IncomingHelpRequest helpRequest) {
    super(GroupId,
            MessageService.message("samebug.component.helpRequest.incoming.title", getRequesterName(helpRequest)),
            getContext(helpRequest),
            NotificationType.INFORMATION,
            null);

    whenExpired(new Runnable() {
        @Override
        public void run() {
            hideBalloon();
        }
    });
}
 
開發者ID:samebug,項目名稱:samebug-idea-plugin,代碼行數:14,代碼來源:IncomingHelpRequestNotification.java

示例14: handleFileTooBigException

protected void handleFileTooBigException(Logger logger, FilesTooBigForDiffException e, @NotNull PsiFile file) {
  logger.info("Error while calculating changed ranges for: " + file.getVirtualFile(), e);
  if (!ApplicationManager.getApplication().isUnitTestMode()) {
    Notification notification = new Notification(ApplicationBundle.message("reformat.changed.text.file.too.big.notification.groupId"),
                                                 ApplicationBundle.message("reformat.changed.text.file.too.big.notification.title"),
                                                 ApplicationBundle.message("reformat.changed.text.file.too.big.notification.text", file.getName()),
                                                 NotificationType.INFORMATION);
    notification.notify(file.getProject());
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:AbstractLayoutCodeProcessor.java

示例15: updateCourse

private void updateCourse() {
  final Course course = StudyTaskManager.getInstance(myProject).getCourse();
  if (course == null) {
    return;
  }
  final File resourceDirectory = new File(course.getCourseDirectory());
  if (!resourceDirectory.exists()) {
    return;
  }
  StudyLanguageManager manager = StudyUtils.getLanguageManager(course);
  if (manager == null) {
    LOG.info("Study Language Manager is null for " + course.getLanguageById().getDisplayName());
    return;
  }
  final File[] files = resourceDirectory.listFiles();
  if (files == null) return;
  for (File file : files) {
    String testHelper = manager.getTestHelperFileName();
    if (file.getName().equals(testHelper)) {
      copyFile(file, new File(myProject.getBasePath(), testHelper));
    }
    if (file.getName().startsWith(EduNames.LESSON)) {
      final File[] tasks = file.listFiles();
      if (tasks == null) continue;
      for (File task : tasks) {
        final File taskDescr = new File(task, EduNames.TASK_HTML);
        String testFileName = manager.getTestFileName();
        final File taskTests = new File(task, testFileName);
        copyFile(taskDescr, new File(new File(new File(myProject.getBasePath(), file.getName()), task.getName()), EduNames.TASK_HTML));
        copyFile(taskTests, new File(new File(new File(myProject.getBasePath(), file.getName()), task.getName()),
                                     testFileName));
      }
    }
  }

  final Notification notification =
    new Notification("Update.course", "Course update", "Current course is synchronized", NotificationType.INFORMATION);
  notification.notify(myProject);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:39,代碼來源:StudyProjectComponent.java


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