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


Java NotificationType类代码示例

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


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

示例1: extractResponse

import com.intellij.notification.NotificationType; //导入依赖的package包/类
@Nullable
private JsonNode extractResponse(JsonNode merlinResult) {
    // !! handle notifications

    JsonNode classField = merlinResult.get("class");
    if (classField == null) {
        return null;
    }
    JsonNode value = merlinResult.get("value");

    String responseType = classField.textValue();
    if ("return".equals(responseType)) {
        return value;
    }

    // Something went wrong with merlin, it can be: failure|error|exception
    // https://github.com/ocaml/merlin/blob/master/doc/dev/PROTOCOL.md#answers
    if ("error".equals(responseType)) {
        Notifications.Bus.notify(new RmlNotification("Merlin", responseType, value.toString(), NotificationType.ERROR, null));
    }

    // failure or error should not be reported to the user
    return null;
}
 
开发者ID:reasonml-editor,项目名称:reasonml-idea-plugin,代码行数:25,代码来源:MerlinProcess3.java

示例2: initComponent

import com.intellij.notification.NotificationType; //导入依赖的package包/类
@Override
public void initComponent() {
    MessageBus bus = ApplicationManager.getApplication().getMessageBus();
    connection = bus.connect();

    ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerListener() {
        @Override
        public void projectOpened(Project project) {
            Config config = Config.getInstance(project);

            if(config == null) {
                return;
            }

            if(!config.isConfigFilled()) {
                Notifications.Bus.notify(
                        new Notification("Settings Error", "Gherkin TS Runner", "Settings have to be filled.", NotificationType.WARNING)
                );
                return;
            }

            connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new GherkinFileEditorManagerListener(project));
        }
    });

}
 
开发者ID:KariiO,项目名称:Gherkin-TS-Runner,代码行数:27,代码来源:MainComponent.java

示例3: scanAndUpdate

import com.intellij.notification.NotificationType; //导入依赖的package包/类
/**
 * Scan and update dependency components.
 */
private void scanAndUpdate(boolean quickScan, ProgressIndicator indicator, @Nullable Collection<DataNode<LibraryDependencyData>> libraryDependencies) {
    // Don't scan if Xray is not configured
    if (!GlobalSettings.getInstance().isCredentialsSet()) {
        Utils.notify(logger, "JFrog Xray scan failed", "Xray server is not configured.", NotificationType.ERROR);
        return;
    }
    // Prevent multiple simultaneous scans
    if (!scanInProgress.compareAndSet(false, true)) {
        if (!quickScan) {
            Utils.notify(logger, "JFrog Xray", "Scan already in progress.", NotificationType.INFORMATION);
        }
        return;
    }
    try {
        // Refresh dependencies -> Collect -> Scan and store to cache -> Update view
        refreshDependencies(getRefreshDependenciesCbk(quickScan, indicator), libraryDependencies);
    } finally {
        scanInProgress.set(false);
    }
}
 
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:24,代码来源:ScanManager.java

示例4: notifyImportFinished

import com.intellij.notification.NotificationType; //导入依赖的package包/类
private void notifyImportFinished(@NotNull Project project) {

        final String notificationName = refresh
            ? message("project.refresh.finished")
            : message("project.import.finished");

        final String notificationTitle = refresh
            ? message("project.refresh.notification.title")
            : message("project.import.notification.title");

        NotificationUtil.NOTIFICATION_GROUP.createNotification(
            notificationTitle,
            notificationName,
            NotificationType.INFORMATION,
            null
        ).notify(project);

        showSystemNotificationIfNotActive(project, notificationName, notificationTitle, notificationName);
    }
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:20,代码来源:DefaultHybrisProjectImportBuilder.java

示例5: showDiscountOffer

import com.intellij.notification.NotificationType; //导入依赖的package包/类
private void showDiscountOffer(final Project project) {
    final PropertiesComponent properties = PropertiesComponent.getInstance();
    final long lastNotificationTime = properties.getOrInitLong(LAST_DISCOUNT_OFFER_TIME_PROPERTY, 0);
    final long currentTime = System.currentTimeMillis();

    if (currentTime - lastNotificationTime >= DateFormatUtil.MONTH) {
        properties.setValue(LAST_DISCOUNT_OFFER_TIME_PROPERTY, String.valueOf(currentTime));

        final Notification notification = notificationGroup.createNotification(
            HybrisI18NBundleUtils.message("evaluation.license.discount.offer.bubble.title"),
            HybrisI18NBundleUtils.message("evaluation.license.discount.offer.bubble.text"),
            NotificationType.INFORMATION,
            (myNotification, myHyperlinkEvent) -> goToDiscountOffer(myHyperlinkEvent)
        );
        notification.setImportant(true);
        Notifications.Bus.notify(notification, project);

        ApplicationManager.getApplication().invokeLater(() -> {
            if (!notificationClosingAlarm.isDisposed()) {
                notificationClosingAlarm.addRequest(notification::hideBalloon, 3000);
            }
        });

    }
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:26,代码来源:HybrisProjectManagerListener.java

示例6: projectOpened

import com.intellij.notification.NotificationType; //导入依赖的package包/类
@Override
public void projectOpened() {
  ApplicationManager.getApplication().invokeLater((DumbAwareRunnable)() -> ApplicationManager.getApplication().runWriteAction(
    (DumbAwareRunnable)() -> {
      if (PropertiesComponent.getInstance().getBoolean(ourShowPopup, true)) {
        final String content = "<html>If you'd like to learn more about PyCharm Edu, " +
                               "click <a href=\"https://www.jetbrains.com/pycharm-edu/quickstart/\">here</a> to watch a tutorial</html>";
        final Notification notification = new Notification("Watch Tutorials!", "", content, NotificationType.INFORMATION,
                                                           new NotificationListener.UrlOpeningListener(true));
        StartupManager.getInstance(myProject).registerPostStartupActivity(() -> Notifications.Bus.notify(notification));
        Balloon balloon = notification.getBalloon();
        if (balloon != null) {
          balloon.addListener(new JBPopupAdapter() {
            @Override
            public void onClosed(LightweightWindowEvent event) {
              notification.expire();
            }
          });
        }
        notification.whenExpired(() -> PropertiesComponent.getInstance().setValue(ourShowPopup, false, true));
      }
    }));
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:24,代码来源:PyStudyShowTutorial.java

示例7: createChat

import com.intellij.notification.NotificationType; //导入依赖的package包/类
private void createChat(MMUserStatus user) throws IOException, URISyntaxException {
    Channel.ChannelData channel = client.createChat(user.userId());
    if (channel == null) {
        Notifications.Bus.notify(new Notification("mattermost", "channel error", "no channel found for " + user.username(), NotificationType.ERROR));
        return;
    }
    SwingUtilities.invokeLater(() -> {
        String name = user.username();
        Chat chat = this.channelIdChatMap.computeIfAbsent(channel.getId(), k -> new Chat());
        chat.channelId = channel.getId();
        if (this.toolWindow.getContentManager().getContent(chat) == null) {
            Content messages = ContentFactory.SERVICE.getInstance().createContent(chat, name, false);
            messages.setIcon(TEAM);
            this.toolWindow.getContentManager().addContent(messages);
            this.toolWindow.getContentManager().setSelectedContent(messages);
        } else {
            Content c = this.toolWindow.getContentManager().getContent(chat);
            this.toolWindow.getContentManager().setSelectedContent(c);
        }
        SwingUtilities.invokeLater(chat.inputArea::grabFocus);
    });
}
 
开发者ID:stefandotti,项目名称:intellij-mattermost-plugin,代码行数:23,代码来源:MattermostClientWindow.java

示例8: addToolsJar

import com.intellij.notification.NotificationType; //导入依赖的package包/类
static void addToolsJar( @NotNull ModifiableRootModel rootModel )
{
  if( hasToolsJar( rootModel ) )
  {
    return;
  }

  VirtualFile toolsJarFile = findToolsJarFile( rootModel.getProject() );
  if( toolsJarFile == null )
  {
    Notifications.Bus.notify( new Notification( "Project JDK", "tools.jar not found!", "Please add tools.jar to your JDK", NotificationType.ERROR ) );
    return;
  }

  SdkModificator sdkModificator = rootModel.getSdk().getSdkModificator();
  sdkModificator.addRoot( toolsJarFile, OrderRootType.CLASSES );
  sdkModificator.commitChanges();
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:19,代码来源:ManSupportProvider.java

示例9: notifyEnableMessage

import com.intellij.notification.NotificationType; //导入依赖的package包/类
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,代码行数:21,代码来源:IdeHelper.java

示例10: checkFsSanity

import com.intellij.notification.NotificationType; //导入依赖的package包/类
private void checkFsSanity() {
  try {
    String path = myProject.getProjectFilePath();
    if (path == null || FileUtil.isAncestor(PathManager.getConfigPath(), path, true)) {
      return;
    }

    boolean actual = FileUtil.isFileSystemCaseSensitive(path);
    LOG.info(path + " case-sensitivity: " + actual);
    if (actual != SystemInfo.isFileSystemCaseSensitive) {
      int prefix = SystemInfo.isFileSystemCaseSensitive ? 1 : 0;  // IDE=true -> FS=false -> prefix='in'
      String title = ApplicationBundle.message("fs.case.sensitivity.mismatch.title");
      String text = ApplicationBundle.message("fs.case.sensitivity.mismatch.message", prefix);
      Notifications.Bus.notify(
        new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, title, text, NotificationType.WARNING, NotificationListener.URL_OPENING_LISTENER),
        myProject);
    }
  }
  catch (FileNotFoundException e) {
    LOG.warn(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:StartupManagerImpl.java

示例11: createNotification

import com.intellij.notification.NotificationType; //导入依赖的package包/类
@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,代码行数:19,代码来源:AndroidStatisticsService.java

示例12: doNotify

import com.intellij.notification.NotificationType; //导入依赖的package包/类
private static void doNotify(@NotNull final Set<String> macros, @NotNull final Project project,
                             @NotNull final Map<TrackingPathMacroSubstitutor, IComponentStore> substitutorToStore) {
  String format = "<p><i>%s</i> %s undefined. <a href=\"define\">Fix it</a></p>";
  String productName = ApplicationNamesInfo.getInstance().getProductName();
  String content = String.format(format, StringUtil.join(macros, ", "), macros.size() == 1 ? "is" : "are") +
                   "<br>Path variables are used to substitute absolute paths " +
                   "in " + productName + " project files " +
                   "and allow project file sharing in version control systems.<br>" +
                   "Some of the files describing the current project settings contain unknown path variables " +
                   "and " + productName + " cannot restore those paths.";
  new UnknownMacroNotification("Load Error", "Load error: undefined path variables", content, NotificationType.ERROR,
                               new NotificationListener() {
                                 @Override
                                 public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
                                   checkUnknownMacros(project, true, macros, substitutorToStore);
                                 }
                               }, macros).notify(project);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:StorageUtil.java

示例13: apply

import com.intellij.notification.NotificationType; //导入依赖的package包/类
@Override
public void apply() throws ConfigurationException {
    try {
        PropertiesComponent.getInstance().setValue(KEY_RULES_PATH, rulesPath.getText());
        if (!TextUtils.isEmpty(rulesPath.getText())) {
            load(rulesPath.getText());
            DirectiveLint.prepare();
        } else {
            DirectiveLint.reset();
        }
    } catch (Exception e) {
        ProjectUtil.guessCurrentProject(select).getMessageBus().syncPublisher(Notifications.TOPIC).notify(
                new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID,
                        "Weex language support - bad rules",
                        e.toString(),
                        NotificationType.ERROR));
    }
    savePaths();
}
 
开发者ID:misakuo,项目名称:weex-language-support,代码行数:20,代码来源:Settings.java

示例14: reportResult

import com.intellij.notification.NotificationType; //导入依赖的package包/类
private String reportResult(GeneralCommitProcessor processor) {
  final List<Change> changesFailedToCommit = processor.getChangesFailedToCommit();

  int failed = changesFailedToCommit.size();
  int committed = myIncludedChanges.size() - failed;

  String text = committed + " " + StringUtil.pluralize("file", committed) + " committed";
  if (failed > 0) {
    text += ", " + failed + " " + StringUtil.pluralize("file", failed) + " failed to commit";
  }
  StringBuilder content = new StringBuilder(StringUtil.isEmpty(myCommitMessage) ? text : text + ": " + escape(myCommitMessage));
  for (String s : myFeedback) {
    content.append("\n");
    content.append(s);
  }
  NotificationType notificationType = resolveNotificationType(processor);
  VcsBalloonProblemNotifier.NOTIFICATION_GROUP.createNotification(content.toString(), notificationType).notify(myProject);
  return text;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:CommitHelper.java

示例15: showPopupWithDetails

import com.intellij.notification.NotificationType; //导入依赖的package包/类
public void showPopupWithDetails(String message,
                                 String title,
                                 String details,
                                 NotificationType notificationType) {
    Project currentProject = new ObjectFinder().findCurrentProject();
    Icon icon = iconForNotificationType(notificationType);

    ApplicationManager.getApplication().invokeLater(() -> Messages.showDialog(
            currentProject,
            message,
            title,
            details,
            new String[] { Messages.OK_BUTTON },
            0,
            0,
            icon
    ));
}
 
开发者ID:testmycode,项目名称:tmc-intellij,代码行数:19,代码来源:ErrorMessageService.java


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