mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid dups
This commit is contained in:
@@ -58,17 +58,8 @@ public interface Notifications {
|
||||
});
|
||||
}
|
||||
else {
|
||||
if (EventQueue.isDispatchThread()) {
|
||||
project.getMessageBus().syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
else {
|
||||
//noinspection SSBasedInspection
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
project.getMessageBus().syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
});
|
||||
}
|
||||
final MessageBus bus = project.getMessageBus();
|
||||
_notify(notification, defaultDisplayType, bus);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -80,20 +71,24 @@ public interface Notifications {
|
||||
final MessageBus bus =
|
||||
project == null ? ApplicationManager.getApplication().getMessageBus() : (project.isDisposed() ? null : project.getMessageBus());
|
||||
if (bus != null) {
|
||||
if (EventQueue.isDispatchThread()) {
|
||||
bus.syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
else {
|
||||
//noinspection SSBasedInspection
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
bus.syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
});
|
||||
}
|
||||
_notify(notification, defaultDisplayType, bus);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void _notify(final Notification notification, final NotificationDisplayType defaultDisplayType, final MessageBus bus) {
|
||||
if (EventQueue.isDispatchThread()) {
|
||||
bus.syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
else {
|
||||
//noinspection SSBasedInspection
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
bus.syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user