use of io.bitsquare.common.util.Tuple3 in project bitsquare by bitsquare.
the class AltCoinAccountsView method buildForm.
///////////////////////////////////////////////////////////////////////////////////////////
// Base form
///////////////////////////////////////////////////////////////////////////////////////////
private void buildForm() {
addTitledGroupBg(root, gridRow, 1, "Manage accounts");
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, "Your altcoin accounts:", Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
paymentAccountsListView = tuple.second;
paymentAccountsListView.setPrefHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
paymentAccountsListView.setCellFactory(new Callback<ListView<PaymentAccount>, ListCell<PaymentAccount>>() {
@Override
public ListCell<PaymentAccount> call(ListView<PaymentAccount> list) {
return new ListCell<PaymentAccount>() {
final Label label = new Label();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new Button("", icon);
final AnchorPane pane = new AnchorPane(label, removeButton);
{
label.setLayoutY(5);
removeButton.setId("icon-button");
AnchorPane.setRightAnchor(removeButton, 0d);
}
@Override
public void updateItem(final PaymentAccount item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
label.setText(item.getAccountName());
removeButton.setOnAction(e -> onDeleteAccount(item));
setGraphic(pane);
} else {
setGraphic(null);
}
}
};
}
});
Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, "Add new account", "Export Accounts", "Import Accounts");
addAccountButton = tuple3.first;
exportButton = tuple3.second;
importButton = tuple3.third;
}
use of io.bitsquare.common.util.Tuple3 in project bitsquare by bitsquare.
the class FiatAccountsView method buildForm.
///////////////////////////////////////////////////////////////////////////////////////////
// Base form
///////////////////////////////////////////////////////////////////////////////////////////
private void buildForm() {
addTitledGroupBg(root, gridRow, 1, "Manage accounts");
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, "Your national currency\naccounts:", Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
tuple.first.setTextAlignment(TextAlignment.RIGHT);
paymentAccountsListView = tuple.second;
paymentAccountsListView.setPrefHeight(2 * Layout.LIST_ROW_HEIGHT + 14);
paymentAccountsListView.setCellFactory(new Callback<ListView<PaymentAccount>, ListCell<PaymentAccount>>() {
@Override
public ListCell<PaymentAccount> call(ListView<PaymentAccount> list) {
return new ListCell<PaymentAccount>() {
final Label label = new Label();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new Button("", icon);
final AnchorPane pane = new AnchorPane(label, removeButton);
{
label.setLayoutY(5);
removeButton.setId("icon-button");
AnchorPane.setRightAnchor(removeButton, 0d);
}
@Override
public void updateItem(final PaymentAccount item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
label.setText(item.getAccountName());
removeButton.setOnAction(e -> onDeleteAccount(item));
setGraphic(pane);
} else {
setGraphic(null);
}
}
};
}
});
Tuple3<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, "Add new account", "Export Accounts", "Import Accounts");
addAccountButton = tuple3.first;
exportButton = tuple3.second;
importButton = tuple3.third;
}
use of io.bitsquare.common.util.Tuple3 in project bitsquare by bitsquare.
the class FormBuilder method addLabelComboBoxButton.
public static Tuple3<Label, ComboBox, Button> addLabelComboBoxButton(GridPane gridPane, int rowIndex, String title, String buttonTitle, double top) {
Label label = addLabel(gridPane, rowIndex, title, top);
HBox hBox = new HBox();
hBox.setSpacing(10);
Button button = new Button(buttonTitle);
button.setDefaultButton(true);
ComboBox comboBox = new ComboBox();
hBox.getChildren().addAll(comboBox, button);
GridPane.setRowIndex(hBox, rowIndex);
GridPane.setColumnIndex(hBox, 1);
GridPane.setMargin(hBox, new Insets(top, 0, 0, 0));
gridPane.getChildren().add(hBox);
return new Tuple3<>(label, comboBox, button);
}
use of io.bitsquare.common.util.Tuple3 in project bitsquare by bitsquare.
the class FormBuilder method addButtonBusyAnimationLabel.
public static Tuple3<Button, BusyAnimation, Label> addButtonBusyAnimationLabel(GridPane gridPane, int rowIndex, String buttonTitle, double top) {
HBox hBox = new HBox();
hBox.setSpacing(10);
Button button = new Button(buttonTitle);
button.setDefaultButton(true);
BusyAnimation busyAnimation = new BusyAnimation(false);
Label label = new Label();
hBox.setAlignment(Pos.CENTER_LEFT);
hBox.getChildren().addAll(button, busyAnimation, label);
GridPane.setRowIndex(hBox, rowIndex);
GridPane.setColumnIndex(hBox, 1);
GridPane.setMargin(hBox, new Insets(top, 0, 0, 0));
gridPane.getChildren().add(hBox);
return new Tuple3<>(button, busyAnimation, label);
}
use of io.bitsquare.common.util.Tuple3 in project bitsquare by bitsquare.
the class FormBuilder method addLabelInputTextFieldCheckBox.
///////////////////////////////////////////////////////////////////////////////////////////
// Label + InputTextField + CheckBox
///////////////////////////////////////////////////////////////////////////////////////////
public static Tuple3<Label, InputTextField, CheckBox> addLabelInputTextFieldCheckBox(GridPane gridPane, int rowIndex, String title, String checkBoxTitle) {
Label label = addLabel(gridPane, rowIndex, title, 0);
InputTextField inputTextField = new InputTextField();
CheckBox checkBox = new CheckBox(checkBoxTitle);
HBox.setMargin(checkBox, new Insets(4, 0, 0, 0));
HBox hBox = new HBox();
hBox.setSpacing(10);
hBox.getChildren().addAll(inputTextField, checkBox);
GridPane.setRowIndex(hBox, rowIndex);
GridPane.setColumnIndex(hBox, 1);
gridPane.getChildren().add(hBox);
return new Tuple3<>(label, inputTextField, checkBox);
}
Aggregations