mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
non-sticky balloon by default, cleanup the deprecated API usages
This commit is contained in:
@@ -19,7 +19,6 @@ package com.intellij.openapi.module.impl;
|
||||
import com.intellij.ProjectTopics;
|
||||
import com.intellij.ide.highlighter.ModuleFileType;
|
||||
import com.intellij.notification.Notification;
|
||||
import com.intellij.notification.NotificationDisplayType;
|
||||
import com.intellij.notification.NotificationType;
|
||||
import com.intellij.notification.Notifications;
|
||||
import com.intellij.openapi.Disposable;
|
||||
@@ -286,16 +285,12 @@ public class ModuleManagerImpl extends ModuleManager implements ProjectComponent
|
||||
}
|
||||
// it is not modal warning at all
|
||||
//Messages.showWarningDialog(myProject, message, ProjectBundle.message("module.unknown.type.title"));
|
||||
Notifications.Bus.notify(
|
||||
new Notification(
|
||||
"Module Manager",
|
||||
ProjectBundle.message("module.unknown.type.title"),
|
||||
message,
|
||||
NotificationType.WARNING
|
||||
),
|
||||
NotificationDisplayType.STICKY_BALLOON,
|
||||
myProject
|
||||
);
|
||||
Notifications.Bus.notify(new Notification(
|
||||
"Module Manager",
|
||||
ProjectBundle.message("module.unknown.type.title"),
|
||||
message,
|
||||
NotificationType.WARNING
|
||||
), myProject);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -136,9 +136,7 @@ public class ChangeListStorageImpl implements ChangeListStorage {
|
||||
ShowFilePathAction.open(file, new File(logFile));
|
||||
}
|
||||
}
|
||||
}),
|
||||
NotificationDisplayType.STICKY_BALLOON,
|
||||
null);
|
||||
}), null);
|
||||
}
|
||||
|
||||
public synchronized void close() {
|
||||
|
||||
@@ -162,7 +162,7 @@ public class StartupManagerImpl extends StartupManagerEx {
|
||||
BrowserUtil.launchBrowser(event.getURL().toString());
|
||||
}
|
||||
});
|
||||
Notifications.Bus.notify(n, NotificationDisplayType.STICKY_BALLOON, null);
|
||||
Notifications.Bus.notify(n, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class NotificationSettings {
|
||||
@Nullable
|
||||
public static NotificationSettings load(@NotNull final Element element) {
|
||||
final String displayTypeString = element.getAttributeValue("displayType");
|
||||
NotificationDisplayType displayType = NotificationDisplayType.STICKY_BALLOON;
|
||||
NotificationDisplayType displayType = NotificationDisplayType.BALLOON;
|
||||
boolean shouldLog = !"false".equals(element.getAttributeValue("shouldLog"));
|
||||
if ("BALLOON_ONLY".equals(displayTypeString)) {
|
||||
shouldLog = false;
|
||||
@@ -83,7 +83,7 @@ public class NotificationSettings {
|
||||
|
||||
result.setAttribute("groupId", getGroupId());
|
||||
final NotificationDisplayType displayType = getDisplayType();
|
||||
if (displayType != NotificationDisplayType.STICKY_BALLOON) {
|
||||
if (displayType != NotificationDisplayType.BALLOON) {
|
||||
result.setAttribute("displayType", displayType.toString());
|
||||
}
|
||||
if (!myShouldLog) {
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class NotificationsConfiguration implements ApplicationComponent, Notific
|
||||
@NotNull
|
||||
public static NotificationSettings getSettings(@NotNull final String groupId) {
|
||||
final NotificationSettings settings = getNotificationsConfiguration()._getSettings(groupId);
|
||||
return settings == null ? new NotificationSettings(groupId, NotificationDisplayType.STICKY_BALLOON, true) : settings;
|
||||
return settings == null ? new NotificationSettings(groupId, NotificationDisplayType.BALLOON, true) : settings;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ public class NotificationsManagerImpl extends NotificationsManager implements No
|
||||
}
|
||||
|
||||
public void notify(@NotNull Notification notification) {
|
||||
doNotify(notification, NotificationDisplayType.STICKY_BALLOON);
|
||||
doNotify(notification, NotificationDisplayType.BALLOON);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -125,7 +125,7 @@ public class NotificationsManagerImpl extends NotificationsManager implements No
|
||||
final NotificationsConfiguration configuration = NotificationsConfiguration.getNotificationsConfiguration();
|
||||
if (!configuration.isRegistered(notification.getGroupId())) {
|
||||
configuration.registerDefaultSettings(new NotificationSettings(notification.getGroupId(),
|
||||
displayType == null ? NotificationDisplayType.STICKY_BALLOON : displayType,
|
||||
displayType == null ? NotificationDisplayType.BALLOON : displayType,
|
||||
true));
|
||||
}
|
||||
|
||||
|
||||
@@ -465,7 +465,7 @@ public class ProjectImpl extends ComponentManagerImpl implements ProjectEx {
|
||||
final UnableToSaveProjectNotification[] notifications =
|
||||
NotificationsManager.getNotificationsManager().getNotificationsOfType(UnableToSaveProjectNotification.class, project);
|
||||
if (notifications.length == 0) {
|
||||
Notifications.Bus.notify(new UnableToSaveProjectNotification(project, readOnlyFiles), NotificationDisplayType.STICKY_BALLOON, project);
|
||||
Notifications.Bus.notify(new UnableToSaveProjectNotification(project, readOnlyFiles), project);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -117,19 +117,7 @@ public abstract class GenericNotifierImpl<T, Key> {
|
||||
notification = new MyNotification<T>(myGroupId, myTitle, getNotificationContent(obj), myType, myListener, obj, getToString(obj));
|
||||
myState.put(key, notification);
|
||||
}
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
if (application.isDispatchThread()) {
|
||||
Notifications.Bus.notify(notification, NotificationDisplayType.STICKY_BALLOON, myProject);
|
||||
} else {
|
||||
application.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
synchronized (myLock) {
|
||||
if (notification.isExpired() || ! myState.containsKey(getKey(notification.getObj()))) return;
|
||||
}
|
||||
Notifications.Bus.notify(notification, NotificationDisplayType.STICKY_BALLOON, myProject);
|
||||
}
|
||||
}, ModalityState.NON_MODAL, myProject.getDisposed());
|
||||
}
|
||||
Notifications.Bus.notify(notification, myProject);
|
||||
}
|
||||
|
||||
public void removeLazyNotificationByKey(final Key key) {
|
||||
|
||||
@@ -82,7 +82,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
*/
|
||||
public class GitVcs extends AbstractVcs<CommittedChangeList> {
|
||||
public static final NotificationGroup NOTIFICATION_GROUP_ID = new NotificationGroup("Git Messages", NotificationDisplayType.NONE, true);
|
||||
public static final NotificationGroup IMPORTANT_ERROR_NOTIFICATION = new NotificationGroup("Git Important Errors", NotificationDisplayType.STICKY_BALLOON, true);
|
||||
public static final NotificationGroup IMPORTANT_ERROR_NOTIFICATION = new NotificationGroup("Git Important Errors", NotificationDisplayType.BALLOON, true);
|
||||
public static final String NAME = "Git"; // Vcs name
|
||||
|
||||
private static final Logger log = Logger.getInstance(GitVcs.class.getName());
|
||||
|
||||
Reference in New Issue
Block a user