Search in sources :

Example 1 with CleanupWorker

use of org.jabref.logic.cleanup.CleanupWorker in project jabref by JabRef.

the class CleanupAction method doCleanup.

/**
     * Runs the cleanup on the entry and records the change.
     */
private void doCleanup(CleanupPreset preset, BibEntry entry, NamedCompound ce) {
    // Create and run cleaner
    CleanupWorker cleaner = new CleanupWorker(panel.getBibDatabaseContext(), preferences.getCleanupPreferences(Globals.journalAbbreviationLoader));
    List<FieldChange> changes = cleaner.cleanup(preset, entry);
    unsuccessfulRenames = cleaner.getUnsuccessfulRenames();
    if (changes.isEmpty()) {
        return;
    }
    // Register undo action
    for (FieldChange change : changes) {
        ce.addEdit(new UndoableFieldChange(change));
    }
}
Also used : FieldChange(org.jabref.model.FieldChange) UndoableFieldChange(org.jabref.gui.undo.UndoableFieldChange) UndoableFieldChange(org.jabref.gui.undo.UndoableFieldChange) CleanupWorker(org.jabref.logic.cleanup.CleanupWorker)

Aggregations

UndoableFieldChange (org.jabref.gui.undo.UndoableFieldChange)1 CleanupWorker (org.jabref.logic.cleanup.CleanupWorker)1 FieldChange (org.jabref.model.FieldChange)1