Search in sources :

Example 1 with AuxParserResult

use of org.jabref.logic.auxparser.AuxParserResult in project jabref by JabRef.

the class AuxCommandLine method perform.

public BibDatabase perform() {
    BibDatabase subDatabase = null;
    if (!auxFile.isEmpty() && (database != null)) {
        AuxParser auxParser = new AuxParser(auxFile, database);
        AuxParserResult result = auxParser.parse();
        subDatabase = result.getGeneratedBibDatabase();
        // print statistics
        System.out.println(result.getInformation(true));
    }
    return subDatabase;
}
Also used : AuxParser(org.jabref.logic.auxparser.AuxParser) AuxParserResult(org.jabref.logic.auxparser.AuxParserResult) BibDatabase(org.jabref.model.database.BibDatabase)

Example 2 with AuxParserResult

use of org.jabref.logic.auxparser.AuxParserResult in project jabref by JabRef.

the class FromAuxDialog method parseActionPerformed.

private void parseActionPerformed() {
    parseButton.setEnabled(false);
    BasePanel bp = (BasePanel) parentTabbedPane.getComponentAt(dbChooser.getSelectedIndex());
    notFoundList.removeAll();
    statusInfos.setText(null);
    BibDatabase refBase = bp.getDatabase();
    String auxName = auxFileField.getText();
    if ((auxName != null) && (refBase != null) && !auxName.isEmpty()) {
        auxParser = new AuxParser(auxName, refBase);
        AuxParserResult result = auxParser.parse();
        notFoundList.setListData(result.getUnresolvedKeys().toArray(new String[result.getUnresolvedKeys().size()]));
        statusInfos.append(result.getInformation(false));
        generateButton.setEnabled(true);
        // the generated database contains no entries -> no active generate-button
        if (!result.getGeneratedBibDatabase().hasEntries()) {
            statusInfos.append("\n" + Localization.lang("empty library"));
            generateButton.setEnabled(false);
        }
    } else {
        generateButton.setEnabled(false);
    }
    parseButton.setEnabled(true);
}
Also used : BasePanel(org.jabref.gui.BasePanel) AuxParser(org.jabref.logic.auxparser.AuxParser) AuxParserResult(org.jabref.logic.auxparser.AuxParserResult) BibDatabase(org.jabref.model.database.BibDatabase)

Aggregations

AuxParser (org.jabref.logic.auxparser.AuxParser)2 AuxParserResult (org.jabref.logic.auxparser.AuxParserResult)2 BibDatabase (org.jabref.model.database.BibDatabase)2 BasePanel (org.jabref.gui.BasePanel)1