Skip to content

Commit

Permalink
Properly disable in EditNode the property JSON Path when format BASE6…
Browse files Browse the repository at this point in the history
…4 or HEX
  • Loading branch information
adrianromero committed Jul 21, 2019
1 parent 0b368a6 commit 8daebbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public class TopicInfoEditNode implements TopicInfoNode {
@FXML
public ChoiceBox<Boolean> editretained;
@FXML
public Label labeljsonpath;
@FXML
public TextField editjsonpath;
@FXML
public CheckBox editmultiline;
Expand Down Expand Up @@ -133,6 +135,8 @@ public EditNodeFormat fromString(String value) {
});
editformat.valueProperty().addListener((ObservableValue<? extends EditNodeFormat> 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<? extends String> ov, String old_val, String new_val) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<TextField fx:id="edittopic" styleClass="unitinput" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2" />
<Label fx:id="labeltopicpub" styleClass="unitlabel" text="%label.topicpub" GridPane.rowIndex="3" />
<TextField fx:id="edittopicpub" styleClass="unitinput" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="3" />
<Label styleClass="unitlabel" text="%label.jsonpath" GridPane.rowIndex="4" />
<Label fx:id="labeljsonpath" styleClass="unitlabel" text="%label.jsonpath" GridPane.rowIndex="4" />
<TextField fx:id="editjsonpath" styleClass="unitinput" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Label styleClass="unitlabel" text="%label.format" GridPane.rowIndex="5" />
<ChoiceBox fx:id="editformat" maxWidth="1.7976931348623157E308" styleClass="unitinput" GridPane.columnIndex="1" GridPane.rowIndex="5" />
Expand Down

0 comments on commit 8daebbe

Please sign in to comment.