mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-69532 (CVS: history view is empty; CompareWith... dialog shows no revisions)
This commit is contained in:
@@ -46,6 +46,22 @@ public class WaitForProgressToShow {
|
||||
}
|
||||
}
|
||||
|
||||
public static void runOrInvokeAndWaitAboveProgress(final Runnable command, @Nullable final ModalityState modalityState) {
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
if (application.isDispatchThread()) {
|
||||
command.run();
|
||||
} else {
|
||||
final ProgressIndicator pi = ProgressManager.getInstance().getProgressIndicator();
|
||||
if (pi != null) {
|
||||
execute(pi);
|
||||
application.invokeAndWait(command, pi.getModalityState());
|
||||
} else {
|
||||
final ModalityState notNullModalityState = modalityState == null ? ModalityState.NON_MODAL : modalityState;
|
||||
application.invokeAndWait(command, notNullModalityState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void runOrInvokeLaterAboveProgress(final Runnable command, @Nullable final ModalityState modalityState, @NotNull final Project project) {
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
if (application.isDispatchThread()) {
|
||||
|
||||
+1
-2
@@ -47,8 +47,7 @@ public class ModalityContextImpl implements ModalityContext {
|
||||
action.run();
|
||||
}
|
||||
else {
|
||||
ModalityState modalityState = getCurrentModalityState();
|
||||
WaitForProgressToShow.runOrInvokeLaterAboveProgress(action, modalityState, project);
|
||||
WaitForProgressToShow.runOrInvokeAndWaitAboveProgress(action, getCurrentModalityState());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user