File tree 1 file changed +9
-7
lines changed
src/main/java/org/jabref/gui/importer
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -108,13 +108,15 @@ private void initialize() {
108
108
container .getStyleClass ().add ("entry-container" );
109
109
BindingsHelper .includePseudoClassWhen (container , entrySelected , addToggle .selectedProperty ());
110
110
111
- if (viewModel .hasDuplicate (entry )) {
112
- Button duplicateButton = IconTheme .JabRefIcons .DUPLICATE .asButton ();
113
- duplicateButton .setTooltip (new Tooltip (Localization .lang ("Possible duplicate of existing entry. Click to resolve." )));
114
- duplicateButton .setOnAction (event -> viewModel .resolveDuplicate (entry ));
115
- container .getChildren ().add (1 , duplicateButton );
116
- }
117
-
111
+ Callable <Boolean > hasDuplicateEntryTask = () -> viewModel .hasDuplicate (entry );
112
+ BackgroundTask .wrap (hasDuplicateEntryTask ).onSuccess (e -> {
113
+ if (e ) {
114
+ Button duplicateButton = IconTheme .JabRefIcons .DUPLICATE .asButton ();
115
+ duplicateButton .setTooltip (new Tooltip (Localization .lang ("Possible duplicate of existing entry. Click to resolve." )));
116
+ duplicateButton .setOnAction (event -> viewModel .resolveDuplicate (entry ));
117
+ container .getChildren ().add (1 , duplicateButton );
118
+ }
119
+ }).executeWith (Globals .TASK_EXECUTOR );
118
120
return container ;
119
121
})
120
122
.withOnMouseClickedEvent ((entry , event ) -> entriesListView .getCheckModel ().toggleCheckState (entry ))
You can’t perform that action at this time.
0 commit comments