Skip to content

Commit

Permalink
fix: make fields sorted by lexicographical order (#7711)
Browse files Browse the repository at this point in the history
* fix: Random order of fields

* fix: Random order of fields

* fix: Random order of fields

* fix: Random order of fields

* fix: Random order of fields

* fix: change CHANGELOG.md

* modify code in ViewModel.

* Add a blank line for passing checkstyle.

* Make code logic simpler.

* fix the order for import.

* fix: use sortedList
  • Loading branch information
dateri authored May 8, 2021
1 parent f773843 commit 4f398d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package org.jabref.gui.commonfxcontrols;

import java.util.Comparator;

import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ListProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleBooleanProperty;
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;
Expand All @@ -22,7 +25,7 @@ public class FieldFormatterCleanupsPanelViewModel {
private final BooleanProperty cleanupsDisableProperty = new SimpleBooleanProperty();
private final ListProperty<FieldFormatterCleanup> cleanupsListProperty = new SimpleListProperty<>(FXCollections.observableArrayList());
private final ObjectProperty<SelectionModel<FieldFormatterCleanup>> selectedCleanupProperty = new SimpleObjectProperty<>(new NoSelectionModel<>());
private final ListProperty<Field> availableFieldsProperty = new SimpleListProperty<>(FXCollections.observableArrayList(FieldFactory.getCommonFields()));
private final ListProperty<Field> availableFieldsProperty = new SimpleListProperty<>(new SortedList<>(FXCollections.observableArrayList(FieldFactory.getCommonFields()), Comparator.comparing(Field::getDisplayName)));
private final ObjectProperty<Field> selectedFieldProperty = new SimpleObjectProperty<>();
private final ListProperty<Formatter> availableFormattersProperty = new SimpleListProperty<>(FXCollections.observableArrayList(Cleanups.getBuiltInFormatters()));
private final ObjectProperty<Formatter> selectedFormatterProperty = new SimpleObjectProperty<>();
Expand Down

0 comments on commit 4f398d8

Please sign in to comment.