From 67973765e1ca2b12bef1a84c577d7add5f5a1492 Mon Sep 17 00:00:00 2001 From: marhali Date: Mon, 7 Feb 2022 22:10:55 +0100 Subject: [PATCH] fix compatibility problems on notification system --- .../easyi18n/util/NotificationHelper.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/marhali/easyi18n/util/NotificationHelper.java b/src/main/java/de/marhali/easyi18n/util/NotificationHelper.java index cfa57bf..70437b8 100644 --- a/src/main/java/de/marhali/easyi18n/util/NotificationHelper.java +++ b/src/main/java/de/marhali/easyi18n/util/NotificationHelper.java @@ -1,8 +1,6 @@ package de.marhali.easyi18n.util; -import com.intellij.notification.Notification; -import com.intellij.notification.NotificationGroupManager; -import com.intellij.notification.NotificationType; +import com.intellij.notification.*; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.project.Project; import de.marhali.easyi18n.action.SettingsAction; @@ -18,6 +16,7 @@ import java.util.ResourceBundle; * @author marhali */ public class NotificationHelper { + public static void createIOError(@NotNull SettingsState state, Exception ex) { ResourceBundle bundle = ResourceBundle.getBundle("messages"); @@ -30,12 +29,14 @@ public class NotificationHelper { public static void createEmptyLocalesDirNotification(Project project) { ResourceBundle bundle = ResourceBundle.getBundle("messages"); - Notification notification = NotificationGroupManager.getInstance() - .getNotificationGroup("Easy I18n Notification Group") - .createNotification("Easy I18n", bundle.getString("warning.missing-config"), - NotificationType.WARNING); + Notification notification = new Notification( + "Easy I18n Notification Group", + "Easy I18n", + bundle.getString("warning.missing-config"), + NotificationType.WARNING); notification.addAction(new SettingsAction()); - notification.notify(project); + + Notifications.Bus.notify(notification, project); } } \ No newline at end of file