Search in sources :

Example 6 with ClearFormatter

use of org.jabref.logic.formatter.bibtexfields.ClearFormatter in project jabref by JabRef.

the class CleanupActionsListModelTest method resetSetsFormattersToPassedList.

@Test
public void resetSetsFormattersToPassedList() throws Exception {
    CleanupActionsListModel model = new CleanupActionsListModel(Collections.emptyList());
    FieldFormatterCleanups defaultFormatters = mock(FieldFormatterCleanups.class);
    List<FieldFormatterCleanup> formatters = Arrays.asList(new FieldFormatterCleanup("test", new ClearFormatter()));
    when(defaultFormatters.getConfiguredActions()).thenReturn(formatters);
    model.reset(defaultFormatters);
    assertEquals(formatters, model.getAllActions());
}
Also used : CleanupActionsListModel(org.jabref.gui.cleanup.CleanupActionsListModel) FieldFormatterCleanups(org.jabref.model.cleanup.FieldFormatterCleanups) FieldFormatterCleanup(org.jabref.model.cleanup.FieldFormatterCleanup) ClearFormatter(org.jabref.logic.formatter.bibtexfields.ClearFormatter) Test(org.junit.Test)

Example 7 with ClearFormatter

use of org.jabref.logic.formatter.bibtexfields.ClearFormatter in project jabref by JabRef.

the class DoiCleanup method removeFieldValue.

private void removeFieldValue(BibEntry entry, String field, List<FieldChange> changes) {
    CleanupJob eraser = new FieldFormatterCleanup(field, new ClearFormatter());
    changes.addAll(eraser.cleanup(entry));
}
Also used : FieldFormatterCleanup(org.jabref.model.cleanup.FieldFormatterCleanup) ClearFormatter(org.jabref.logic.formatter.bibtexfields.ClearFormatter) CleanupJob(org.jabref.model.cleanup.CleanupJob)

Aggregations

ClearFormatter (org.jabref.logic.formatter.bibtexfields.ClearFormatter)7 FieldFormatterCleanup (org.jabref.model.cleanup.FieldFormatterCleanup)7 MoveFieldCleanup (org.jabref.logic.cleanup.MoveFieldCleanup)2 CleanupActionsListModel (org.jabref.gui.cleanup.CleanupActionsListModel)1 DoiCleanup (org.jabref.logic.cleanup.DoiCleanup)1 NormalizeMonthFormatter (org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter)1 NormalizeNamesFormatter (org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter)1 NormalizePagesFormatter (org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter)1 RemoveBracesFormatter (org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter)1 CleanupJob (org.jabref.model.cleanup.CleanupJob)1 FieldFormatterCleanups (org.jabref.model.cleanup.FieldFormatterCleanups)1 Test (org.junit.Test)1