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;
}
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);
}
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();
}
}
Aggregations