From a3d67cca0db54c3bed4b20fd10647f9f34e10948 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 6 Mar 2020 09:02:00 +0100 Subject: [PATCH] Fix exception when adding save action without selected formatter (#6072) --- CHANGELOG.md | 1 + .../org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de81616bc5e..a0844d2801b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the group and the link column were not updated after changing the entry in the main table. [#5985](https://github.com/JabRef/jabref/issues/5985) - We fixed an issue where reordering the groups was not possible after inserting an article. [#6008](https://github.com/JabRef/jabref/issues/6008) - We fixed an issue where citation styles except the default "Preview" could not be used. [#56220](https://github.com/JabRef/jabref/issues/5622) +- We fixed an issue where an exception was thrown when adding a save action without a selected formatter in the library properties [#6069](https://github.com/JabRef/jabref/issues/6069) ### Removed diff --git a/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java b/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java index f75e08b9761..70cc748e2b7 100644 --- a/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java +++ b/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java @@ -106,6 +106,7 @@ private void buildLayout() { actionsList = new ListView<>(actions); actionsList.setMinHeight(100.0); actionsList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); + new ViewModelListCellFactory() .withText(action -> action.getField().getDisplayName() + ": " + action.getFormatter().getName()) .withStringTooltip(action -> action.getFormatter().getDescription()) @@ -179,6 +180,7 @@ private GridPane getSelectorPanel() { .withStringTooltip(Formatter::getDescription) .install(formattersCombobox); EasyBind.subscribe(formattersCombobox.valueProperty(), e -> updateDescription()); + formattersCombobox.getSelectionModel().selectFirst(); builder.add(formattersCombobox, 3, 1); addButton = new Button(Localization.lang("Add"));