From 98ebdab195f6eb3ccf29375bc0e5422bfc2dc5a1 Mon Sep 17 00:00:00 2001 From: Vojtech Krasa Date: Fri, 7 Dec 2012 13:35:46 +0100 Subject: [PATCH] IDEA-94184 hardcoded value ChooseByNameBase#REBUILD_DELAY moved to registry.properties --- .../ide/util/gotoByName/ChooseByNameBase.java | 11 ++++++----- .../src/misc/registry.properties | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java index 5573cd5970ff..e9cd42026340 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java @@ -130,7 +130,7 @@ public abstract class ChooseByNameBase { @NonNls private static final String NOT_FOUND_CARD = "nfound"; @NonNls private static final String CHECK_BOX_CARD = "chkbox"; @NonNls private static final String SEARCHING_CARD = "searching"; - private static final int REBUILD_DELAY = 300; + private final int myRebuildDelay; private final Alarm myHideAlarm = new Alarm(); private boolean myShowListAfterCompletionKeyStroke = false; @@ -185,6 +185,7 @@ public abstract class ChooseByNameBase { myProvider = provider; myInitialIndex = initialIndex; mySearchInAnyPlace = Registry.is("ide.goto.middle.matching") && model.useMiddleMatching(); + myRebuildDelay = Registry.intValue("ide.goto.rebuild.delay"); } public void setShowListAfterCompletionKeyStroke(boolean showListAfterCompletionKeyStroke) { @@ -584,7 +585,7 @@ public abstract class ChooseByNameBase { case KeyEvent.VK_ENTER: if (myList.getSelectedValue() == EXTRA_ELEM) { myMaximumListSizeLimit += myListSizeIncreasing; - rebuildList(myList.getSelectedIndex(), REBUILD_DELAY, null, ModalityState.current()); + rebuildList(myList.getSelectedIndex(), myRebuildDelay, null, ModalityState.current()); e.consume(); } break; @@ -627,7 +628,7 @@ public abstract class ChooseByNameBase { if (selectedCellBounds != null && selectedCellBounds.contains(e.getPoint())) { // Otherwise it was reselected in the selection listener if (myList.getSelectedValue() == EXTRA_ELEM) { myMaximumListSizeLimit += myListSizeIncreasing; - rebuildList(selectedIndex, REBUILD_DELAY, null, ModalityState.current()); + rebuildList(selectedIndex, myRebuildDelay, null, ModalityState.current()); } else { doClose(true); @@ -706,11 +707,11 @@ public abstract class ChooseByNameBase { } /** - * Default rebuild list. It uses {@link #REBUILD_DELAY} and current modality state. + * Default rebuild list. It uses {@link #myRebuildDelay} and current modality state. */ public void rebuildList(boolean initial) { // TODO this method is public, because the chooser does not listed for the model. - rebuildList(initial ? myInitialIndex : 0, REBUILD_DELAY, null, ModalityState.current()); + rebuildList(initial ? myInitialIndex : 0, myRebuildDelay, null, ModalityState.current()); } private void updateDocPosition() { diff --git a/platform/platform-resources-en/src/misc/registry.properties b/platform/platform-resources-en/src/misc/registry.properties index 035f579cb6f2..1dab41c34b6c 100644 --- a/platform/platform-resources-en/src/misc/registry.properties +++ b/platform/platform-resources-en/src/misc/registry.properties @@ -202,6 +202,7 @@ ide.completion.middle.matching.description=Suggest items in completion that cont ide.goto.middle.matching=true # suppress inspection "UnusedProperty" ide.goto.middle.matching.description=Suggest items in goto actions that contain the entered string somewhere in the middle. +ide.goto.rebuild.delay=300 ide.enable.toolwindow.stack=false