Focus: fixed isExpired() in FocusTrackback that caused keyboard to stop working after...
authorKirill Kalishev <Kirill.Kalishev@jetbrains.com>
Mon, 14 Sep 2009 11:04:03 +0000 (15:04 +0400)
committerKirill Kalishev <Kirill.Kalishev@jetbrains.com>
Mon, 14 Sep 2009 11:04:03 +0000 (15:04 +0400)
platform/platform-impl/src/com/intellij/ui/FocusTrackback.java

index 68398801f5e51475fe73de721c224c57881075c7..c37e1fd3e2b141457e0ba467b2cdcecd28bbbe67 100644 (file)
@@ -166,16 +166,7 @@ public class FocusTrackback {
 
     if (project != null && !project.isDisposed()) {
       final IdeFocusManager focusManager = IdeFocusManager.getInstance(project);
-      focusManager.requestFocus(new FocusCommand() {
-        public ActionCallback run() {
-          _restoreFocus();
-          return new ActionCallback.Done();
-        }
-
-        public String toString() {
-          return "focus trackback";
-        }
-      }, false).doWhenProcessed(new Runnable() {
+      focusManager.requestFocus(new MyFocusCommand(), false).doWhenProcessed(new Runnable() {
         public void run() {
           dispose();
         }
@@ -382,4 +373,19 @@ public class FocusTrackback {
   }
 
 
+  private class MyFocusCommand extends FocusCommand {
+    public ActionCallback run() {
+      _restoreFocus();
+      return new ActionCallback.Done();
+    }
+
+    @Override
+    public boolean isExpired() {
+      return isConsumed();
+    }
+
+    public String toString() {
+      return "focus trackback";
+    }
+  }
 }
\ No newline at end of file