From 193bbbca670bf478f0b0ec7cb5512638c6521122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Lenhard?= Date: Wed, 3 Jan 2018 20:40:56 +0100 Subject: [PATCH] Make it possible to disable autocompletion in the search bar (#3600) --- CHANGELOG.md | 3 ++- .../java/org/jabref/gui/search/GlobalSearchBar.java | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 363b6d7cb94..fc185065e8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# ### Fixed - We fixed the missing dot in the name of an exported file. [#3576](https://github.com/JabRef/jabref/issues/3576) +- Autocompletion in the search bar can now be disabled via the preferences [#3598](https://github.com/JabRef/jabref/issues/3598) ### Removed - We removed the Look and Feels from jgoodies, because these are not compatible with Java 9 @@ -115,7 +116,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the same Java Look and Feel would be listed more than once in the Preferences. [#3391](https://github.com/JabRef/jabref/issues/3391) - We fixed an issue where errors in citation styles triggered an exception when opening the preferences dialog. [#3389](https://github.com/JabRef/jabref/issues/3389) - We fixed an issue where entries were displayed twice after insertion into a shared database. [#3164](https://github.com/JabRef/jabref/issues/3164) - - We improved the auto link algorithm so that files starting with a similar key are no longer found (e.g, `Einstein1902` vs `Einstein1902a`). [#3472](https://github.com/JabRef/jabref/issues/3472) + - We improved the auto link algorithm so that files starting with a similar key are no longer found (e.g, `Einstein1902` vs `Einstein1902a`). [#3472](https://github.com/JabRef/jabref/issues/3472) - We fixed an issue where special fields (such as `printed`) could not be cleared when syncing special fields via the keywords. [#3432](https://github.com/JabRef/jabref/issues/3432) - We fixed an issue where the tooltip of the global search bar showed html tags instead of formatting the text. [#3381](https://github.com/JabRef/jabref/issues/3381) - We fixed an issue where timestamps were not updated for changed entries. [#2810](https://github.com/JabRef/jabref/issues/2810) diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java index 0ae87009cae..4d12cb41cd7 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -359,10 +359,12 @@ private void informUserAboutInvalidSearchQuery() { } public void setAutoCompleter(AutoCompleteSuggestionProvider searchCompleter) { - AutoCompletionTextInputBinding.autoComplete(searchField, - searchCompleter, - new PersonNameStringConverter(false, false, AutoCompleteFirstNameMode.BOTH), - new AppendPersonNamesStrategy()); + if (Globals.prefs.getAutoCompletePreferences().shouldAutoComplete()) { + AutoCompletionTextInputBinding.autoComplete(searchField, + searchCompleter, + new PersonNameStringConverter(false, false, AutoCompleteFirstNameMode.BOTH), + new AppendPersonNamesStrategy()); + } } public SearchQueryHighlightObservable getSearchQueryHighlightObservable() {