mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Do not wait for frame to be activated for project-level notifications
This commit is contained in:
@@ -49,19 +49,36 @@ public interface Notifications {
|
||||
}
|
||||
|
||||
public static void notify(@NotNull final Notification notification, @NotNull final NotificationDisplayType defaultDisplayType, @Nullable final Project project) {
|
||||
if (project != null && !project.isInitialized()) {
|
||||
StartupManager.getInstance(project).runWhenProjectIsInitialized(new Runnable() {
|
||||
public void run() {
|
||||
project.getMessageBus().syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
});
|
||||
if (project != null && !project.isDisposed()) {
|
||||
if (!project.isInitialized()) {
|
||||
StartupManager.getInstance(project).runWhenProjectIsInitialized(new Runnable() {
|
||||
public void run() {
|
||||
project.getMessageBus().syncPublisher(TOPIC).notify(notification, defaultDisplayType);
|
||||
}
|
||||
});
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
FrameStateManager.getInstance().getApplicationActive().doWhenDone(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final MessageBus bus = project == null ? ApplicationManager.getApplication().getMessageBus() : (project.isDisposed() ? null : project.getMessageBus());
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user