diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java index e71072cbdcd..6b6c2241b3a 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchBar.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchBar.java @@ -1,6 +1,5 @@ package org.jabref.gui.search; -import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; @@ -59,11 +58,6 @@ public class GlobalSearchBar extends JPanel { - private static final Color NEUTRAL_COLOR = Color.WHITE; - private static final Color NO_RESULTS_COLOR = new Color(232, 202, 202); - private static final Color RESULTS_FOUND_COLOR = new Color(217, 232, 202); - private static final Color ADVANCED_SEARCH_COLOR = new Color(102, 255, 255); - private static final PseudoClass CLASS_NO_RESULTS = PseudoClass.getPseudoClass("emptyResult"); private static final PseudoClass CLASS_RESULTS_FOUND = PseudoClass.getPseudoClass("emptyResult"); @@ -192,10 +186,10 @@ public void actionPerformed(ActionEvent e) { container = OS.LINUX ? new CustomJFXPanel() : new JFXPanel(); DefaultTaskExecutor.runInJavaFXThread(() -> { - container.setScene(new Scene(searchField)); - container.getScene().getStylesheets().add(GlobalSearchBar.class.getResource("../Main.css").toExternalForm()); + Scene scene = new Scene(searchField); + scene.getStylesheets().add(GlobalSearchBar.class.getResource("../Main.css").toExternalForm()); + container.setScene(scene); container.addKeyListener(new SearchKeyAdapter()); - }); setLayout(new FlowLayout(FlowLayout.RIGHT)); @@ -247,7 +241,7 @@ private void openLocalFindingsInExternalPanel() { SearchResultFrame searchDialog = new SearchResultFrame(currentBasePanel.frame(), Localization.lang("Search results in library %0 for %1", currentBasePanel.getBibDatabaseContext() - .getDatabaseFile().map(File::getName).orElse(GUIGlobals.UNTITLED_TITLE), + .getDatabaseFile().map(File::getName).orElse(GUIGlobals.UNTITLED_TITLE), this.getSearchQuery().localize()), getSearchQuery(), false); List entries = currentBasePanel.getDatabase().getEntries().stream() @@ -369,7 +363,6 @@ public void setAutoCompleter(AutoCompleteSuggestionProvider searchComple searchCompleter, new PersonNameStringConverter(false, false, AutoCompleteFirstNameMode.BOTH), new AppendPersonNamesStrategy()); - } public SearchQueryHighlightObservable getSearchQueryHighlightObservable() { @@ -415,7 +408,6 @@ public void setSearchTerm(String searchTerm) { setDontSelectSearchBar(); DefaultTaskExecutor.runInJavaFXThread(() -> searchField.setText(searchTerm)); - } public void setDontSelectSearchBar() {