diff --git a/src/main/java/com/adr/helloiot/topicinfo/TopicInfoEditNode.java b/src/main/java/com/adr/helloiot/topicinfo/TopicInfoEditNode.java index 8329125..0dfdf86 100644 --- a/src/main/java/com/adr/helloiot/topicinfo/TopicInfoEditNode.java +++ b/src/main/java/com/adr/helloiot/topicinfo/TopicInfoEditNode.java @@ -77,6 +77,8 @@ public class TopicInfoEditNode implements TopicInfoNode { @FXML public ChoiceBox editretained; @FXML + public Label labeljsonpath; + @FXML public TextField editjsonpath; @FXML public CheckBox editmultiline; @@ -133,6 +135,8 @@ public EditNodeFormat fromString(String value) { }); editformat.valueProperty().addListener((ObservableValue ov, EditNodeFormat old_val, EditNodeFormat new_val) -> { updateCurrentTopic(); + labeljsonpath.setDisable(EditNodeFormat.BASE64.equals(new_val) || EditNodeFormat.HEX.equals(new_val)); + editjsonpath.setDisable(EditNodeFormat.BASE64.equals(new_val) || EditNodeFormat.HEX.equals(new_val)); }); editjsonpath.textProperty().addListener((ObservableValue ov, String old_val, String new_val) -> { diff --git a/src/main/java/com/adr/helloiot/topicinfo/TopicInfoPublicationSubscription.java b/src/main/java/com/adr/helloiot/topicinfo/TopicInfoPublicationSubscription.java index 243197d..c371ec1 100644 --- a/src/main/java/com/adr/helloiot/topicinfo/TopicInfoPublicationSubscription.java +++ b/src/main/java/com/adr/helloiot/topicinfo/TopicInfoPublicationSubscription.java @@ -105,7 +105,6 @@ public void writeToEditNode() { editnode.edittopicpub.setText(topicpub); editnode.editformat.getSelectionModel().select(format); editnode.editjsonpath.setText(jsonpath); - editnode.editjsonpath.setDisable("BASE64".equals(format) || "HEX".equals(format) || "SWITCH".equals(format)); editnode.editmultiline.setSelected(multiline); editnode.editcolor.setValue(color); editnode.editbackground.setValue(background); @@ -121,10 +120,8 @@ public void readFromEditNode() { format = editnode.editformat.getValue(); if (EditNodeFormat.BASE64 == format || EditNodeFormat.HEX ==format) { jsonpath = null; - editnode.editjsonpath.setDisable(true); } else { jsonpath = editnode.editjsonpath.getText(); - editnode.editjsonpath.setDisable(false); } multiline = editnode.editmultiline.isSelected(); color = editnode.editcolor.getValue(); diff --git a/src/main/resources/com/adr/helloiot/fxml/topicinfoeditnode.fxml b/src/main/resources/com/adr/helloiot/fxml/topicinfoeditnode.fxml index a7e02b6..2fc58ab 100644 --- a/src/main/resources/com/adr/helloiot/fxml/topicinfoeditnode.fxml +++ b/src/main/resources/com/adr/helloiot/fxml/topicinfoeditnode.fxml @@ -42,7 +42,7 @@