use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.
the class FormBuilder method add3Buttons.
public static Tuple3<Button, Button, Button> add3Buttons(GridPane gridPane, int rowIndex, String title1, String title2, String title3, double top) {
HBox hBox = new HBox();
hBox.setSpacing(10);
Button button1 = new AutoTooltipButton(title1);
button1.setDefaultButton(true);
Button button2 = new AutoTooltipButton(title2);
Button button3 = new AutoTooltipButton(title3);
hBox.getChildren().addAll(button1, button2, button3);
GridPane.setRowIndex(hBox, rowIndex);
GridPane.setColumnIndex(hBox, 1);
GridPane.setMargin(hBox, new Insets(top, 10, 0, 0));
gridPane.getChildren().add(hBox);
return new Tuple3<>(button1, button2, button3);
}
use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.
the class FormBuilder method addLabelInputTextFieldButton.
// /////////////////////////////////////////////////////////////////////////////////////////
// Label + InputTextField + Button
// /////////////////////////////////////////////////////////////////////////////////////////
public static Tuple3<Label, InputTextField, Button> addLabelInputTextFieldButton(GridPane gridPane, int rowIndex, String title, String buttonTitle) {
Label label = addLabel(gridPane, rowIndex, title, 0);
InputTextField inputTextField = new InputTextField();
Button button = new AutoTooltipButton(buttonTitle);
button.setDefaultButton(true);
HBox hBox = new HBox();
hBox.setSpacing(10);
hBox.getChildren().addAll(inputTextField, button);
HBox.setHgrow(inputTextField, Priority.ALWAYS);
GridPane.setRowIndex(hBox, rowIndex);
GridPane.setColumnIndex(hBox, 1);
gridPane.getChildren().add(hBox);
return new Tuple3<>(label, inputTextField, button);
}
use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.
the class AltCoinAccountsView method buildForm.
// /////////////////////////////////////////////////////////////////////////////////////////
// Base form
// /////////////////////////////////////////////////////////////////////////////////////////
private void buildForm() {
addTitledGroupBg(root, gridRow, 1, Res.get("shared.manageAccounts"));
Tuple2<Label, ListView> tuple = addLabelListView(root, gridRow, Res.get("account.altcoin.yourAltcoinAccounts"), Layout.FIRST_ROW_DISTANCE);
GridPane.setValignment(tuple.first, VPos.TOP);
// noinspection unchecked
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 AutoTooltipLabel();
final ImageView icon = ImageUtil.getImageViewById(ImageUtil.REMOVE_ICON);
final Button removeButton = new AutoTooltipButton("", 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, Res.get("shared.addNewAccount"), Res.get("shared.ExportAccounts"), Res.get("shared.importAccounts"));
addAccountButton = tuple3.first;
exportButton = tuple3.second;
importButton = tuple3.third;
}
use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.
the class FormBuilder method getEditableValueCurrencyBoxWithInfo.
public static Tuple3<HBox, InfoInputTextField, Label> getEditableValueCurrencyBoxWithInfo(String promptText) {
InfoInputTextField infoInputTextField = new InfoInputTextField();
InputTextField input = infoInputTextField.getTextField();
input.setPrefWidth(170);
input.setAlignment(Pos.CENTER_RIGHT);
input.setId("text-input-with-currency-text-field");
input.setPromptText(promptText);
Label currency = new AutoTooltipLabel(Res.getBaseCurrencyCode());
currency.setId("currency-info-label");
HBox box = new HBox();
box.getChildren().addAll(infoInputTextField, currency);
return new Tuple3<>(box, infoInputTextField, currency);
}
use of bisq.common.util.Tuple3 in project bisq-desktop by bisq-network.
the class FormBuilder method getNonEditableValueCurrencyBox.
public static Tuple3<HBox, TextField, Label> getNonEditableValueCurrencyBox() {
TextField textField = new InputTextField();
textField.setPrefWidth(190);
textField.setAlignment(Pos.CENTER_RIGHT);
textField.setId("text-input-with-currency-text-field");
textField.setMouseTransparent(true);
textField.setEditable(false);
textField.setFocusTraversable(false);
Label currency = new AutoTooltipLabel(Res.getBaseCurrencyCode());
currency.setId("currency-info-label-disabled");
HBox box = new HBox();
box.getChildren().addAll(textField, currency);
return new Tuple3<>(box, textField, currency);
}
Aggregations