use of org.jabref.gui.worker.CitationStyleWorker in project jabref by JabRef.
the class PreviewPanel method update.
public void update() {
// Set entry number in case that is included in the preview layout.
ExportFormats.entryNumber = 1;
if (citationStyleWorker.isPresent()) {
citationStyleWorker.get().cancel(true);
citationStyleWorker = Optional.empty();
}
if (layout.isPresent()) {
StringBuilder sb = new StringBuilder();
bibEntry.ifPresent(entry -> sb.append(layout.get().doLayout(entry, databaseContext.map(BibDatabaseContext::getDatabase).orElse(null))));
setPreviewLabel(sb.toString());
markHighlights();
} else if (basePanel.isPresent()) {
citationStyleWorker = Optional.of(new CitationStyleWorker(this, previewPane));
citationStyleWorker.get().execute();
}
}
Aggregations