Search in sources :

Example 21 with AutoTooltipButton

use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.

the class BuyerStep4View method addContent.

// /////////////////////////////////////////////////////////////////////////////////////////
// Content
// /////////////////////////////////////////////////////////////////////////////////////////
@SuppressWarnings("PointlessBooleanExpression")
@Override
protected void addContent() {
    FormBuilder.addTitledGroupBg(gridPane, gridRow, 5, Res.get("portfolio.pending.step5_buyer.groupTitle"), 0);
    FormBuilder.addLabelTextField(gridPane, gridRow, getBtcTradeAmountLabel(), model.getTradeVolume(), Layout.FIRST_ROW_DISTANCE);
    FormBuilder.addLabelTextField(gridPane, ++gridRow, getFiatTradeAmountLabel(), model.getFiatVolume());
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.refunded"), model.getSecurityDeposit());
    FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.tradeFee"), model.getTradeFee());
    final String miningFee = model.dataModel.isMaker() ? Res.get("portfolio.pending.step5_buyer.makersMiningFee") : Res.get("portfolio.pending.step5_buyer.takersMiningFee");
    FormBuilder.addLabelTextField(gridPane, ++gridRow, miningFee, model.getTxFee());
    withdrawTitledGroupBg = FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 1, Res.get("portfolio.pending.step5_buyer.withdrawBTC"), Layout.GROUP_DISTANCE);
    FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("portfolio.pending.step5_buyer.amount"), model.getPayoutAmount(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    final Tuple2<Label, InputTextField> tuple2 = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.withdrawToAddress"));
    withdrawAddressLabel = tuple2.first;
    withdrawAddressLabel.setManaged(false);
    withdrawAddressLabel.setVisible(false);
    withdrawAddressTextField = tuple2.second;
    withdrawAddressTextField.setManaged(false);
    withdrawAddressTextField.setVisible(false);
    HBox hBox = new HBox();
    hBox.setSpacing(10);
    useSavingsWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.moveToBisqWallet"));
    useSavingsWalletButton.setDefaultButton(false);
    Label label = new AutoTooltipLabel(Res.get("shared.OR"));
    label.setPadding(new Insets(5, 0, 0, 0));
    withdrawToExternalWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.withdrawExternal"));
    withdrawToExternalWalletButton.setDefaultButton(false);
    hBox.getChildren().addAll(useSavingsWalletButton, label, withdrawToExternalWalletButton);
    GridPane.setRowIndex(hBox, ++gridRow);
    GridPane.setColumnIndex(hBox, 1);
    GridPane.setMargin(hBox, new Insets(15, 10, 0, 0));
    gridPane.getChildren().add(hBox);
    useSavingsWalletButton.setOnAction(e -> {
        handleTradeCompleted();
        model.dataModel.tradeManager.addTradeToClosedTrades(trade);
    });
    withdrawToExternalWalletButton.setOnAction(e -> onWithdrawal());
    String key = "tradeCompleted" + trade.getId();
    // noinspection ConstantConditions
    if (!DevEnv.isDevMode() && DontShowAgainLookup.showAgain(key)) {
        DontShowAgainLookup.dontShowAgain(key, true);
        new Notification().headLine(Res.get("notification.tradeCompleted.headline")).notification(Res.get("notification.tradeCompleted.msg")).autoClose().show();
    }
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) InputTextField(bisq.desktop.components.InputTextField) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Notification(bisq.desktop.main.overlays.notifications.Notification)

Example 22 with AutoTooltipButton

use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.

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 AutoTooltipButton(buttonTitle);
    button.setDefaultButton(true);
    BusyAnimation busyAnimation = new BusyAnimation(false);
    Label label = new AutoTooltipLabel();
    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);
}
Also used : HBox(javafx.scene.layout.HBox) BusyAnimation(bisq.desktop.components.BusyAnimation) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Tuple3(bisq.common.util.Tuple3) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 23 with AutoTooltipButton

use of bisq.desktop.components.AutoTooltipButton 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);
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) Tuple3(bisq.common.util.Tuple3) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 24 with AutoTooltipButton

use of bisq.desktop.components.AutoTooltipButton in project bisq-desktop by bisq-network.

the class FormBuilder method addButtonCheckBox.

public static Tuple2<Button, CheckBox> addButtonCheckBox(GridPane gridPane, int rowIndex, String buttonTitle, String checkBoxTitle, double top) {
    Button button = new AutoTooltipButton(buttonTitle);
    button.setDefaultButton(true);
    CheckBox checkBox = new AutoTooltipCheckBox(checkBoxTitle);
    HBox.setMargin(checkBox, new Insets(6, 0, 0, 0));
    HBox hBox = new HBox();
    hBox.setSpacing(20);
    hBox.getChildren().addAll(button, checkBox);
    GridPane.setRowIndex(hBox, rowIndex);
    GridPane.setColumnIndex(hBox, 1);
    hBox.setPadding(new Insets(top, 0, 0, 0));
    gridPane.getChildren().add(hBox);
    return new Tuple2<>(button, checkBox);
}
Also used : AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) CheckBox(javafx.scene.control.CheckBox) AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) Tuple2(bisq.common.util.Tuple2) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Example 25 with AutoTooltipButton

use of bisq.desktop.components.AutoTooltipButton 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);
}
Also used : HBox(javafx.scene.layout.HBox) Button(javafx.scene.control.Button) AutoTooltipRadioButton(bisq.desktop.components.AutoTooltipRadioButton) RadioButton(javafx.scene.control.RadioButton) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) InputTextField(bisq.desktop.components.InputTextField) InfoInputTextField(bisq.desktop.components.InfoInputTextField) Tuple3(bisq.common.util.Tuple3) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton)

Aggregations

AutoTooltipButton (bisq.desktop.components.AutoTooltipButton)43 Button (javafx.scene.control.Button)37 Insets (javafx.geometry.Insets)31 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)28 Label (javafx.scene.control.Label)27 HBox (javafx.scene.layout.HBox)26 Popup (bisq.desktop.main.overlays.popups.Popup)17 ImageView (javafx.scene.image.ImageView)17 Res (bisq.core.locale.Res)15 FxmlView (bisq.desktop.common.view.FxmlView)13 Callback (javafx.util.Callback)13 Inject (javax.inject.Inject)13 InputTextField (bisq.desktop.components.InputTextField)12 ChangeListener (javafx.beans.value.ChangeListener)12 Tooltip (javafx.scene.control.Tooltip)12 VBox (javafx.scene.layout.VBox)12 Tuple2 (bisq.common.util.Tuple2)11 GridPane (javafx.scene.layout.GridPane)11 TableCell (javafx.scene.control.TableCell)10 TableColumn (javafx.scene.control.TableColumn)10