From 1dfc4e556d8d06e9da57d425f3c86980cb74354d Mon Sep 17 00:00:00 2001 From: Escoul Date: Tue, 13 Feb 2018 12:37:03 +0100 Subject: [PATCH] Changes regarding issue koppor#277: Fix the name of the group editing window to "Add group" instead of "Edit Group" when adding a new group. The group editing window can now also be called by double-clicking the group to be edited. --- CHANGELOG.md | 2 ++ src/main/java/org/jabref/gui/groups/GroupDialog.java | 3 ++- .../org/jabref/gui/groups/GroupTreeController.java | 12 ++++++++++++ src/main/resources/l10n/JabRef_en.properties | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index edb325d075c..cc90711b19e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ For more details refer to the [field mapping help page](http://help.jabref.org/e - We improved file saving so that hard links are now preserved when a save is performed [#2633](https://github.com/JabRef/jabref/issues/2633) - We changed the default dialog option when removing a [file link](http://help.jabref.org/en/FileLinks#adding-external-links-to-an-entry) from an entry. The new default removes the linked file from the entry instead of deleting the file from disk. [#3679](https://github.com/JabRef/jabref/issues/3679) +- The group editing window can now also be called by double-clicking the group to be edited. [koppor#277](https://github.com/koppor/jabref/issues/277) ### Fixed - We fixed an issue where pressing space caused the cursor to jump to the start of the text field. [#3471](https://github.com/JabRef/jabref/issues/3471) @@ -37,6 +38,7 @@ The new default removes the linked file from the entry instead of deleting the f - Chaining modifiers in BibTeX key pattern now works as described in the documentation. [#3648](https://github.com/JabRef/jabref/issues/3648) - We fixed an issue where not all bibtex/biblatex fields would be exported as latex-free to MS-Office XML [koppor#284](https://github.com/koppor/jabref/issues/284) - We fixed an issue where linked files would be deleted from bibliography entries despite choosing the "Cancel" option in the dialog menu. +- We fixed the name of the group editing window to "Add group" instead of "Edit Group" when adding a new group. [koppor#277](https://github.com/koppor/jabref/issues/277) ### Removed - We removed the [Look and Feels from JGoodies](http://www.jgoodies.com/freeware/libraries/looks/), because the open source version is not compatible with Java 9. diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index 7ac7dc0ceb8..e90be1b60fe 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -148,7 +148,8 @@ public Dimension getPreferredSize() { * created. */ public GroupDialog(JabRefFrame jabrefFrame, AbstractGroup editedGroup) { - super(jabrefFrame, Localization.lang("Edit group"), true, GroupDialog.class); + super(jabrefFrame, (editedGroup == null) ? Localization.lang("Add group") : Localization.lang("Edit group"), + true, GroupDialog.class); // set default values (overwritten if editedGroup != null) keywordGroupSearchField.setText(jabrefFrame.prefs().get(JabRefPreferences.GROUPS_DEFAULT_FIELD)); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeController.java b/src/main/java/org/jabref/gui/groups/GroupTreeController.java index 2948006d868..b440b163eb5 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeController.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeController.java @@ -28,6 +28,7 @@ import javafx.scene.input.ClipboardContent; import javafx.scene.input.DragEvent; import javafx.scene.input.Dragboard; +import javafx.scene.input.MouseButton; import javafx.scene.input.TransferMode; import javafx.scene.layout.StackPane; import javafx.scene.text.Text; @@ -173,6 +174,17 @@ public void initialize() { row.setDisclosureNode(null); row.disclosureNodeProperty().addListener((observable, oldValue, newValue) -> row.setDisclosureNode(null)); + // Opens the group's edit window when the group gets double clicked + row.setOnMouseClicked((mouseClickedEvent) -> { + if (mouseClickedEvent.getButton().equals(MouseButton.PRIMARY) + && (mouseClickedEvent.getClickCount() == 2)) { + GroupNodeViewModel groupToEdit = EasyBind.monadic(row.itemProperty()).getValue(); + if (groupToEdit != null) { + viewModel.editGroup(groupToEdit); + } + } + }); + // Add context menu (only for non-null items) row.contextMenuProperty().bind( EasyBind.monadic(row.itemProperty()) diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 7fd958d6894..0ac3e123a66 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -386,6 +386,7 @@ Edit\ entry=Edit entry Save\ file=Save file Edit\ file\ type=Edit file type +Add\ group=Add group Edit\ group=Edit group