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


Java NotificationGroup类代码示例

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


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

示例1: register

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
public void register(@NotNull String groupDisplayName,
                     @NotNull NotificationDisplayType displayType,
                     boolean shouldLog,
                     boolean shouldReadAloud) {
  if (!isRegistered(groupDisplayName)) {
    // register a new group and remember these settings as default
    new NotificationGroup(groupDisplayName, displayType, shouldLog);
    // and decide whether to save them explicitly (in case of non-default shouldReadAloud)
    changeSettings(groupDisplayName, displayType, shouldLog, shouldReadAloud);
  }
  else if (displayType == NotificationDisplayType.TOOL_WINDOW && !hasToolWindowCapability(groupDisplayName)) {
    // the first time with tool window capability
    changeSettings(getSettings(groupDisplayName).withDisplayType(NotificationDisplayType.TOOL_WINDOW));
    myToolWindowCapable.put(groupDisplayName, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:NotificationsConfigurationImpl.java

示例2: warnUser

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void warnUser(Project project, List<Module> invalidModules) {
  String message =
      new StringBuilder()
          .append("<p>")
          .append(
              GctBundle.message(
                  "appengine.support.java.version.alert.detail",
                  "<a href=\"" + UPDATE_HREF + "\">",
                  "</a>"))
          .append("</p>")
          .toString();

  NotificationGroup notification =
      new NotificationGroup(
          GctBundle.message("appengine.support.java.version.alert.title"),
          NotificationDisplayType.BALLOON,
          true);

  notification
      .createNotification(
          GctBundle.message("appengine.support.java.version.alert.title"),
          message,
          NotificationType.WARNING,
          new LanguageLevelLinkListener(invalidModules))
      .notify(project);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:27,代码来源:AppEngineStandardUnsupportedJavaVersionCheck.java

示例3: showNotification

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public void showNotification(@NotNull final String title,
                             @NotNull final String message,
                             @NotNull final NotificationType type,
                             @NotNull final Project project,
                             @NotNull final ProjectSystemId externalSystemId,
                             @Nullable final NotificationListener listener)
{
  UIUtil.invokeLaterIfNeeded(new Runnable() {
    @Override
    public void run() {
      NotificationGroup group = ExternalSystemUtil.getToolWindowElement(NotificationGroup.class,
                                                                        project,
                                                                        ExternalSystemDataKeys.NOTIFICATION_GROUP,
                                                                        externalSystemId);
      if (group == null) {
        return;
      }

      Notification notification = group.createNotification(title, message, type, listener);
      applyNotification(notification, project);
    }
  });

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:ExternalSystemIdeNotificationManager.java

示例4: notifyInspectionsFinished

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
protected void notifyInspectionsFinished() {
  if (ApplicationManager.getApplication().isUnitTestMode()) return;
  UIUtil.invokeLaterIfNeeded(new Runnable() {
    @Override
    public void run() {
      LOG.info("Code inspection finished");

      if (myView != null) {
        if (!myView.update() && !getUIOptions().SHOW_ONLY_DIFF) {
          NotificationGroup.toolWindowGroup("Inspection Results", ToolWindowId.INSPECTION, true)
            .createNotification(InspectionsBundle.message("inspection.no.problems.message"), MessageType.INFO).notify(getProject());
          close(true);
        }
        else {
          addView(myView);
        }
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:GlobalInspectionContextImpl.java

示例5: projectOpened

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
public void projectOpened() {
  if (application.isUpdated() && !application.isUpdateNotificationShown()) {
    application.setUpdateNotificationShown(true);

    NotificationGroup group = new NotificationGroup(Version.PLUGIN_NAME, NotificationDisplayType.STICKY_BALLOON, true);
    Notification notification = group.createNotification(
      LombokBundle.message("daemon.donate.title", Version.PLUGIN_VERSION),
      LombokBundle.message("daemon.donate.content"),
      NotificationType.INFORMATION,
      new NotificationListener.UrlOpeningListener(false)
    );

    Notifications.Bus.notify(notification);
  }
}
 
开发者ID:mplushnikov,项目名称:lombok-intellij-plugin,代码行数:17,代码来源:LombokPluginUpdateProjectComponent.java

示例6: register

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
public void register(@Nonnull String groupDisplayName,
                     @Nonnull NotificationDisplayType displayType,
                     boolean shouldLog,
                     boolean shouldReadAloud) {
  if (!isRegistered(groupDisplayName)) {
    // register a new group and remember these settings as default
    new NotificationGroup(groupDisplayName, displayType, shouldLog);
    // and decide whether to save them explicitly (in case of non-default shouldReadAloud)
    changeSettings(groupDisplayName, displayType, shouldLog, shouldReadAloud);
  }
  else if (displayType == NotificationDisplayType.TOOL_WINDOW && !hasToolWindowCapability(groupDisplayName)) {
    // the first time with tool window capability
    changeSettings(getSettings(groupDisplayName).withDisplayType(NotificationDisplayType.TOOL_WINDOW));
    myToolWindowCapable.put(groupDisplayName, null);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:NotificationsConfigurationImpl.java

示例7: findParent

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Nullable
public static NotificationParentGroupBean findParent(@Nonnull NotificationSettings setting) {
  prepareInfo();

  String groupId = setting.getGroupId();
  NotificationGroup group = NotificationGroup.findRegisteredGroup(groupId);
  NotificationParentGroupBean parent;

  if (group == null) {
    parent = myGroupToParent.get(groupId);
  }
  else {
    String parentId = group.getParentId();
    if (parentId == null) {
      parent = myGroupToParent.get(group.getDisplayId());
      if (parent != null) {
        group.setParentId(parent.id);
      }
    }
    else {
      parent = myParents.get(parentId);
    }
  }

  return parent;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:NotificationParentGroup.java

示例8: hotSwapSessions

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void hotSwapSessions( final List<DebuggerSession> sessions )
{
  HotSwapProgressImpl findClassesProgress = new HotSwapProgressImpl( getIjProject() );

  ApplicationManager.getApplication().executeOnPooledThread( () ->
  {
    final Map<DebuggerSession, Map<String, HotSwapFile>> modifiedClasses = scanForModifiedClassesWithProgress( sessions, findClassesProgress );

    final Application application = ApplicationManager.getApplication();
    if( modifiedClasses.isEmpty() )
    {
      final String message = DebuggerBundle.message( "status.hotswap.uptodate" );
      NotificationGroup.toolWindowGroup( "HotSwap", ToolWindowId.DEBUG ).createNotification( message, NotificationType.INFORMATION ).notify( getIjProject() );
      return;
    }

    application.invokeLater( () ->
    {
      if( !modifiedClasses.isEmpty() )
      {
        final HotSwapProgressImpl progress = new HotSwapProgressImpl( getIjProject() );
        if( modifiedClasses.keySet().size() == 1 )
        {
          //noinspection ConstantConditions
          progress.setSessionForActions( ContainerUtil.getFirstItem( modifiedClasses.keySet() ) );
        }
        application.executeOnPooledThread( () -> reloadModifiedClasses( modifiedClasses, progress ) );
      }
    }, ModalityState.NON_MODAL );
  } );
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:32,代码来源:HotSwapComponent.java

示例9: askUserToDisablePlugins

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void askUserToDisablePlugins(Collection<IdeaPluginDescriptor> conflictingPlugins) {
    final String text = formatMessage(conflictingPlugins);
    NotificationGroup ng = NotificationGroup.balloonGroup("Conflicting Plugins");
    ng.createNotification(PLUGIN_NAME, text, NotificationType.WARNING,
            (notification, event) -> {
                if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                    for (IdeaPluginDescriptor foreignPlugin : conflictingPlugins) {
                        PluginManager.disablePlugin(foreignPlugin.getPluginId().toString());
                    }
                    Application application = ApplicationManager.getApplication();
                    application.restart();
                }
            }).notify(project);
}
 
开发者ID:protostuff,项目名称:protobuf-jetbrains-plugin,代码行数:15,代码来源:ProtostuffPluginController.java

示例10: ExternalProjectsViewImpl

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public ExternalProjectsViewImpl(@NotNull Project project, @NotNull ToolWindowEx toolWindow, @NotNull ProjectSystemId externalSystemId) {
  super(true, true);
  myProject = project;
  myToolWindow = toolWindow;
  myExternalSystemId = externalSystemId;
  myUiAware = ExternalSystemUiUtil.getUiAware(externalSystemId);
  myProjectsManager = ExternalProjectsManager.getInstance(myProject);

  String toolWindowId =
    toolWindow instanceof ToolWindowImpl ? ((ToolWindowImpl)toolWindow).getId() : myExternalSystemId.getReadableName();

  String notificationId = "notification.group.id." + externalSystemId.getId().toLowerCase(Locale.ENGLISH);
  NotificationGroup registeredGroup = NotificationGroup.findRegisteredGroup(notificationId);
  myNotificationGroup = registeredGroup != null ? registeredGroup : NotificationGroup.toolWindowGroup(notificationId, toolWindowId);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ExternalProjectsViewImpl.java

示例11: printToEventLog

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
private void printToEventLog(String message) {
  NotificationGroup group = NotificationGroup.logOnlyGroup("typing-delay-stats");
  Notification notification = group.createNotification(message, NotificationType.INFORMATION);
  notification.setImportant(true);
  notification.notify(myEditor.getProject());
  notification.hideBalloon();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ImmediatePainter.java

示例12: getAllSettings

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public synchronized NotificationSettings[] getAllSettings() {
  Collection<NotificationSettings> settings = new THashSet<NotificationSettings>(myIdToSettingsMap.values());
  for (NotificationGroup group : NotificationGroup.getAllRegisteredGroups()) {
    settings.add(getSettings(group.getDisplayId()));
  }
  NotificationSettings[] result = settings.toArray(new NotificationSettings[settings.size()]);
  Arrays.sort(result, NOTIFICATION_SETTINGS_COMPARATOR);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:NotificationsConfigurationImpl.java

示例13: getDefaultSettings

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@NotNull
private static NotificationSettings getDefaultSettings(String groupId) {
  NotificationGroup group = NotificationGroup.findRegisteredGroup(groupId);
  if (group != null) {
    return new NotificationSettings(groupId, group.getDisplayType(), group.isLogByDefault(), false);
  }
  return new NotificationSettings(groupId, NotificationDisplayType.BALLOON, true, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:NotificationsConfigurationImpl.java

示例14: notify

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
@Override
@NotNull
public Notification notify(@NotNull NotificationGroup notificationGroup, @NotNull String title, @NotNull String message,
                           @NotNull NotificationType type, @Nullable NotificationListener listener) {
  myLastNotification = new Notification(TEST_NOTIFICATION_GROUP, title, message, type, listener);
  return myLastNotification;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TestVcsNotifier.java

示例15: showBalloon

import com.intellij.notification.NotificationGroup; //导入依赖的package包/类
public void showBalloon(@NotNull String title,
                        @NotNull String text,
                        @NotNull NotificationType type,
                        @NotNull NotificationGroup group,
                        @NotNull NotificationHyperlink... hyperlinks) {
  NotificationListener notificationListener = new CustomNotificationListener(myProject, hyperlinks);
  String newText = addHyperlinksToText(text, hyperlinks);
  showBalloon(title, newText, type, group, notificationListener);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AndroidGradleNotification.java


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