Search in sources :

Example 11 with HyperlinkWithIcon

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

the class TacWindow method addMessage.

@Override
protected void addMessage() {
    super.addMessage();
    String fontStyleClass = smallScreen ? "small-text" : "normal-text";
    messageLabel.getStyleClass().add(fontStyleClass);
    HyperlinkWithIcon hyperlinkWithIcon = addHyperlinkWithIcon(gridPane, ++rowIndex, Res.get("tacWindow.arbitrationSystem"), "https://bisq.network/arbitration_system.pdf");
    hyperlinkWithIcon.getStyleClass().add(fontStyleClass);
    GridPane.setMargin(hyperlinkWithIcon, new Insets(-6, 0, -20, -4));
}
Also used : Insets(javafx.geometry.Insets) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) FormBuilder.addHyperlinkWithIcon(bisq.desktop.util.FormBuilder.addHyperlinkWithIcon)

Example 12 with HyperlinkWithIcon

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

the class WithdrawalView method setAddressColumnCellFactory.

// /////////////////////////////////////////////////////////////////////////////////////////
// ColumnCellFactories
// /////////////////////////////////////////////////////////////////////////////////////////
private void setAddressColumnCellFactory() {
    addressColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    addressColumn.setCellFactory(new Callback<TableColumn<WithdrawalListItem, WithdrawalListItem>, TableCell<WithdrawalListItem, WithdrawalListItem>>() {

        @Override
        public TableCell<WithdrawalListItem, WithdrawalListItem> call(TableColumn<WithdrawalListItem, WithdrawalListItem> column) {
            return new TableCell<WithdrawalListItem, WithdrawalListItem>() {

                private HyperlinkWithIcon hyperlinkWithIcon;

                @Override
                public void updateItem(final WithdrawalListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        String address = item.getAddressString();
                        hyperlinkWithIcon = new HyperlinkWithIcon(address, AwesomeIcon.EXTERNAL_LINK);
                        hyperlinkWithIcon.setOnAction(event -> openBlockExplorer(item));
                        hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForAddress", address)));
                        setGraphic(hyperlinkWithIcon);
                    } else {
                        setGraphic(null);
                        if (hyperlinkWithIcon != null)
                            hyperlinkWithIcon.setOnAction(null);
                    }
                }
            };
        }
    });
}
Also used : Button(javafx.scene.control.Button) Transaction(org.bitcoinj.core.Transaction) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) Coin(org.bitcoinj.core.Coin) VBox(javafx.scene.layout.VBox) StringUtils(org.apache.commons.lang3.StringUtils) BSFormatter(bisq.desktop.util.BSFormatter) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) Res(bisq.core.locale.Res) TableView(javafx.scene.control.TableView) KeyParameter(org.spongycastle.crypto.params.KeyParameter) SortedList(javafx.collections.transformation.SortedList) AddressFormatException(org.bitcoinj.core.AddressFormatException) Popup(bisq.desktop.main.overlays.popups.Popup) AddressEntryException(bisq.core.btc.AddressEntryException) ClosedTradableManager(bisq.core.trade.closed.ClosedTradableManager) TextField(javafx.scene.control.TextField) WalletPasswordWindow(bisq.desktop.main.overlays.windows.WalletPasswordWindow) P2PService(bisq.network.p2p.P2PService) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) InsufficientFundsException(bisq.core.btc.InsufficientFundsException) Set(java.util.Set) Collectors(java.util.stream.Collectors) FXML(javafx.fxml.FXML) BooleanProperty(javafx.beans.property.BooleanProperty) List(java.util.List) AddressEntry(bisq.core.btc.AddressEntry) WalletsSetup(bisq.core.btc.wallet.WalletsSetup) TradeManager(bisq.core.trade.TradeManager) RadioButton(javafx.scene.control.RadioButton) Preferences(bisq.core.user.Preferences) UserThread(bisq.common.UserThread) Optional(java.util.Optional) Toggle(javafx.scene.control.Toggle) ObservableList(javafx.collections.ObservableList) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon) NotNull(org.jetbrains.annotations.NotNull) Restrictions(bisq.core.btc.Restrictions) GUIUtil(bisq.desktop.util.GUIUtil) BtcWalletService(bisq.core.btc.wallet.BtcWalletService) ActivatableView(bisq.desktop.common.view.ActivatableView) Wallet(org.bitcoinj.wallet.Wallet) FXCollections(javafx.collections.FXCollections) Tradable(bisq.core.trade.Tradable) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) HashSet(java.util.HashSet) BalanceListener(bisq.core.btc.listeners.BalanceListener) TableCell(javafx.scene.control.TableCell) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) Label(javafx.scene.control.Label) Trade(bisq.core.trade.Trade) FailedTradesManager(bisq.core.trade.failed.FailedTradesManager) CheckBox(javafx.scene.control.CheckBox) Preconditions.checkNotNull(com.google.common.base.Preconditions.checkNotNull) InsufficientMoneyException(org.bitcoinj.core.InsufficientMoneyException) FutureCallback(com.google.common.util.concurrent.FutureCallback) TimeUnit(java.util.concurrent.TimeUnit) ToggleGroup(javafx.scene.control.ToggleGroup) SelectionMode(javafx.scene.control.SelectionMode) SimpleBooleanProperty(javafx.beans.property.SimpleBooleanProperty) BtcAddressValidator(bisq.desktop.util.validation.BtcAddressValidator) AutoTooltipCheckBox(bisq.desktop.components.AutoTooltipCheckBox) ChangeListener(javafx.beans.value.ChangeListener) CoinUtil(bisq.core.util.CoinUtil) Tooltip(javafx.scene.control.Tooltip) TableColumn(javafx.scene.control.TableColumn) TableCell(javafx.scene.control.TableCell) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

Example 13 with HyperlinkWithIcon

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

the class FailedTradesView method setTradeIdColumnCellFactory.

private void setTradeIdColumnCellFactory() {
    tradeIdColumn.setCellValueFactory((offerListItem) -> new ReadOnlyObjectWrapper<>(offerListItem.getValue()));
    tradeIdColumn.setCellFactory(new Callback<TableColumn<FailedTradesListItem, FailedTradesListItem>, TableCell<FailedTradesListItem, FailedTradesListItem>>() {

        @Override
        public TableCell<FailedTradesListItem, FailedTradesListItem> call(TableColumn<FailedTradesListItem, FailedTradesListItem> column) {
            return new TableCell<FailedTradesListItem, FailedTradesListItem>() {

                private HyperlinkWithIcon field;

                @Override
                public void updateItem(final FailedTradesListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        field = new HyperlinkWithIcon(model.getTradeId(item));
                        field.setOnAction(event -> tradeDetailsWindow.show(item.getTrade()));
                        field.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails")));
                        setGraphic(field);
                    } else {
                        setGraphic(null);
                        if (field != null)
                            field.setOnAction(null);
                    }
                }
            };
        }
    });
}
Also used : TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) VBox(javafx.scene.layout.VBox) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) Inject(javax.inject.Inject) FXML(javafx.fxml.FXML) TableCell(javafx.scene.control.TableCell) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) Res(bisq.core.locale.Res) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) TableView(javafx.scene.control.TableView) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) SortedList(javafx.collections.transformation.SortedList) TableCell(javafx.scene.control.TableCell) Tooltip(javafx.scene.control.Tooltip) TableColumn(javafx.scene.control.TableColumn) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

Example 14 with HyperlinkWithIcon

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

the class AboutView method initialize.

@Override
public void initialize() {
    TitledGroupBg titledGroupBg = addTitledGroupBg(root, gridRow, 4, Res.get("setting.about.aboutBisq"));
    GridPane.setColumnSpan(titledGroupBg, 2);
    Label label = addLabel(root, gridRow, Res.get("setting.about.about"), Layout.FIRST_ROW_DISTANCE);
    label.setWrapText(true);
    GridPane.setColumnSpan(label, 2);
    GridPane.setHalignment(label, HPos.LEFT);
    HyperlinkWithIcon hyperlinkWithIcon = addHyperlinkWithIcon(root, ++gridRow, Res.get("setting.about.web"), "https://bisq.network");
    GridPane.setColumnSpan(hyperlinkWithIcon, 2);
    hyperlinkWithIcon = addHyperlinkWithIcon(root, ++gridRow, Res.get("setting.about.code"), "https://github.com/bisq-network/exchange");
    GridPane.setColumnSpan(hyperlinkWithIcon, 2);
    hyperlinkWithIcon = addHyperlinkWithIcon(root, ++gridRow, Res.get("setting.about.agpl"), "https://github.com/bisq-network/exchange/blob/master/LICENSE");
    GridPane.setColumnSpan(hyperlinkWithIcon, 2);
    titledGroupBg = addTitledGroupBg(root, ++gridRow, 3, Res.get("setting.about.support"), Layout.GROUP_DISTANCE);
    GridPane.setColumnSpan(titledGroupBg, 2);
    label = addLabel(root, gridRow, Res.get("setting.about.def"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    label.setWrapText(true);
    GridPane.setColumnSpan(label, 2);
    GridPane.setHalignment(label, HPos.LEFT);
    hyperlinkWithIcon = addHyperlinkWithIcon(root, ++gridRow, Res.get("setting.about.contribute"), "https://bisq.network/contribute");
    GridPane.setColumnSpan(hyperlinkWithIcon, 2);
    hyperlinkWithIcon = addHyperlinkWithIcon(root, ++gridRow, Res.get("setting.about.donate"), "https://bisq.network/contribute/#donation");
    GridPane.setColumnSpan(hyperlinkWithIcon, 2);
    final boolean isBtc = Res.getBaseCurrencyCode().equals("BTC");
    titledGroupBg = addTitledGroupBg(root, ++gridRow, isBtc ? 3 : 2, Res.get("setting.about.providers"), Layout.GROUP_DISTANCE);
    GridPane.setColumnSpan(titledGroupBg, 2);
    label = addLabel(root, gridRow, Res.get(isBtc ? "setting.about.apisWithFee" : "setting.about.apis"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    label.setWrapText(true);
    GridPane.setColumnSpan(label, 2);
    GridPane.setHalignment(label, HPos.LEFT);
    addLabelTextField(root, ++gridRow, Res.get("setting.about.pricesProvided"), Res.get("setting.about.pricesProviders", "BitcoinAverage (https://bitcoinaverage.com)", "Poloniex (https://poloniex.com)", "Coinmarketcap (https://coinmarketcap.com)"));
    if (isBtc)
        addLabelTextField(root, ++gridRow, Res.get("setting.about.feeEstimation.label"), "21 (https://bitcoinfees.earn.com)");
    titledGroupBg = addTitledGroupBg(root, ++gridRow, 2, Res.get("setting.about.versionDetails"), Layout.GROUP_DISTANCE);
    GridPane.setColumnSpan(titledGroupBg, 2);
    addLabelTextField(root, gridRow, Res.get("setting.about.version"), Version.VERSION, Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    addLabelTextField(root, ++gridRow, Res.get("setting.about.subsystems.label"), Res.get("setting.about.subsystems.val", Version.P2P_NETWORK_VERSION, Version.getP2PMessageVersion(), Version.LOCAL_DB_VERSION, Version.TRADE_PROTOCOL_VERSION));
}
Also used : FormBuilder.addLabel(bisq.desktop.util.FormBuilder.addLabel) Label(javafx.scene.control.Label) FormBuilder.addTitledGroupBg(bisq.desktop.util.FormBuilder.addTitledGroupBg) TitledGroupBg(bisq.desktop.components.TitledGroupBg) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) FormBuilder.addHyperlinkWithIcon(bisq.desktop.util.FormBuilder.addHyperlinkWithIcon)

Example 15 with HyperlinkWithIcon

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

the class LockedView method setAddressColumnCellFactory.

private void setAddressColumnCellFactory() {
    addressColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    addressColumn.setCellFactory(new Callback<TableColumn<LockedListItem, LockedListItem>, TableCell<LockedListItem, LockedListItem>>() {

        @Override
        public TableCell<LockedListItem, LockedListItem> call(TableColumn<LockedListItem, LockedListItem> column) {
            return new TableCell<LockedListItem, LockedListItem>() {

                private HyperlinkWithIcon hyperlinkWithIcon;

                @Override
                public void updateItem(final LockedListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        String address = item.getAddressString();
                        hyperlinkWithIcon = new HyperlinkWithIcon(address, AwesomeIcon.EXTERNAL_LINK);
                        hyperlinkWithIcon.setOnAction(event -> openBlockExplorer(item));
                        hyperlinkWithIcon.setTooltip(new Tooltip(Res.get("tooltip.openBlockchainForAddress", address)));
                        setGraphic(hyperlinkWithIcon);
                    } else {
                        setGraphic(null);
                        if (hyperlinkWithIcon != null)
                            hyperlinkWithIcon.setOnAction(null);
                    }
                }
            };
        }
    });
}
Also used : GUIUtil(bisq.desktop.util.GUIUtil) BtcWalletService(bisq.core.btc.wallet.BtcWalletService) ActivatableView(bisq.desktop.common.view.ActivatableView) Transaction(org.bitcoinj.core.Transaction) OfferDetailsWindow(bisq.desktop.main.overlays.windows.OfferDetailsWindow) OpenOffer(bisq.core.offer.OpenOffer) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) Coin(org.bitcoinj.core.Coin) FXCollections(javafx.collections.FXCollections) Tradable(bisq.core.trade.Tradable) VBox(javafx.scene.layout.VBox) FxmlView(bisq.desktop.common.view.FxmlView) BSFormatter(bisq.desktop.util.BSFormatter) TableColumn(javafx.scene.control.TableColumn) Inject(javax.inject.Inject) BalanceListener(bisq.core.btc.listeners.BalanceListener) TableCell(javafx.scene.control.TableCell) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) ListChangeListener(javafx.collections.ListChangeListener) Res(bisq.core.locale.Res) TableView(javafx.scene.control.TableView) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) SortedList(javafx.collections.transformation.SortedList) TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) Trade(bisq.core.trade.Trade) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Collectors(java.util.stream.Collectors) OpenOfferManager(bisq.core.offer.OpenOfferManager) FXML(javafx.fxml.FXML) AddressEntry(bisq.core.btc.AddressEntry) TradeManager(bisq.core.trade.TradeManager) Preferences(bisq.core.user.Preferences) Optional(java.util.Optional) ObservableList(javafx.collections.ObservableList) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon) Tooltip(javafx.scene.control.Tooltip) TableColumn(javafx.scene.control.TableColumn) TableCell(javafx.scene.control.TableCell) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

Aggregations

HyperlinkWithIcon (bisq.desktop.components.HyperlinkWithIcon)23 AutoTooltipLabel (bisq.desktop.components.AutoTooltipLabel)19 Tooltip (javafx.scene.control.Tooltip)18 Res (bisq.core.locale.Res)17 FxmlView (bisq.desktop.common.view.FxmlView)17 ReadOnlyObjectWrapper (javafx.beans.property.ReadOnlyObjectWrapper)17 TableCell (javafx.scene.control.TableCell)17 TableColumn (javafx.scene.control.TableColumn)17 TableView (javafx.scene.control.TableView)17 Callback (javafx.util.Callback)17 Inject (javax.inject.Inject)17 SortedList (javafx.collections.transformation.SortedList)16 VBox (javafx.scene.layout.VBox)14 GUIUtil (bisq.desktop.util.GUIUtil)13 ObservableList (javafx.collections.ObservableList)13 Insets (javafx.geometry.Insets)13 Preferences (bisq.core.user.Preferences)12 BSFormatter (bisq.desktop.util.BSFormatter)12 FXML (javafx.fxml.FXML)12 ActivatableView (bisq.desktop.common.view.ActivatableView)11