use of org.jabref.logic.importer.FulltextFetchers in project jabref by JabRef.
the class LinkedFilesEditorViewModel method fetchFulltext.
public void fetchFulltext() {
if (entry.isPresent()) {
FulltextFetchers fetcher = new FulltextFetchers(Globals.prefs.getImportFormatPreferences());
BackgroundTask.wrap(() -> fetcher.findFullTextPDF(entry.get())).onRunning(() -> fulltextLookupInProgress.setValue(true)).onFinished(() -> fulltextLookupInProgress.setValue(false)).onSuccess(url -> {
if (url.isPresent()) {
addFromURL(url.get());
} else {
dialogService.notify(Localization.lang("Full text document download failed"));
}
}).executeWith(taskExecutor);
}
}
use of org.jabref.logic.importer.FulltextFetchers in project jabref by JabRef.
the class FindFullTextAction method run.
@Override
public void run() {
if (basePanel.getSelectedEntries().size() >= warningLimit) {
String[] options = new String[] { Localization.lang("Look up full text documents"), Localization.lang("Cancel") };
int answer = JOptionPane.showOptionDialog(basePanel.frame(), Localization.lang("You are about to look up full text documents for %0 entries.", String.valueOf(basePanel.getSelectedEntries().size())) + "\n" + Localization.lang("JabRef will send at least one request per entry to a publisher.") + "\n" + Localization.lang("Do you still want to continue?"), Localization.lang("Look up full text documents"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]);
if (answer != JOptionPane.OK_OPTION) {
basePanel.output(Localization.lang("Operation canceled."));
return;
}
}
for (BibEntry entry : basePanel.getSelectedEntries()) {
FulltextFetchers fft = new FulltextFetchers(Globals.prefs.getImportFormatPreferences());
downloads.put(fft.findFullTextPDF(entry), entry);
}
}
Aggregations