handle MethodOrClosureScopeChooser selection in a write-safe context (EA-90852 -...
authorpeter <peter@jetbrains.com>
Sat, 29 Oct 2016 10:35:28 +0000 (12:35 +0200)
committerpeter <peter@jetbrains.com>
Sat, 29 Oct 2016 11:29:05 +0000 (13:29 +0200)
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/ui/MethodOrClosureScopeChooser.java

index c977bbe66d6147ce477244bba30871e79640bce4..5a1bfa1fd36312439752c43b79606eb4a7f180a7 100644 (file)
@@ -15,6 +15,7 @@
  */
 package org.jetbrains.plugins.groovy.refactoring.ui;
 
+import com.intellij.openapi.application.ModalityState;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.colors.EditorColors;
@@ -151,7 +152,7 @@ public class MethodOrClosureScopeChooser {
           else {
             toSearchFor = superMethod.isEnabled() && superMethod.isSelected() ? ToSearchIn.getParent() : null;
           }
-          IdeFocusManager.findInstance().doWhenFocusSettlesDown(() -> callback.fun(ToSearchIn, toSearchFor));
+          IdeFocusManager.findInstance().doWhenFocusSettlesDown(() -> callback.fun(ToSearchIn, toSearchFor), ModalityState.current());
         }
       }, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)));