Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

disable typeahead in dialogs

  • Loading branch information...
commit d08eeca088e2ea65e87f070ddb0539f63148dcef 1 parent ef45a3d
Konstantin Bulenkov authored
4  platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java
@@ -491,6 +491,10 @@ protected boolean toBeShown() {
491 491
     return !myCheckBoxDoNotShowDialog.isSelected();
492 492
   }
493 493
 
  494
+  public boolean isTypeAheadEnabled() {
  495
+    return false;
  496
+  }
  497
+
494 498
   public static JPanel addDoNotShowCheckBox(JComponent southPanel, JCheckBox checkBox) {
495 499
     final JPanel panel = new JPanel(new BorderLayout());
496 500
 
5  platform/platform-impl/src/com/intellij/openapi/options/newEditor/OptionsEditorDialog.java
@@ -79,6 +79,11 @@ private static Configurable getPreselectedByDisplayName(final ConfigurableGroup[
79 79
     return result == null ? findLastSavedConfigurable(groups, project) : result;
80 80
   }
81 81
 
  82
+  @Override
  83
+  public boolean isTypeAheadEnabled() {
  84
+    return true;
  85
+  }
  86
+
82 87
   protected JComponent createCenterPanel() {
83 88
     myEditor = new OptionsEditor(myProject, myGroups, myPreselected);
84 89
     myEditor.getContext().addColleague(new OptionsEditorColleague.Adapter() {
11  platform/platform-impl/src/com/intellij/openapi/ui/impl/DialogWrapperPeerImpl.java
@@ -82,7 +82,7 @@
82 82
 
83 83
   private final ActionCallback myWindowFocusedCallback = new ActionCallback("DialogFocusedCallback");
84 84
   private final ActionCallback myTypeAheadDone = new ActionCallback("DialogTypeAheadDone");
85  
-  private final ActionCallback myTypeAheadCallback = new ActionCallback();
  85
+  private ActionCallback myTypeAheadCallback;
86 86
 
87 87
   /**
88 88
    * Creates modal <code>DialogWrapper</code>. The currently active window will be the dialog's parent.
@@ -95,6 +95,7 @@
95 95
    */
96 96
   protected DialogWrapperPeerImpl(DialogWrapper wrapper, Project project, boolean canBeParent) {
97 97
     myWrapper = wrapper;
  98
+    myTypeAheadCallback = myWrapper.isTypeAheadEnabled() ? new ActionCallback() : (ActionCallback)null;
98 99
     myWindowManager = null;
99 100
     Application application = ApplicationManager.getApplication();
100 101
     if (application != null && application.hasComponent(WindowManager.class)) {
@@ -378,7 +379,9 @@ public void setLocation(int x, int y) {
378 379
   }
379 380
 
380 381
   public ActionCallback show() {
381  
-    IdeFocusManager.getInstance(myProject).typeAheadUntil(myTypeAheadCallback);
  382
+    if (myTypeAheadCallback != null) {
  383
+      IdeFocusManager.getInstance(myProject).typeAheadUntil(myTypeAheadCallback);
  384
+    }
382 385
     final ActionCallback result = new ActionCallback();
383 386
 
384 387
     LOG.assertTrue(EventQueue.isDispatchThread(), "Access is allowed from event dispatch thread only");
@@ -953,7 +956,9 @@ public void run() {
953 956
                 notifyFocused(wrapper);
954 957
               }
955 958
             }
956  
-            myTypeAheadCallback.setDone();
  959
+            if (myTypeAheadCallback != null) {
  960
+              myTypeAheadCallback.setDone();
  961
+            }
957 962
           }
958 963
         });
959 964
       }

0 notes on commit d08eeca

Please sign in to comment.
Something went wrong with that request. Please try again.