mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-161519 java.lang.IllegalStateException: The DialogWrapper can only be used in event dispatch...
This commit is contained in:
@@ -19,7 +19,6 @@ import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.Conditions;
|
||||
import com.intellij.openapi.wm.impl.commands.FinalizableCommand;
|
||||
import com.intellij.util.ui.EdtInvocationManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -45,19 +44,17 @@ public final class CommandProcessor implements Runnable {
|
||||
* prevent focus handling of events which is caused by the commands to be executed.
|
||||
*/
|
||||
public final void execute(@NotNull List<FinalizableCommand> commandList, @NotNull Condition expired) {
|
||||
EdtInvocationManager.getInstance().invokeLater(() -> {
|
||||
synchronized (myLock) {
|
||||
final boolean isBusy = myCommandCount > 0;
|
||||
synchronized (myLock) {
|
||||
final boolean isBusy = myCommandCount > 0;
|
||||
|
||||
final CommandGroup commandGroup = new CommandGroup(commandList, expired);
|
||||
myCommandGroupList.add(commandGroup);
|
||||
myCommandCount += commandList.size();
|
||||
final CommandGroup commandGroup = new CommandGroup(commandList, expired);
|
||||
myCommandGroupList.add(commandGroup);
|
||||
myCommandCount += commandList.size();
|
||||
|
||||
if (!isBusy) {
|
||||
run();
|
||||
}
|
||||
if (!isBusy) {
|
||||
run();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public final void run() {
|
||||
|
||||
+9
-5
@@ -16,6 +16,7 @@
|
||||
package com.intellij.openapi.wm.impl.commands;
|
||||
|
||||
|
||||
import com.intellij.util.ui.EdtInvocationManager;
|
||||
|
||||
/**
|
||||
* @author Vladimir Kondratyev
|
||||
@@ -29,11 +30,14 @@ public final class InvokeLaterCmd extends FinalizableCommand{
|
||||
}
|
||||
|
||||
public void run(){
|
||||
try{
|
||||
myRunnable.run();
|
||||
}finally{
|
||||
finish();
|
||||
}
|
||||
EdtInvocationManager.getInstance().invokeLater(() -> {
|
||||
try {
|
||||
myRunnable.run();
|
||||
}
|
||||
finally {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user