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


Java NotificationGroup.createNotification方法代码示例

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


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

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

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

示例3: showBalloon

import com.intellij.notification.NotificationGroup; //导入方法依赖的package包/类
public void showBalloon(@NotNull String title,
                        @NotNull String text,
                        @NotNull NotificationType type,
                        @NotNull NotificationGroup group,
                        @Nullable NotificationListener listener) {
  final Notification notification = group.createNotification(title, text, type, listener);
  Runnable notificationTask = new Runnable() {
    @Override
    public void run() {
      if (!myProject.isDisposed() && myProject.isOpen()) {
        Notification old = myNotification;
        if (old != null) {
          boolean similar = Objects.equal(notification.getContent(), old.getContent());
          if (similar) {
            old.expire();
          }
        }
        myNotification = notification;
        notification.notify(myProject);
      }
    }
  };
  Application application = ApplicationManager.getApplication();
  if (application.isDispatchThread()) {
    notificationTask.run();
  }
  else {
    application.invokeLater(notificationTask);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:AndroidGradleNotification.java

示例4: createNotification

import com.intellij.notification.NotificationGroup; //导入方法依赖的package包/类
@NotNull
private Notification createNotification(@NotNull NotificationGroup notificationGroup,
                                        @NotNull String title,
                                        @NotNull String message,
                                        @NotNull NotificationType type,
                                        @Nullable NotificationListener listener) {
  // title can be empty; message can't be neither null, nor empty
  if (StringUtil.isEmptyOrSpaces(message)) {
    message = title;
    title = "";
  }
  // if both title and message were empty, then it is a problem in the calling code =>
  // Notifications engine assertion will notify.
  return notificationGroup.createNotification(title, message, type, listener);
}
 
开发者ID:zielu,项目名称:GitToolBox,代码行数:16,代码来源:GtNotifierImpl.java

示例5: createNotification

import com.intellij.notification.NotificationGroup; //导入方法依赖的package包/类
@NotNull
public static Notification createNotification(@NotNull NotificationGroup notificationGroup,
                                              @NotNull String title, @NotNull String message, @NotNull NotificationType type,
                                              @Nullable NotificationListener listener) {
  // title can be empty; description can't be neither null, nor empty
  if (StringUtil.isEmptyOrSpaces(message)) {
    message = title;
    title = "";
  }
  // if both title and description were empty, then it is a problem in the calling code => Notifications engine assertion will notify.
  return notificationGroup.createNotification(title, message, type, listener);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:Notificator.java

示例6: showMessage

import com.intellij.notification.NotificationGroup; //导入方法依赖的package包/类
public Notification showMessage(String message, MessageType messageType, @Nullable NotificationListener listener) {
  NotificationGroup notificationGroup = NotificationGroup.balloonGroup(myNotificationDisplayId);
  Notification notification = notificationGroup.createNotification("", message, messageType.toNotificationType(), listener);
  notification.notify(null);
  return notification;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:CloudNotifier.java


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