diff --git a/CHANGELOG.md b/CHANGELOG.md index 6060ff558b8f..a35f50868dbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We moved the location of the 'Open only one instance of JabRef' preference option from "Network" to "General". [#9306](https://github.com/JabRef/jabref/issues/9306) - The two previews in the change resolver dialog now have their scrollbars synchronized. [#9576](https://github.com/JabRef/jabref/issues/9576). - We changed the setting of the keyword separator to accept a single character only. [#177](https://github.com/koppor/jabref/issues/177) - +- We replaced "SearchAll" in Web Search by "Search Selected" [#10556](https://github.com/JabRef/jabref/issues/10556) ### Fixed - We fixed an issue where the added protected term has unwanted leading and trailing whitespaces, where the formatted text has unwanted empty brackets and where the word at the cursor in the textbox can be added to the list. [#10415](https://github.com/JabRef/jabref/issues/10415). diff --git a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java index 5634e4e74509..49beb69f81d9 100644 --- a/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java +++ b/src/main/java/org/jabref/gui/importer/fetcher/WebSearchPaneViewModel.java @@ -1,7 +1,10 @@ package org.jabref.gui.importer.fetcher; +import java.util.Comparator; import java.util.Map; +import java.util.Objects; import java.util.SortedSet; +import java.util.TreeSet; import java.util.concurrent.Callable; import javafx.beans.property.ListProperty; @@ -22,6 +25,7 @@ import org.jabref.logic.importer.ParserResult; import org.jabref.logic.importer.SearchBasedFetcher; import org.jabref.logic.importer.WebFetchers; +import org.jabref.logic.importer.fetcher.CompositeSearchBasedFetcher; import org.jabref.logic.l10n.Localization; import org.jabref.model.strings.StringUtil; import org.jabref.model.util.OptionalUtil; @@ -57,9 +61,10 @@ public WebSearchPaneViewModel(PreferencesService preferencesService, DialogServi this.stateManager = stateManager; this.preferencesService = preferencesService; - SortedSet allFetchers = WebFetchers.getSearchBasedFetchers( + SortedSet allFetchers = new TreeSet<>(new CompositeSearchFirstComparator()); + allFetchers.addAll(WebFetchers.getSearchBasedFetchers( preferencesService.getImportFormatPreferences(), - preferencesService.getImporterPreferences()); + preferencesService.getImporterPreferences())); fetchers.setAll(allFetchers); // Choose last-selected fetcher as default @@ -174,3 +179,14 @@ public ValidationStatus queryValidationStatus() { return searchQueryValidator.getValidationStatus(); } } + +class CompositeSearchFirstComparator implements Comparator { + @Override + public int compare(SearchBasedFetcher s1, SearchBasedFetcher s2) { + if (Objects.equals(s1.getName(), CompositeSearchBasedFetcher.FETCHER_NAME)) { + return -1; + } else { + return s1.getName().compareTo(s2.getName()); + } + } +} diff --git a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml index 6bd19f653ca9..99c142efb191 100644 --- a/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/websearch/WebSearchTab.fxml @@ -5,6 +5,8 @@ + + @@ -25,6 +27,25 @@ +