diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b539484205..61cf25bc5be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where the custom file column were sorted incorrectly. https://github.com/JabRef/jabref/issues/3119 - We fixed an issues where the entry losses focus when a field is edited and at the same time used for sorting. https://github.com/JabRef/jabref/issues/3373 - We fixed an issue where the menu on Mac OS was not displayed in the usual Mac-specific way. https://github.com/JabRef/jabref/issues/3146 +- We fixed an issue where the order of fields in customized entry types was not saved correctly. [#4033](http://github.com/JabRef/jabref/issues/4033) - We fixed an issue where the groups tree of the last database was still shown even after the database was already closed. - We fixed an issue where the "Open file dialog" may disappear behind other windows. https://github.com/JabRef/jabref/issues/3410 - We fixed an issue where the default icon of a group was not colored correctly. diff --git a/src/main/java/org/jabref/gui/actions/CustomizeEntryAction.java b/src/main/java/org/jabref/gui/actions/CustomizeEntryAction.java index aaee283cde1..b8ea7ee567b 100644 --- a/src/main/java/org/jabref/gui/actions/CustomizeEntryAction.java +++ b/src/main/java/org/jabref/gui/actions/CustomizeEntryAction.java @@ -3,7 +3,7 @@ import javax.swing.JDialog; import org.jabref.gui.JabRefFrame; -import org.jabref.gui.customentrytypes.EntryCustomizationDialog; +import org.jabref.gui.customentrytypes.EntryTypeCustomizationDialog; public class CustomizeEntryAction extends SimpleCommand { @@ -12,10 +12,10 @@ public class CustomizeEntryAction extends SimpleCommand { public CustomizeEntryAction(JabRefFrame frame) { this.frame = frame; } - + @Override public void execute() { - JDialog dialog = new EntryCustomizationDialog(frame); + JDialog dialog = new EntryTypeCustomizationDialog(frame); dialog.setVisible(true); } } diff --git a/src/main/java/org/jabref/gui/customentrytypes/EntryCustomizationDialog.java b/src/main/java/org/jabref/gui/customentrytypes/EntryTypeCustomizationDialog.java similarity index 95% rename from src/main/java/org/jabref/gui/customentrytypes/EntryCustomizationDialog.java rename to src/main/java/org/jabref/gui/customentrytypes/EntryTypeCustomizationDialog.java index 9c7e8375f60..a9dc764366c 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/EntryCustomizationDialog.java +++ b/src/main/java/org/jabref/gui/customentrytypes/EntryTypeCustomizationDialog.java @@ -8,6 +8,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; @@ -49,7 +50,7 @@ import com.jgoodies.forms.builder.ButtonBarBuilder; -public class EntryCustomizationDialog extends JabRefDialog implements ListSelectionListener { +public class EntryTypeCustomizationDialog extends JabRefDialog implements ListSelectionListener { protected GridBagLayout gbl = new GridBagLayout(); protected GridBagConstraints con = new GridBagConstraints(); @@ -71,10 +72,10 @@ public class EntryCustomizationDialog extends JabRefDialog implements ListSelect private BibDatabaseMode bibDatabaseMode; /** - * Creates a new instance of EntryCustomizationDialog + * Creates a new instance of EntryTypeCustomizationDialog */ - public EntryCustomizationDialog(JabRefFrame frame) { - super((JFrame) null, Localization.lang("Customize entry types"), false, EntryCustomizationDialog.class); + public EntryTypeCustomizationDialog(JabRefFrame frame) { + super((JFrame) null, Localization.lang("Customize entry types"), false, EntryTypeCustomizationDialog.class); this.frame = frame; initGui(); @@ -276,11 +277,13 @@ private void applyChanges() { if (biblatexMode) { Set oldPrimaryOptionalFieldsLists = oldType.get().getPrimaryOptionalFields(); Set oldSecondaryOptionalFieldsList = oldType.get().getSecondaryOptionalFields(); - if (oldRequiredFieldsList.equals(requiredFieldsList) && oldPrimaryOptionalFieldsLists.equals(optionalFieldsList) && - oldSecondaryOptionalFieldsList.equals(secondaryOptionalFieldsLists)) { + if (Arrays.equals(oldRequiredFieldsList.toArray(), requiredFieldsList.toArray()) + && Arrays.equals(oldPrimaryOptionalFieldsLists.toArray(), optionalFieldsList.toArray()) + && Arrays.equals(oldSecondaryOptionalFieldsList.toArray(), secondaryOptionalFieldsLists.toArray())) { changesMade = false; } - } else if (oldRequiredFieldsList.equals(requiredFieldsList) && oldOptionalFieldsList.equals(optionalFieldsList)) { + } else if (Arrays.equals(oldRequiredFieldsList.toArray(), requiredFieldsList.toArray()) + && Arrays.equals(oldOptionalFieldsList.toArray(), optionalFieldsList.toArray())) { changesMade = false; } } diff --git a/src/main/java/org/jabref/gui/customentrytypes/EntryTypeList.java b/src/main/java/org/jabref/gui/customentrytypes/EntryTypeList.java index 2b6e9c7dc7d..af58aef738b 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/EntryTypeList.java +++ b/src/main/java/org/jabref/gui/customentrytypes/EntryTypeList.java @@ -22,7 +22,7 @@ /** * This class extends FieldSetComponent to provide some required functionality for the - * list of entry types in EntryCustomizationDialog. + * list of entry types in EntryTypeCustomizationDialog. */ public class EntryTypeList extends FieldSetComponent implements ListSelectionListener {