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));
}
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);
}
}
};
}
});
}
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);
}
}
};
}
});
}
Aggregations