From a5b5a363834182b7fde9babf3284951927ee7540 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Sat, 26 Jan 2019 22:13:44 +0100 Subject: [PATCH 1/2] Try to fix not on FX thread for search and autocomplete --- src/main/java/org/jabref/gui/BasePanel.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index a2e7e5734b6..1437c54577e 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -1345,39 +1345,41 @@ public void listen(EntryRemovedEvent entryRemovedEvent) { /** * Ensures that the search auto completer is up to date when entries are changed AKA Let the auto completer, if any, * harvest words from the entry + * Actual methods for autocomplete indexing must run in javafx thread */ private class SearchAutoCompleteListener { @Subscribe public void listen(EntryAddedEvent addedEntryEvent) { - searchAutoCompleter.indexEntry(addedEntryEvent.getBibEntry()); + DefaultTaskExecutor.runInJavaFXThread(() -> searchAutoCompleter.indexEntry(addedEntryEvent.getBibEntry())); } @Subscribe public void listen(EntryChangedEvent entryChangedEvent) { - searchAutoCompleter.indexEntry(entryChangedEvent.getBibEntry()); + DefaultTaskExecutor.runInJavaFXThread(() -> searchAutoCompleter.indexEntry(entryChangedEvent.getBibEntry())); } } /** * Ensures that the results of the current search are updated when a new entry is inserted into the database + * Actual methods for performaing search must run in javafx thread */ private class SearchListener { @Subscribe public void listen(EntryAddedEvent addedEntryEvent) { - frame.getGlobalSearchBar().performSearch(); + DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch()); } @Subscribe public void listen(EntryChangedEvent entryChangedEvent) { - frame.getGlobalSearchBar().performSearch(); + DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch()); } @Subscribe public void listen(EntryRemovedEvent removedEntryEvent) { // IMO only used to update the status (found X entries) - frame.getGlobalSearchBar().performSearch(); + DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch()); } } From 0cc9e219b8c504b3153645efe58d03c646ec18da Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Sat, 26 Jan 2019 22:22:08 +0100 Subject: [PATCH 2/2] fix comment text --- src/main/java/org/jabref/gui/BasePanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index 1437c54577e..777c06eaf6f 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -1362,7 +1362,7 @@ public void listen(EntryChangedEvent entryChangedEvent) { /** * Ensures that the results of the current search are updated when a new entry is inserted into the database - * Actual methods for performaing search must run in javafx thread + * Actual methods for performing search must run in javafx thread */ private class SearchListener {