From 5a66cfc3ef3c010514317c8313ac061842c65161 Mon Sep 17 00:00:00 2001 From: Abraham Polk Date: Tue, 5 Mar 2019 08:01:28 -0500 Subject: [PATCH 1/4] Use actionHandler to update fields --- .../org/jabref/gui/groups/GroupDialog.java | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index 3d334919446..d0e9596cf43 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -319,21 +319,16 @@ groupName, getContext(), return null; }); - ChangeListener caretListener = (ObservableValue ov, String oldValue, - String newValue) -> updateComponents(); - ChangeListener itemListener = (ObservableValue ov, Boolean oldBoolean, - Boolean newBoolean) -> updateComponents(); - - nameField.textProperty().addListener(caretListener); - descriptionField.textProperty().addListener(caretListener); - iconField.textProperty().addListener(caretListener); - keywordGroupSearchField.textProperty().addListener(caretListener); - keywordGroupSearchTerm.textProperty().addListener(caretListener); - keywordGroupCaseSensitive.selectedProperty().addListener(itemListener); - keywordGroupRegExp.selectedProperty().addListener(itemListener); - searchGroupSearchExpression.textProperty().addListener(caretListener); - searchGroupRegExp.selectedProperty().addListener(itemListener); - searchGroupRegExp.selectedProperty().addListener(itemListener); + nameField.setOnAction(actionHandler); + descriptionField.setOnAction(actionHandler); + iconField.setOnAction(actionHandler); + keywordGroupSearchField.setOnAction(actionHandler); + keywordGroupSearchTerm.setOnAction(actionHandler); + keywordGroupCaseSensitive.setOnAction(actionHandler); + keywordGroupRegExp.setOnAction(actionHandler); + searchGroupSearchExpression.setOnAction(actionHandler); + searchGroupRegExp.setOnAction(actionHandler); + searchGroupRegExp.setOnAction(actionHandler); // configure for current type if (editedGroup == null) { From 83cf7efdc740b132690617557ad887758da106f9 Mon Sep 17 00:00:00 2001 From: Abraham Polk Date: Tue, 5 Mar 2019 13:00:30 -0500 Subject: [PATCH 2/4] Add actionHandler --- src/main/java/org/jabref/gui/groups/GroupDialog.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index a17c39f417b..1a4373cb5a8 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -329,6 +329,7 @@ groupName, getContext(), return null; }); + EventHandler actionHandler = (ActionEvent e) -> updateComponents(); nameField.setOnAction(actionHandler); descriptionField.setOnAction(actionHandler); iconField.setOnAction(actionHandler); From 4ce237506f728d01cf3516b6ad1a9852ad4fdcf2 Mon Sep 17 00:00:00 2001 From: Abraham Polk Date: Wed, 6 Mar 2019 07:31:31 -0500 Subject: [PATCH 3/4] Add imports --- src/main/java/org/jabref/gui/groups/GroupDialog.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index 1a4373cb5a8..82e43d42525 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.java @@ -9,6 +9,8 @@ import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; +import javafx.event.ActionEvent; +import javafx.event.EventHandler; import javafx.geometry.Insets; import javafx.geometry.Orientation; import javafx.scene.Node; From e2d7b0ad22671067f257ae3960f6caf53b283340 Mon Sep 17 00:00:00 2001 From: Abraham Polk Date: Fri, 8 Mar 2019 12:43:17 -0500 Subject: [PATCH 4/4] Final fixes --- src/main/java/org/jabref/gui/groups/GroupDialog.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.java b/src/main/java/org/jabref/gui/groups/GroupDialog.java index 82e43d42525..16b8601a8dd 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; @@ -341,7 +340,6 @@ groupName, getContext(), keywordGroupRegExp.setOnAction(actionHandler); searchGroupSearchExpression.setOnAction(actionHandler); searchGroupRegExp.setOnAction(actionHandler); - searchGroupRegExp.setOnAction(actionHandler); // configure for current type if (editedGroup == null) {