Search in sources :

Example 21 with HyperlinkWithIcon

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

the class DisplayAlertMessageWindow method addContent.

// /////////////////////////////////////////////////////////////////////////////////////////
// Protected
// /////////////////////////////////////////////////////////////////////////////////////////
private void addContent() {
    checkNotNull(alert, "alertMessage must not be null");
    FormBuilder.addMultilineLabel(gridPane, ++rowIndex, alert.getMessage(), 10);
    if (alert.isUpdateInfo()) {
        headLine = Res.get("displayAlertMessageWindow.update.headline");
        headLineLabel.getStyleClass().addAll("headline-label", "highlight");
        String url = "https://bisq.network/downloads";
        HyperlinkWithIcon hyperlinkWithIcon = FormBuilder.addLabelHyperlinkWithIcon(gridPane, ++rowIndex, Res.get("displayAlertMessageWindow.update.download"), url, url).second;
        hyperlinkWithIcon.setMaxWidth(550);
    } else {
        headLine = Res.get("displayAlertMessageWindow.headline");
        headLineLabel.getStyleClass().addAll("headline-label", "error-text");
    }
    closeButton = new AutoTooltipButton(Res.get("shared.close"));
    closeButton.setOnAction(e -> {
        hide();
        closeHandlerOptional.ifPresent(Runnable::run);
    });
    GridPane.setRowIndex(closeButton, ++rowIndex);
    GridPane.setColumnIndex(closeButton, 1);
    gridPane.getChildren().add(closeButton);
    GridPane.setMargin(closeButton, new Insets(10, 0, 0, 0));
}
Also used : Insets(javafx.geometry.Insets) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

Example 22 with HyperlinkWithIcon

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

the class ClosedTradesView method setTradeIdColumnCellFactory.

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

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

                private HyperlinkWithIcon field;

                @Override
                public void updateItem(final ClosedTradableListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        field = new HyperlinkWithIcon(model.getTradeId(item));
                        field.setOnAction(event -> {
                            Tradable tradable = item.getTradable();
                            if (tradable instanceof Trade)
                                tradeDetailsWindow.show((Trade) tradable);
                            else if (tradable instanceof OpenOffer)
                                offerDetailsWindow.show(tradable.getOffer());
                        });
                        field.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails")));
                        setGraphic(field);
                    } else {
                        setGraphic(null);
                        if (field != null)
                            field.setOnAction(null);
                    }
                }
            };
        }
    });
}
Also used : Button(javafx.scene.control.Button) GUIUtil(bisq.desktop.util.GUIUtil) OfferDetailsWindow(bisq.desktop.main.overlays.windows.OfferDetailsWindow) OpenOffer(bisq.core.offer.OpenOffer) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) Coin(org.bitcoinj.core.Coin) Tradable(bisq.core.trade.Tradable) CSVEntryConverter(com.googlecode.jcsv.writer.CSVEntryConverter) VBox(javafx.scene.layout.VBox) Volume(bisq.core.monetary.Volume) FxmlView(bisq.desktop.common.view.FxmlView) BSFormatter(bisq.desktop.util.BSFormatter) TableColumn(javafx.scene.control.TableColumn) Inject(javax.inject.Inject) TableCell(javafx.scene.control.TableCell) Insets(javafx.geometry.Insets) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) Res(bisq.core.locale.Res) TableView(javafx.scene.control.TableView) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) PrivateNotificationManager(bisq.core.alert.PrivateNotificationManager) SortedList(javafx.collections.transformation.SortedList) Offer(bisq.core.offer.Offer) TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) Trade(bisq.core.trade.Trade) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Node(javafx.scene.Node) PeerInfoIcon(bisq.desktop.components.PeerInfoIcon) FXML(javafx.fxml.FXML) Stage(javafx.stage.Stage) NodeAddress(bisq.network.p2p.NodeAddress) AppOptionKeys(bisq.core.app.AppOptionKeys) Preferences(bisq.core.user.Preferences) Price(bisq.core.monetary.Price) Named(com.google.inject.name.Named) ObservableList(javafx.collections.ObservableList) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) Comparator(java.util.Comparator) Tradable(bisq.core.trade.Tradable) OpenOffer(bisq.core.offer.OpenOffer) Tooltip(javafx.scene.control.Tooltip) TableColumn(javafx.scene.control.TableColumn) Trade(bisq.core.trade.Trade) TableCell(javafx.scene.control.TableCell) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

Example 23 with HyperlinkWithIcon

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

the class PendingTradesView method setTradeIdColumnCellFactory.

// /////////////////////////////////////////////////////////////////////////////////////////
// CellFactories
// /////////////////////////////////////////////////////////////////////////////////////////
private void setTradeIdColumnCellFactory() {
    tradeIdColumn.setCellValueFactory((pendingTradesListItem) -> new ReadOnlyObjectWrapper<>(pendingTradesListItem.getValue()));
    tradeIdColumn.setCellFactory(new Callback<TableColumn<PendingTradesListItem, PendingTradesListItem>, TableCell<PendingTradesListItem, PendingTradesListItem>>() {

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

                private HyperlinkWithIcon field;

                @Override
                public void updateItem(final PendingTradesListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        field = new HyperlinkWithIcon(item.getTrade().getShortId());
                        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 : EventHandler(javafx.event.EventHandler) Scene(javafx.scene.Scene) Utilities(bisq.common.util.Utilities) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) 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) TableCell(javafx.scene.control.TableCell) Insets(javafx.geometry.Insets) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) Res(bisq.core.locale.Res) TableView(javafx.scene.control.TableView) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) PrivateNotificationManager(bisq.core.alert.PrivateNotificationManager) SortedList(javafx.collections.transformation.SortedList) KeyCode(javafx.scene.input.KeyCode) Popup(bisq.desktop.main.overlays.popups.Popup) Offer(bisq.core.offer.Offer) TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) Trade(bisq.core.trade.Trade) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Node(javafx.scene.Node) KeyEvent(javafx.scene.input.KeyEvent) Subscription(org.fxmisc.easybind.Subscription) PeerInfoIcon(bisq.desktop.components.PeerInfoIcon) FXML(javafx.fxml.FXML) Priority(javafx.scene.layout.Priority) EasyBind(org.fxmisc.easybind.EasyBind) NodeAddress(bisq.network.p2p.NodeAddress) AppOptionKeys(bisq.core.app.AppOptionKeys) Preferences(bisq.core.user.Preferences) UserThread(bisq.common.UserThread) Named(com.google.inject.name.Named) ActivatableViewAndModel(bisq.desktop.common.view.ActivatableViewAndModel) TableCell(javafx.scene.control.TableCell) Tooltip(javafx.scene.control.Tooltip) TableColumn(javafx.scene.control.TableColumn) 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