// Add new account form private void addNewAccount() { paymentAccountsListView.getSelectionModel().clearSelection(); removeAccountRows(); addAccountButton.setDisable(true); accountTitledGroupBg = addTitledGroupBg(root, ++gridRow, 1, "Create new account", Layout.GROUP_DISTANCE); if (paymentMethodForm != null) { FormBuilder.removeRowsFromGridPane(root, 3, paymentMethodForm.getGridRow() + 1); GridPane.setRowSpan(accountTitledGroupBg, paymentMethodForm.getRowSpan() + 1); } gridRow = 2; paymentMethodForm = getPaymentMethodForm(PaymentMethod.BLOCK_CHAINS); if (paymentMethodForm != null) { paymentMethodForm.addFormForAddAccount(); gridRow = paymentMethodForm.getGridRow(); Tuple2<Button, Button> tuple2 = add2ButtonsAfterGroup(root, ++gridRow, "Save new account", "Cancel"); saveNewAccountButton = tuple2.first; saveNewAccountButton.setOnAction( event -> onSaveNewAccount(paymentMethodForm.getPaymentAccount())); saveNewAccountButton.disableProperty().bind(paymentMethodForm.allInputsValidProperty().not()); Button cancelButton = tuple2.second; cancelButton.setOnAction(event -> onCancelNewAccount()); GridPane.setRowSpan(accountTitledGroupBg, paymentMethodForm.getRowSpan() + 1); } }
private void removeAccountRows() { FormBuilder.removeRowsFromGridPane(root, 2, gridRow); gridRow = 1; }
private void removeSelectAccountForm() { FormBuilder.removeRowsFromGridPane(root, 2, gridRow); gridRow = 1; addAccountButton.setDisable(false); paymentAccountsListView.getSelectionModel().clearSelection(); }