diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java index 4026930f4e6f..11c8589d8ae8 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java @@ -93,7 +93,7 @@ class JavaClassNameInsertHandler implements InsertHandler toolWindow.activate(null, true, true)); + IdeFocusManager.getInstance(project).doWhenFocusSettlesDown(() -> toolWindow.activate(null, true, true), + ModalityState.current()); } else { IdeFocusManager.getInstance(project).doWhenFocusSettlesDown(() -> { @@ -916,7 +919,7 @@ public class Switcher extends AnAction implements DumbAware { } } } - }); + }, ModalityState.current()); } } diff --git a/platform/platform-impl/src/com/intellij/ui/EditorTextField.java b/platform/platform-impl/src/com/intellij/ui/EditorTextField.java index d516906618ec..a7da48ca76f2 100644 --- a/platform/platform-impl/src/com/intellij/ui/EditorTextField.java +++ b/platform/platform-impl/src/com/intellij/ui/EditorTextField.java @@ -404,7 +404,7 @@ public class EditorTextField extends NonOpaquePanel implements DocumentListener, // and only then execute another removal from the hierarchy. Otherwise // swing goes nuts because of nested removals and indices get corrupted EditorEx editor = myEditor; - SwingUtilities.invokeLater(() -> releaseEditor(editor)); + ApplicationManager.getApplication().invokeLater(() -> releaseEditor(editor)); myEditor = null; } diff --git a/xml/dom-openapi/src/com/intellij/util/xml/ui/UndoHelper.java b/xml/dom-openapi/src/com/intellij/util/xml/ui/UndoHelper.java index 01592e908c3d..97f5cc09d8ff 100644 --- a/xml/dom-openapi/src/com/intellij/util/xml/ui/UndoHelper.java +++ b/xml/dom-openapi/src/com/intellij/util/xml/ui/UndoHelper.java @@ -31,7 +31,6 @@ import java.util.Set; * @author peter */ public class UndoHelper { - private final Project myProject; private boolean myShowing; private final Set myCurrentDocuments = new HashSet<>(); private boolean myDirty; @@ -45,7 +44,6 @@ public class UndoHelper { }; public UndoHelper(final Project project, final Committable committable) { - myProject = project; final PsiDocumentManager psiDocumentManager = PsiDocumentManager.getInstance(project); CommandProcessor.getInstance().addCommandListener(new CommandAdapter() { @Override @@ -86,7 +84,6 @@ public class UndoHelper { } public final void setShowing(final boolean showing) { - commitAllDocuments(); myShowing = showing; } @@ -94,17 +91,6 @@ public class UndoHelper { return myShowing; } - public final void commitAllDocuments() { - final PsiDocumentManager manager = getDocumentManager(); - for (final Document document : myCurrentDocuments) { - manager.commitDocument(document); - } - } - - private PsiDocumentManager getDocumentManager() { - return PsiDocumentManager.getInstance(myProject); - } - public final void addWatchedDocument(final Document document) { stopListeningDocuments(); myCurrentDocuments.add(document);