diff --git a/CHANGELOG.md b/CHANGELOG.md index 15ff79e8072..8606dfa7ed8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -550,6 +550,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where the XMP Importer would incorrectly return an empty default entry when importing pdfs [#6577](https://github.com/JabRef/jabref/issues/6577) - We fixed an issue where opening the menu 'Library properties' marked the library as modified [#6451](https://github.com/JabRef/jabref/issues/6451) - We fixed an issue when importing resulted in an exception [#7343](https://github.com/JabRef/jabref/issues/7343) +- We fixed an issue where the field in the Field formatter dropdown selection were sorted in random order. [#7710](https://github.com/JabRef/jabref/issues/7710) ### Removed diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java index b5169b5b69d..64da5ba887d 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/FieldFormatterCleanupsPanelViewModel.java @@ -1,5 +1,7 @@ package org.jabref.gui.commonfxcontrols; +import java.util.Comparator; + import javafx.beans.property.BooleanProperty; import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; @@ -7,6 +9,7 @@ import javafx.beans.property.SimpleListProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; +import javafx.collections.transformation.SortedList; import javafx.scene.control.SelectionModel; import org.jabref.gui.Globals; @@ -22,7 +25,7 @@ public class FieldFormatterCleanupsPanelViewModel { private final BooleanProperty cleanupsDisableProperty = new SimpleBooleanProperty(); private final ListProperty cleanupsListProperty = new SimpleListProperty<>(FXCollections.observableArrayList()); private final ObjectProperty> selectedCleanupProperty = new SimpleObjectProperty<>(new NoSelectionModel<>()); - private final ListProperty availableFieldsProperty = new SimpleListProperty<>(FXCollections.observableArrayList(FieldFactory.getCommonFields())); + private final ListProperty availableFieldsProperty = new SimpleListProperty<>(new SortedList<>(FXCollections.observableArrayList(FieldFactory.getCommonFields()), Comparator.comparing(Field::getDisplayName))); private final ObjectProperty selectedFieldProperty = new SimpleObjectProperty<>(); private final ListProperty availableFormattersProperty = new SimpleListProperty<>(FXCollections.observableArrayList(Cleanups.getBuiltInFormatters())); private final ObjectProperty selectedFormatterProperty = new SimpleObjectProperty<>();