use of io.bitsquare.gui.components.HyperlinkWithIcon in project bitsquare by bitsquare.
the class DisplayAlertMessageWindow method addContent.
///////////////////////////////////////////////////////////////////////////////////////////
// Protected
///////////////////////////////////////////////////////////////////////////////////////////
private void addContent() {
checkNotNull(alert, "alertMessage must not be null");
addMultilineLabel(gridPane, ++rowIndex, alert.message, 10);
if (alert.isUpdateInfo) {
headLine = "Important update information!";
headLineLabel.setStyle("-fx-text-fill: -fx-accent; -fx-font-weight: bold; -fx-font-size: 22;");
String url = "https://bitsquare.io/downloads";
HyperlinkWithIcon hyperlinkWithIcon = addLabelHyperlinkWithIcon(gridPane, ++rowIndex, "Download:", url, url).second;
hyperlinkWithIcon.setMaxWidth(550);
} else {
headLine = "Important information!";
headLineLabel.setStyle("-fx-text-fill: -bs-error-red; -fx-font-weight: bold; -fx-font-size: 22;");
}
closeButton = new Button("Close");
closeButton.setOnAction(e -> {
hide();
closeHandlerOptional.ifPresent(closeHandler -> closeHandler.run());
});
GridPane.setRowIndex(closeButton, ++rowIndex);
GridPane.setColumnIndex(closeButton, 1);
gridPane.getChildren().add(closeButton);
GridPane.setMargin(closeButton, new Insets(10, 0, 0, 0));
}
use of io.bitsquare.gui.components.HyperlinkWithIcon in project bitsquare by bitsquare.
the class TransactionsView method setTransactionColumnCellFactory.
private void setTransactionColumnCellFactory() {
transactionColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
transactionColumn.setCellFactory(new Callback<TableColumn<TransactionsListItem, TransactionsListItem>, TableCell<TransactionsListItem, TransactionsListItem>>() {
@Override
public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem, TransactionsListItem> column) {
return new TableCell<TransactionsListItem, TransactionsListItem>() {
private HyperlinkWithIcon hyperlinkWithIcon;
@Override
public void updateItem(final TransactionsListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
String transactionId = item.getTxId();
hyperlinkWithIcon = new HyperlinkWithIcon(transactionId, AwesomeIcon.EXTERNAL_LINK);
hyperlinkWithIcon.setOnAction(event -> openTxInBlockExplorer(item));
hyperlinkWithIcon.setTooltip(new Tooltip("Open external blockchain explorer for " + "transaction: " + transactionId));
setGraphic(hyperlinkWithIcon);
} else {
setGraphic(null);
if (hyperlinkWithIcon != null)
hyperlinkWithIcon.setOnAction(null);
}
}
};
}
});
}
use of io.bitsquare.gui.components.HyperlinkWithIcon in project bitsquare by bitsquare.
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("Open external blockchain explorer for " + "address: " + address));
setGraphic(hyperlinkWithIcon);
} else {
setGraphic(null);
if (hyperlinkWithIcon != null)
hyperlinkWithIcon.setOnAction(null);
}
}
};
}
});
}
use of io.bitsquare.gui.components.HyperlinkWithIcon in project bitsquare by bitsquare.
the class DepositView method setAddressColumnCellFactory.
private void setAddressColumnCellFactory() {
addressColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
addressColumn.setCellFactory(new Callback<TableColumn<DepositListItem, DepositListItem>, TableCell<DepositListItem, DepositListItem>>() {
@Override
public TableCell<DepositListItem, DepositListItem> call(TableColumn<DepositListItem, DepositListItem> column) {
return new TableCell<DepositListItem, DepositListItem>() {
private HyperlinkWithIcon field;
@Override
public void updateItem(final DepositListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
String addressString = item.getAddressString();
field = new HyperlinkWithIcon(addressString, AwesomeIcon.EXTERNAL_LINK);
field.setOnAction(event -> {
openBlockExplorer(item);
tableView.getSelectionModel().select(item);
});
field.setTooltip(new Tooltip("Open external blockchain explorer for " + "address: " + addressString));
setGraphic(field);
} else {
setGraphic(null);
if (field != null)
field.setOnAction(null);
}
}
};
}
});
}
use of io.bitsquare.gui.components.HyperlinkWithIcon in project bitsquare by bitsquare.
the class TransactionsView method setDetailsColumnCellFactory.
private void setDetailsColumnCellFactory() {
detailsColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
detailsColumn.setCellFactory(new Callback<TableColumn<TransactionsListItem, TransactionsListItem>, TableCell<TransactionsListItem, TransactionsListItem>>() {
@Override
public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem, TransactionsListItem> column) {
return new TableCell<TransactionsListItem, TransactionsListItem>() {
private HyperlinkWithIcon field;
@Override
public void updateItem(final TransactionsListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
if (item.getDetailsAvailable()) {
field = new HyperlinkWithIcon(item.getDetails(), AwesomeIcon.INFO_SIGN);
field.setOnAction(event -> openDetailPopup(item));
field.setTooltip(new Tooltip("Open popup for details"));
setGraphic(field);
} else {
setGraphic(new Label(item.getDetails()));
}
} else {
setGraphic(null);
if (field != null)
field.setOnAction(null);
}
}
};
}
});
}
Aggregations