@@ -36,6 +36,7 @@ public class EntryTypeViewModel {
36
36
37
37
private final JabRefPreferences prefs ;
38
38
private final BooleanProperty searchingProperty = new SimpleBooleanProperty ();
39
+ private final BooleanProperty searchSuccesfulProperty = new SimpleBooleanProperty ();
39
40
private final ObjectProperty <IdBasedFetcher > selectedItemProperty = new SimpleObjectProperty <>();
40
41
private final ListProperty <IdBasedFetcher > fetchers = new SimpleListProperty <>(FXCollections .observableArrayList ());
41
42
private final StringProperty idText = new SimpleStringProperty ();
@@ -53,6 +54,10 @@ public EntryTypeViewModel(JabRefPreferences preferences, BasePanel basePanel, Di
53
54
54
55
}
55
56
57
+ public BooleanProperty searchSuccesfulProperty () {
58
+ return searchSuccesfulProperty ;
59
+ }
60
+
56
61
public BooleanProperty searchingProperty () {
57
62
return searchingProperty ;
58
63
}
@@ -110,6 +115,7 @@ protected Optional<BibEntry> call() throws InterruptedException, FetcherExceptio
110
115
}
111
116
112
117
public void runFetcherWorker () {
118
+ searchSuccesfulProperty .set (false );
113
119
fetcherWorker .run ();
114
120
fetcherWorker .setOnFailed (event -> {
115
121
Throwable exception = fetcherWorker .getException ();
@@ -124,7 +130,9 @@ public void runFetcherWorker() {
124
130
LOGGER .error (String .format ("Exception during fetching when using fetcher '%s' with entry id '%s'." , searchId , fetcher ), exception );
125
131
126
132
searchingProperty .set (false );
133
+
127
134
fetcherWorker = new FetcherWorker ();
135
+
128
136
});
129
137
130
138
fetcherWorker .setOnSucceeded (evt -> {
@@ -143,8 +151,8 @@ public void runFetcherWorker() {
143
151
new BibtexKeyGenerator (basePanel .getBibDatabaseContext (), prefs .getBibtexKeyPatternPreferences ()).generateAndSetKey (bibEntry );
144
152
basePanel .insertEntry (bibEntry );
145
153
}
154
+ searchSuccesfulProperty .set (true );
146
155
147
- // close();
148
156
} else if (StringUtil .isBlank (idText .getValue ())) {
149
157
dialogService .showWarningDialogAndWait (Localization .lang ("Empty search ID" ), Localization .lang ("The given search ID was empty." ));
150
158
}
0 commit comments