Search in sources :

Example 6 with BibEntryWriter

use of org.jabref.logic.bibtex.BibEntryWriter in project jabref by JabRef.

the class BasicAction method updateSourceView.

// update the bibtex source view and available List
private void updateSourceView() {
    StringWriter sw = new StringWriter(200);
    try {
        new BibEntryWriter(new LatexFieldFormatter(Globals.prefs.getLatexFieldFormatterPreferences()), false).write(entry, sw, frame.getCurrentBasePanel().getBibDatabaseContext().getMode());
        sourcePreview.setText(sw.getBuffer().toString());
    } catch (IOException ex) {
        LOGGER.error("Error in entry" + ": " + ex.getMessage(), ex);
    }
    fieldList.clearSelection();
}
Also used : StringWriter(java.io.StringWriter) IOException(java.io.IOException) BibEntryWriter(org.jabref.logic.bibtex.BibEntryWriter) LatexFieldFormatter(org.jabref.logic.bibtex.LatexFieldFormatter)

Aggregations

StringWriter (java.io.StringWriter)6 BibEntryWriter (org.jabref.logic.bibtex.BibEntryWriter)6 LatexFieldFormatter (org.jabref.logic.bibtex.LatexFieldFormatter)6 IOException (java.io.IOException)3 BibEntry (org.jabref.model.entry.BibEntry)2 Desktop (java.awt.Desktop)1 File (java.io.File)1 FileReader (java.io.FileReader)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 XMPMetadata (org.apache.jempbox.xmp.XMPMetadata)1 BasePanel (org.jabref.gui.BasePanel)1 JabRefDesktop (org.jabref.gui.desktop.JabRefDesktop)1 LatexFieldFormatterPreferences (org.jabref.logic.bibtex.LatexFieldFormatterPreferences)1 ImportFormatPreferences (org.jabref.logic.importer.ImportFormatPreferences)1 ParserResult (org.jabref.logic.importer.ParserResult)1 BibtexParser (org.jabref.logic.importer.fileformat.BibtexParser)1