mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use app invokeLater in toolwindow CommandProcessor to avoid transaction assertions (EA-82213)
This commit is contained in:
@@ -81,13 +81,16 @@ public final class CommandProcessor implements Runnable {
|
||||
final boolean queueNext = myCommandCount > 0;
|
||||
Application application = ApplicationManager.getApplication();
|
||||
ModalityState modalityState = Registry.is("ide.perProjectModality") ? ModalityState.defaultModalityState() : ModalityState.NON_MODAL;
|
||||
application.getInvokator().invokeLater(command, modalityState, expire == null ? application.getDisposed() : expire).doWhenDone(new Runnable() {
|
||||
public void run() {
|
||||
application.invokeLater(() -> {
|
||||
try {
|
||||
command.run();
|
||||
}
|
||||
finally {
|
||||
if (queueNext) {
|
||||
CommandProcessor.this.run();
|
||||
this.run();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, modalityState, expire == null ? application.getDisposed() : expire);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user