From 444512561687470f6d6b8e59035146b351230c37 Mon Sep 17 00:00:00 2001 From: Joerg Lenhard Date: Wed, 3 Jan 2018 16:16:47 +0100 Subject: [PATCH 1/2] Disable autocompletion in the search bar based on preferences --- CHANGELOG.md | 3 ++- .../java/org/jabref/gui/search/GlobalSearchBar.java | 11 +++++++---- 2 files changed, 9 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..8b30315ab66 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -52,6 +52,7 @@ import org.jabref.logic.search.SearchQueryHighlightObservable; import org.jabref.model.entry.Author; import org.jabref.model.entry.BibEntry; +import org.jabref.preferences.JabRefPreferences; import org.jabref.preferences.SearchPreferences; import org.fxmisc.easybind.EasyBind; @@ -359,10 +360,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() { From aa7fd2a387990ba06086a8c3edd77855c2e7c91d Mon Sep 17 00:00:00 2001 From: Joerg Lenhard Date: Wed, 3 Jan 2018 16:18:51 +0100 Subject: [PATCH 2/2] Remove unused import --- src/main/java/org/jabref/gui/search/GlobalSearchBar.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java index 8b30315ab66..4d12cb41cd7 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -52,7 +52,6 @@ import org.jabref.logic.search.SearchQueryHighlightObservable; import org.jabref.model.entry.Author; import org.jabref.model.entry.BibEntry; -import org.jabref.preferences.JabRefPreferences; import org.jabref.preferences.SearchPreferences; import org.fxmisc.easybind.EasyBind;