use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.
the class SendAlertMessageWindow method addContent.
private void addContent() {
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Alert private key:", 10).second;
Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Alert message:", "Enter message");
TextArea alertMessageTextArea = labelTextAreaTuple2.second;
Label first = labelTextAreaTuple2.first;
first.setMinWidth(150);
CheckBox isUpdateCheckBox = addLabelCheckBox(gridPane, ++rowIndex, "Is update notification:", "").second;
isUpdateCheckBox.setSelected(true);
InputTextField versionInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "New version no.:").second;
versionInputTextField.disableProperty().bind(isUpdateCheckBox.selectedProperty().not());
sendButton = new Button("Send notification");
sendButton.setOnAction(e -> {
if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
if (sendAlertMessageHandler.handle(new Alert(alertMessageTextArea.getText(), isUpdateCheckBox.isSelected(), versionInputTextField.getText()), keyInputTextField.getText()))
hide();
else
new Popup().warning("The key you entered was not correct.").width(300).onClose(() -> blurAgain()).show();
}
});
Button removeAlertMessageButton = new Button("Remove notification");
removeAlertMessageButton.setOnAction(e -> {
if (keyInputTextField.getText().length() > 0) {
if (removeAlertMessageHandler.handle(keyInputTextField.getText()))
hide();
else
new Popup().warning("The key you entered was not correct.").width(300).onClose(() -> blurAgain()).show();
}
});
closeButton = new Button("Close");
closeButton.setOnAction(e -> {
hide();
closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
});
HBox hBox = new HBox();
hBox.setSpacing(10);
GridPane.setRowIndex(hBox, ++rowIndex);
GridPane.setColumnIndex(hBox, 1);
hBox.getChildren().addAll(sendButton, removeAlertMessageButton, closeButton);
gridPane.getChildren().add(hBox);
GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
Aggregations