From db5b44a9d6f4ae30d5b659a80a0a4f8632566841 Mon Sep 17 00:00:00 2001 From: harinda05 Date: Fri, 22 Mar 2019 11:49:40 +0530 Subject: [PATCH 1/5] Fix for the issue - #4783 Group creation not possible anymore with default settings --- CHANGELOG.md | 2 ++ .../java/org/jabref/gui/groups/GroupDialog.java | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eecbaff3814..182fd72ba36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422) - We fixed an issue where "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414) - We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489) +- We fixed an issue where the enabling/disabling OK button in Create/Edit group was not properly validated with the text boxes present in the window - Group creation not possible anymore with default settings [#4783] +(https://github.com/JabRef/jabref/issues/4783) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index 16b8601a8dd..0277111346d 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -119,6 +119,19 @@ class GroupDialog extends BaseDialog { * created. */ public GroupDialog(JabRefFrame jabrefFrame, AbstractGroup editedGroup) { + + nameField.textProperty().addListener((observable, oldValue, newValue) -> { + updateComponents(); + }); + + keywordGroupSearchTerm.textProperty().addListener((observable, oldValue, newValue) -> { + updateComponents(); + }); + + searchGroupSearchExpression.textProperty().addListener((observable, oldValue, newValue) -> { + updateComponents(); + }); + this.setTitle(Localization.lang("Edit group")); explicitRadioButton.setSelected(true); From 87cdd341424459eb6ee6247b5c086ef530ce75ea Mon Sep 17 00:00:00 2001 From: harinda05 Date: Fri, 22 Mar 2019 16:25:41 +0530 Subject: [PATCH 2/5] Changed the position of the listeners and onaction replaced with changelistener --- .../org/jabref/gui/groups/GroupDialog.java | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index 1c2264dd51a..4792db59fda 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -7,6 +7,7 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; +import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; import javafx.event.EventHandler; @@ -136,19 +137,6 @@ public GroupDialog(DialogService dialogService, BasePanel basePanel, JabRefPrefe this.setTitle(Localization.lang("Edit group")); } - nameField.textProperty().addListener((observable, oldValue, newValue) -> { - updateComponents(); - }); - - keywordGroupSearchTerm.textProperty().addListener((observable, oldValue, newValue) -> { - updateComponents(); - }); - - searchGroupSearchExpression.textProperty().addListener((observable, oldValue, newValue) -> { - updateComponents(); - }); - - explicitRadioButton.setSelected(true); descriptionTextFlow.setMinWidth(585); @@ -359,6 +347,32 @@ groupName, getContext(), return null; }); + nameField.textProperty().addListener(new ChangeListener() { + + @Override + public void changed(ObservableValue observable, + String oldValue, String newValue) { + updateComponents(); + } + }); + + keywordGroupSearchTerm.textProperty().addListener(new ChangeListener() { + + @Override + public void changed(ObservableValue observable, + String oldValue, String newValue) { + updateComponents(); + } + }); + + searchGroupSearchExpression.textProperty().addListener(new ChangeListener() { + @Override + public void changed(ObservableValue observable, + String oldValue, String newValue) { + updateComponents(); + } + }); + EventHandler actionHandler = (ActionEvent e) -> updateComponents(); nameField.setOnAction(actionHandler); descriptionField.setOnAction(actionHandler); From f50059ac8aa94d61eaad7207b240b45f5cbd7293 Mon Sep 17 00:00:00 2001 From: harinda05 Date: Fri, 22 Mar 2019 16:30:59 +0530 Subject: [PATCH 3/5] Removed changelog entry --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ff96a07b51e..9e14888432a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,8 +99,6 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where only one PDF file could be imported [#4422](https://github.com/JabRef/jabref/issues/4422) - We fixed an issue where "Move to group" would always move the first entry in the library and not the selected [#4414](https://github.com/JabRef/jabref/issues/4414) - We fixed an issue where an older dialog appears when downloading full texts from the quality menu. [#4489](https://github.com/JabRef/jabref/issues/4489) -- We fixed an issue where the enabling/disabling OK button in Create/Edit group was not properly validated with the text boxes present in the window - Group creation not possible anymore with default settings [#4783] -(https://github.com/JabRef/jabref/issues/4783) From 01f69c898cd45269c237eec294c1fe2210a119fe Mon Sep 17 00:00:00 2001 From: harinda05 Date: Tue, 26 Mar 2019 20:01:17 +0530 Subject: [PATCH 4/5] Fix for issue 4783 - Simplified listeners in to lambdas --- .../org/jabref/gui/groups/GroupDialog.java | 29 ++----------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index 4792db59fda..d825a029c44 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -7,7 +7,6 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; import javafx.event.EventHandler; @@ -347,31 +346,9 @@ groupName, getContext(), return null; }); - nameField.textProperty().addListener(new ChangeListener() { - - @Override - public void changed(ObservableValue observable, - String oldValue, String newValue) { - updateComponents(); - } - }); - - keywordGroupSearchTerm.textProperty().addListener(new ChangeListener() { - - @Override - public void changed(ObservableValue observable, - String oldValue, String newValue) { - updateComponents(); - } - }); - - searchGroupSearchExpression.textProperty().addListener(new ChangeListener() { - @Override - public void changed(ObservableValue observable, - String oldValue, String newValue) { - updateComponents(); - } - }); + nameField.textProperty().addListener((observable, oldValue, newValue) -> updateComponents()); + keywordGroupSearchTerm.textProperty().addListener((observable, oldValue, newValue) -> updateComponents()); + searchGroupSearchExpression.textProperty().addListener((observable, oldValue, newValue) -> updateComponents()); EventHandler actionHandler = (ActionEvent e) -> updateComponents(); nameField.setOnAction(actionHandler); From 0457ccb0ba5cce75e38e339c3133ae0861b36542 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 26 Mar 2019 22:07:58 +0100 Subject: [PATCH 5/5] Update GroupDialog.java --- src/main/java/org/jabref/gui/groups/GroupDialog.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index d825a029c44..61adf4abfa7 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -127,7 +127,6 @@ class GroupDialog extends BaseDialog { * @param editedGroup The group being edited, or null if a new group is to be * created. */ - public GroupDialog(DialogService dialogService, BasePanel basePanel, JabRefPreferences prefs, AbstractGroup editedGroup) { if (editedGroup == null) {