Search in sources :

Example 1 with CitationStyleWorker

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();
    }
}
Also used : CitationStyleWorker(org.jabref.gui.worker.CitationStyleWorker) BibDatabaseContext(org.jabref.model.database.BibDatabaseContext)

Aggregations

CitationStyleWorker (org.jabref.gui.worker.CitationStyleWorker)1 BibDatabaseContext (org.jabref.model.database.BibDatabaseContext)1