本文整理汇总了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);
}
}
示例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();
}
示例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);
}
}
示例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);
}
示例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);
}
示例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;
}