use of javafx.scene.control.TableColumn in project bisq-desktop by bisq-network.
the class OfferBookView method getAvatarColumn.
private TableColumn<OfferBookListItem, OfferBookListItem> getAvatarColumn() {
TableColumn<OfferBookListItem, OfferBookListItem> column = new AutoTooltipTableColumn<OfferBookListItem, OfferBookListItem>(Res.get("offerbook.trader")) {
{
setMinWidth(80);
setMaxWidth(80);
setSortable(true);
}
};
column.setCellValueFactory((offer) -> new ReadOnlyObjectWrapper<>(offer.getValue()));
column.setCellFactory(new Callback<TableColumn<OfferBookListItem, OfferBookListItem>, TableCell<OfferBookListItem, OfferBookListItem>>() {
@Override
public TableCell<OfferBookListItem, OfferBookListItem> call(TableColumn<OfferBookListItem, OfferBookListItem> column) {
return new TableCell<OfferBookListItem, OfferBookListItem>() {
@Override
public void updateItem(final OfferBookListItem newItem, boolean empty) {
super.updateItem(newItem, empty);
if (newItem != null && !empty) {
final Offer offer = newItem.getOffer();
final NodeAddress makersNodeAddress = offer.getOwnerNodeAddress();
String role = Res.get("peerInfoIcon.tooltip.maker");
int numTrades = model.getNumTrades(offer);
PeerInfoIcon peerInfoIcon = new PeerInfoIcon(makersNodeAddress, role, numTrades, privateNotificationManager, offer, model.preferences, model.accountAgeWitnessService, formatter, useDevPrivilegeKeys);
setGraphic(peerInfoIcon);
} else {
setGraphic(null);
}
}
};
}
});
return column;
}
use of javafx.scene.control.TableColumn in project bisq-desktop by bisq-network.
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(Res.get("tooltip.openPopupForDetails")));
setGraphic(field);
} else {
setGraphic(new AutoTooltipLabel(item.getDetails()));
}
} else {
setGraphic(null);
if (field != null)
field.setOnAction(null);
}
}
};
}
});
}
use of javafx.scene.control.TableColumn in project bisq-desktop by bisq-network.
the class TransactionsView method setRevertTxColumnCellFactory.
private void setRevertTxColumnCellFactory() {
revertTxColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
revertTxColumn.setCellFactory(new Callback<TableColumn<TransactionsListItem, TransactionsListItem>, TableCell<TransactionsListItem, TransactionsListItem>>() {
@Override
public TableCell<TransactionsListItem, TransactionsListItem> call(TableColumn<TransactionsListItem, TransactionsListItem> column) {
return new TableCell<TransactionsListItem, TransactionsListItem>() {
Button button;
@Override
public void updateItem(final TransactionsListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
TransactionConfidence confidence = btcWalletService.getConfidenceForTxId(item.getTxId());
if (confidence != null) {
if (confidence.getConfidenceType() == TransactionConfidence.ConfidenceType.PENDING) {
if (button == null) {
button = new AutoTooltipButton(Res.get("funds.tx.revert"));
setGraphic(button);
}
button.setOnAction(e -> revertTransaction(item.getTxId(), item.getTradable()));
} else {
setGraphic(null);
if (button != null) {
button.setOnAction(null);
button = null;
}
}
}
} else {
setGraphic(null);
if (button != null) {
button.setOnAction(null);
button = null;
}
}
}
};
}
});
}
use of javafx.scene.control.TableColumn in project bisq-desktop by bisq-network.
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(Res.get("tooltip.openBlockchainForTx", transactionId)));
setGraphic(hyperlinkWithIcon);
} else {
setGraphic(null);
if (hyperlinkWithIcon != null)
hyperlinkWithIcon.setOnAction(null);
}
}
};
}
});
}
use of javafx.scene.control.TableColumn in project bisq-desktop by bisq-network.
the class WithdrawalView method setSelectColumnCellFactory.
private void setSelectColumnCellFactory() {
selectColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
selectColumn.setCellFactory(new Callback<TableColumn<WithdrawalListItem, WithdrawalListItem>, TableCell<WithdrawalListItem, WithdrawalListItem>>() {
@Override
public TableCell<WithdrawalListItem, WithdrawalListItem> call(TableColumn<WithdrawalListItem, WithdrawalListItem> column) {
return new TableCell<WithdrawalListItem, WithdrawalListItem>() {
CheckBox checkBox = new AutoTooltipCheckBox();
@Override
public void updateItem(final WithdrawalListItem item, boolean empty) {
super.updateItem(item, empty);
if (item != null && !empty) {
checkBox.setOnAction(e -> {
item.setSelected(checkBox.isSelected());
selectForWithdrawal(item);
// If all are selected we select useAllInputsRadioButton
if (observableList.size() == selectedItems.size()) {
inputsToggleGroup.selectToggle(useAllInputsRadioButton);
} else {
// We don't want to get deselected all when we activate the useCustomInputsRadioButton
// so we temporarily disable the listener
inputsToggleGroup.selectedToggleProperty().removeListener(inputsToggleGroupListener);
inputsToggleGroup.selectToggle(useCustomInputsRadioButton);
useAllInputs.set(false);
inputsToggleGroup.selectedToggleProperty().addListener(inputsToggleGroupListener);
}
});
setGraphic(checkBox);
checkBox.setSelected(item.isSelected());
} else {
checkBox.setOnAction(null);
setGraphic(null);
}
}
};
}
});
}
Aggregations