Search in sources :

Example 1 with Formatter

use of org.jabref.model.cleanup.Formatter in project jabref by JabRef.

the class FieldFormatterCleanupsPanel method getFieldFormatter.

private Formatter getFieldFormatter() {
    Formatter selectedFormatter = null;
    String selectedFormatterName = formattersCombobox.getSelectedItem().toString();
    for (Formatter formatter : Cleanups.getAvailableFormatters()) {
        if (formatter.getName().equals(selectedFormatterName)) {
            selectedFormatter = formatter;
            break;
        }
    }
    return selectedFormatter;
}
Also used : Formatter(org.jabref.model.cleanup.Formatter)

Example 2 with Formatter

use of org.jabref.model.cleanup.Formatter in project jabref by JabRef.

the class FieldFormatterCleanupsPanel method getFieldFormatterCleanup.

private FieldFormatterCleanup getFieldFormatterCleanup() {
    Formatter selectedFormatter = getFieldFormatter();
    String fieldKey = selectFieldCombobox.getSelectedItem().toString();
    return new FieldFormatterCleanup(fieldKey, selectedFormatter);
}
Also used : Formatter(org.jabref.model.cleanup.Formatter) FieldFormatterCleanup(org.jabref.model.cleanup.FieldFormatterCleanup)

Example 3 with Formatter

use of org.jabref.model.cleanup.Formatter in project jabref by JabRef.

the class Formatters method getFormatterForModifier.

public static Optional<Formatter> getFormatterForModifier(String modifier) {
    Objects.requireNonNull(modifier);
    Optional<Formatter> formatter = ALL.stream().filter(f -> f.getKey().equals(modifier)).findAny();
    if (formatter.isPresent()) {
        return formatter;
    }
    switch(modifier) {
        case "lower":
            return Optional.of(new LowerCaseFormatter());
        case "upper":
            return Optional.of(new UpperCaseFormatter());
        default:
            return Optional.empty();
    }
}
Also used : Arrays(java.util.Arrays) HtmlToUnicodeFormatter(org.jabref.logic.formatter.bibtexfields.HtmlToUnicodeFormatter) NormalizeDateFormatter(org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter) SentenceCaseFormatter(org.jabref.logic.formatter.casechanger.SentenceCaseFormatter) HtmlToLatexFormatter(org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter) CapitalizeFormatter(org.jabref.logic.formatter.casechanger.CapitalizeFormatter) LowerCaseFormatter(org.jabref.logic.formatter.casechanger.LowerCaseFormatter) ArrayList(java.util.ArrayList) LatexCleanupFormatter(org.jabref.logic.formatter.bibtexfields.LatexCleanupFormatter) UnicodeToLatexFormatter(org.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter) MinifyNameListFormatter(org.jabref.logic.formatter.minifier.MinifyNameListFormatter) LatexToUnicodeFormatter(org.jabref.logic.layout.format.LatexToUnicodeFormatter) Formatter(org.jabref.model.cleanup.Formatter) UpperCaseFormatter(org.jabref.logic.formatter.casechanger.UpperCaseFormatter) NormalizePagesFormatter(org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter) ProtectTermsFormatter(org.jabref.logic.formatter.casechanger.ProtectTermsFormatter) ClearFormatter(org.jabref.logic.formatter.bibtexfields.ClearFormatter) OrdinalsToSuperscriptFormatter(org.jabref.logic.formatter.bibtexfields.OrdinalsToSuperscriptFormatter) TitleCaseFormatter(org.jabref.logic.formatter.casechanger.TitleCaseFormatter) Objects(java.util.Objects) List(java.util.List) NormalizeMonthFormatter(org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter) Optional(java.util.Optional) UnitsToLatexFormatter(org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter) EscapeUnderscoresFormatter(org.jabref.logic.formatter.bibtexfields.EscapeUnderscoresFormatter) RemoveBracesFormatter(org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter) NormalizeNamesFormatter(org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter) HtmlToUnicodeFormatter(org.jabref.logic.formatter.bibtexfields.HtmlToUnicodeFormatter) NormalizeDateFormatter(org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter) SentenceCaseFormatter(org.jabref.logic.formatter.casechanger.SentenceCaseFormatter) HtmlToLatexFormatter(org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter) CapitalizeFormatter(org.jabref.logic.formatter.casechanger.CapitalizeFormatter) LowerCaseFormatter(org.jabref.logic.formatter.casechanger.LowerCaseFormatter) LatexCleanupFormatter(org.jabref.logic.formatter.bibtexfields.LatexCleanupFormatter) UnicodeToLatexFormatter(org.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter) MinifyNameListFormatter(org.jabref.logic.formatter.minifier.MinifyNameListFormatter) LatexToUnicodeFormatter(org.jabref.logic.layout.format.LatexToUnicodeFormatter) Formatter(org.jabref.model.cleanup.Formatter) UpperCaseFormatter(org.jabref.logic.formatter.casechanger.UpperCaseFormatter) NormalizePagesFormatter(org.jabref.logic.formatter.bibtexfields.NormalizePagesFormatter) ProtectTermsFormatter(org.jabref.logic.formatter.casechanger.ProtectTermsFormatter) ClearFormatter(org.jabref.logic.formatter.bibtexfields.ClearFormatter) OrdinalsToSuperscriptFormatter(org.jabref.logic.formatter.bibtexfields.OrdinalsToSuperscriptFormatter) TitleCaseFormatter(org.jabref.logic.formatter.casechanger.TitleCaseFormatter) NormalizeMonthFormatter(org.jabref.logic.formatter.bibtexfields.NormalizeMonthFormatter) UnitsToLatexFormatter(org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter) EscapeUnderscoresFormatter(org.jabref.logic.formatter.bibtexfields.EscapeUnderscoresFormatter) RemoveBracesFormatter(org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter) NormalizeNamesFormatter(org.jabref.logic.formatter.bibtexfields.NormalizeNamesFormatter) UpperCaseFormatter(org.jabref.logic.formatter.casechanger.UpperCaseFormatter) LowerCaseFormatter(org.jabref.logic.formatter.casechanger.LowerCaseFormatter)

Aggregations

Formatter (org.jabref.model.cleanup.Formatter)3 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 List (java.util.List)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 ClearFormatter (org.jabref.logic.formatter.bibtexfields.ClearFormatter)1 EscapeUnderscoresFormatter (org.jabref.logic.formatter.bibtexfields.EscapeUnderscoresFormatter)1 HtmlToLatexFormatter (org.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter)1 HtmlToUnicodeFormatter (org.jabref.logic.formatter.bibtexfields.HtmlToUnicodeFormatter)1 LatexCleanupFormatter (org.jabref.logic.formatter.bibtexfields.LatexCleanupFormatter)1 NormalizeDateFormatter (org.jabref.logic.formatter.bibtexfields.NormalizeDateFormatter)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 OrdinalsToSuperscriptFormatter (org.jabref.logic.formatter.bibtexfields.OrdinalsToSuperscriptFormatter)1 RemoveBracesFormatter (org.jabref.logic.formatter.bibtexfields.RemoveBracesFormatter)1 UnicodeToLatexFormatter (org.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter)1 UnitsToLatexFormatter (org.jabref.logic.formatter.bibtexfields.UnitsToLatexFormatter)1 CapitalizeFormatter (org.jabref.logic.formatter.casechanger.CapitalizeFormatter)1