use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.
the class SendPrivateNotificationWindow method addContent.
private void addContent() {
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Key for private notification:", 10).second;
Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Private notification:", "Enter notification");
TextArea alertMessageTextArea = labelTextAreaTuple2.second;
Label first = labelTextAreaTuple2.first;
first.setMinWidth(200);
sendButton = new Button("Send private notification");
sendButton.setOnAction(e -> {
if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
if (!sendPrivateNotificationHandler.handle(new PrivateNotification(alertMessageTextArea.getText()), pubKeyRing, nodeAddress, keyInputTextField.getText(), new SendMailboxMessageListener() {
@Override
public void onArrived() {
log.trace("PrivateNotificationMessage arrived at peer.");
new Popup<>().feedback("Message arrived.").onClose(SendPrivateNotificationWindow.this::hide).show();
}
@Override
public void onStoredInMailbox() {
log.trace("PrivateNotificationMessage was stored in mailbox.");
new Popup<>().feedback("Message stored in mailbox.").onClose(SendPrivateNotificationWindow.this::hide).show();
}
@Override
public void onFault(String errorMessage) {
new Popup<>().feedback("Message sending failed. error=" + errorMessage).onClose(SendPrivateNotificationWindow.this::hide).show();
}
}))
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, closeButton);
gridPane.getChildren().add(hBox);
GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.
the class EmptyWalletWindow method addContent.
private void addContent() {
addMultilineLabel(gridPane, ++rowIndex, "Please use that only in emergency case if you cannot access your fund from the UI.\n\n" + "Please note that all open offers will be closed automatically when using this tool.\n\n" + "Before you use this tool, please backup your data directory. " + "You can do this under \"Account/Backup\".\n\n" + "Please file a bug report on Github so that we can investigate what was causing the problem.", 10);
Coin totalBalance = walletService.getAvailableBalance();
balanceTextField = addLabelTextField(gridPane, ++rowIndex, "Your available wallet balance:", formatter.formatCoinWithCode(totalBalance), 10).second;
Tuple2<Label, InputTextField> tuple = addLabelInputTextField(gridPane, ++rowIndex, "Your destination address:");
addressInputTextField = tuple.second;
if (DevFlags.DEV_MODE)
addressInputTextField.setText("mjYhQYSbET2bXJDyCdNqYhqSye5QX2WHPz");
emptyWalletButton = new Button("Empty wallet");
boolean isBalanceSufficient = Restrictions.isAboveDust(totalBalance);
emptyWalletButton.setDefaultButton(isBalanceSufficient);
emptyWalletButton.setDisable(!isBalanceSufficient && addressInputTextField.getText().length() > 0);
emptyWalletButton.setOnAction(e -> {
if (addressInputTextField.getText().length() > 0 && isBalanceSufficient) {
if (walletService.getWallet().isEncrypted()) {
walletPasswordWindow.onAesKey(this::doEmptyWallet).onClose(this::blurAgain).show();
} else {
doEmptyWallet(null);
}
}
});
closeButton = new Button("Cancel");
closeButton.setOnAction(e -> {
hide();
closeHandlerOptional.ifPresent(Runnable::run);
});
closeButton.setDefaultButton(!isBalanceSufficient);
HBox hBox = new HBox();
hBox.setSpacing(10);
GridPane.setRowIndex(hBox, ++rowIndex);
GridPane.setColumnIndex(hBox, 1);
hBox.getChildren().addAll(emptyWalletButton, closeButton);
gridPane.getChildren().add(hBox);
GridPane.setMargin(hBox, new Insets(10, 0, 0, 0));
}
use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.
the class ChaseQuickPayForm method addFormForAddAccount.
@Override
public void addFormForAddAccount() {
gridRowFrom = gridRow + 1;
InputTextField holderNameInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Account holder name:").second;
holderNameInputTextField.setValidator(inputValidator);
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
chaseQuickPayAccount.setHolderName(newValue);
updateFromInputs();
});
mobileNrInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Email:").second;
mobileNrInputTextField.setValidator(chaseQuickPayValidator);
mobileNrInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
chaseQuickPayAccount.setEmail(newValue);
updateFromInputs();
});
addLabelTextField(gridPane, ++gridRow, "Currency:", chaseQuickPayAccount.getSingleTradeCurrency().getNameAndCode());
addAllowedPeriod();
addAccountNameTextFieldWithAutoFillCheckBox();
}
use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.
the class ClearXchangeForm method addFormForAddAccount.
@Override
public void addFormForAddAccount() {
gridRowFrom = gridRow + 1;
InputTextField holderNameInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Account holder name:").second;
holderNameInputTextField.setValidator(inputValidator);
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
clearXchangeAccount.setHolderName(newValue);
updateFromInputs();
});
mobileNrInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Email or mobile no.:").second;
mobileNrInputTextField.setValidator(clearXchangeValidator);
mobileNrInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
clearXchangeAccount.setEmailOrMobileNr(newValue);
updateFromInputs();
});
addLabelTextField(gridPane, ++gridRow, "Currency:", clearXchangeAccount.getSingleTradeCurrency().getNameAndCode());
addAllowedPeriod();
addAccountNameTextFieldWithAutoFillCheckBox();
}
use of io.bitsquare.gui.components.InputTextField in project bitsquare by bitsquare.
the class SepaForm method addFormForAddAccount.
@Override
public void addFormForAddAccount() {
gridRowFrom = gridRow + 1;
InputTextField holderNameInputTextField = addLabelInputTextField(gridPane, ++gridRow, "Account holder name:").second;
holderNameInputTextField.setValidator(inputValidator);
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
sepaAccount.setHolderName(newValue);
updateFromInputs();
});
ibanInputTextField = addLabelInputTextField(gridPane, ++gridRow, "IBAN:").second;
ibanInputTextField.setValidator(ibanValidator);
ibanInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
sepaAccount.setIban(newValue);
updateFromInputs();
});
bicInputTextField = addLabelInputTextField(gridPane, ++gridRow, "BIC:").second;
bicInputTextField.setValidator(bicValidator);
bicInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
sepaAccount.setBic(newValue);
updateFromInputs();
});
addLabel(gridPane, ++gridRow, "Country of bank:");
HBox hBox = new HBox();
hBox.setSpacing(10);
ComboBox<Country> countryComboBox = new ComboBox<>();
currencyComboBox = new ComboBox<>();
currencyTextField = new TextField("");
currencyTextField.setEditable(false);
currencyTextField.setMouseTransparent(true);
currencyTextField.setFocusTraversable(false);
currencyTextField.setMinWidth(300);
currencyTextField.setVisible(false);
currencyTextField.setManaged(false);
currencyComboBox.setVisible(false);
currencyComboBox.setManaged(false);
hBox.getChildren().addAll(countryComboBox, currencyTextField, currencyComboBox);
GridPane.setRowIndex(hBox, gridRow);
GridPane.setColumnIndex(hBox, 1);
gridPane.getChildren().add(hBox);
countryComboBox.setPromptText("Select country of bank");
countryComboBox.setConverter(new StringConverter<Country>() {
@Override
public String toString(Country country) {
return country.name + " (" + country.code + ")";
}
@Override
public Country fromString(String s) {
return null;
}
});
countryComboBox.setOnAction(e -> {
Country selectedItem = countryComboBox.getSelectionModel().getSelectedItem();
sepaAccount.setCountry(selectedItem);
TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(selectedItem.code);
setupCurrency(selectedItem, currency);
updateCountriesSelection(true, euroCountryCheckBoxes);
updateCountriesSelection(true, nonEuroCountryCheckBoxes);
updateFromInputs();
});
addEuroCountriesGrid(true);
addNonEuroCountriesGrid(true);
addAllowedPeriod();
addAccountNameTextFieldWithAutoFillCheckBox();
countryComboBox.setItems(FXCollections.observableArrayList(CountryUtil.getAllSepaCountries()));
Country country = CountryUtil.getDefaultCountry();
if (CountryUtil.getAllSepaCountries().contains(country)) {
countryComboBox.getSelectionModel().select(country);
sepaAccount.setCountry(country);
TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(country.code);
setupCurrency(country, currency);
}
updateFromInputs();
}
Aggregations