Skip to content

Commit

Permalink
Try to fix damn auto complete thread error
Browse files Browse the repository at this point in the history
  • Loading branch information
Siedlerchr committed May 9, 2020
1 parent 0344f00 commit d783c13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ task deleteInstallerTemp(type: Delete) {

jpackage.dependsOn deleteInstallerTemp
jlink {
options = ['--strip-debug','--compress', '2', '--no-header-files', '--no-man-pages']
options = ['--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'JabRef'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import javafx.util.Callback;
import javafx.util.StringConverter;

import org.jabref.gui.util.DefaultTaskExecutor;

import org.controlsfx.control.textfield.AutoCompletionBinding;

/**
Expand Down Expand Up @@ -73,9 +75,9 @@ private AutoCompletionTextInputBinding(final TextInputControl textInputControl,
Callback<ISuggestionRequest, Collection<T>> suggestionProvider) {

this(textInputControl,
suggestionProvider,
AutoCompletionTextInputBinding.defaultStringConverter(),
new ReplaceStrategy());
suggestionProvider,
AutoCompletionTextInputBinding.defaultStringConverter(),
new ReplaceStrategy());
}

private AutoCompletionTextInputBinding(final TextInputControl textInputControl,
Expand All @@ -98,7 +100,8 @@ private AutoCompletionTextInputBinding(final TextInputControl textInputControl,
}

private static <T> StringConverter<T> defaultStringConverter() {
return new StringConverter<T>() {
return new StringConverter<>() {

@Override
public String toString(T t) {
return t == null ? null : t.toString();
Expand Down Expand Up @@ -133,7 +136,8 @@ private void setUserInputText(String newText) {
newText = "";
}
AutoCompletionInput input = inputAnalyzer.analyze(newText);
setUserInput(input.getUnfinishedPart());
DefaultTaskExecutor.runInJavaFXThread(() -> setUserInput(input.getUnfinishedPart()));

}

@Override
Expand Down

0 comments on commit d783c13

Please sign in to comment.