Search in sources :

Example 1 with AddressWithIconAndDirection

use of io.bitsquare.gui.components.AddressWithIconAndDirection in project bitsquare by bitsquare.

the class TransactionsView method setAddressColumnCellFactory.

private void setAddressColumnCellFactory() {
    addressColumn.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    addressColumn.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 AddressWithIconAndDirection field;

                @Override
                public void updateItem(final TransactionsListItem item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        String addressString = item.getAddressString();
                        field = new AddressWithIconAndDirection(item.getDirection(), addressString, AwesomeIcon.EXTERNAL_LINK, item.getReceived());
                        field.setOnAction(event -> openAddressInBlockExplorer(item));
                        field.setTooltip(new Tooltip("Open external blockchain explorer for " + "address: " + addressString));
                        setGraphic(field);
                    } else {
                        setGraphic(null);
                        if (field != null)
                            field.setOnAction(null);
                    }
                }
            };
        }
    });
}
Also used : EventHandler(javafx.event.EventHandler) OpenOffer(io.bitsquare.trade.offer.OpenOffer) Scene(javafx.scene.Scene) Popup(io.bitsquare.gui.main.overlays.popups.Popup) java.util(java.util) javafx.scene.control(javafx.scene.control) AddressWithIconAndDirection(io.bitsquare.gui.components.AddressWithIconAndDirection) FXCollections(javafx.collections.FXCollections) DisputeManager(io.bitsquare.arbitration.DisputeManager) Trade(io.bitsquare.trade.Trade) CSVEntryConverter(com.googlecode.jcsv.writer.CSVEntryConverter) Tuple2(io.bitsquare.common.util.Tuple2) ActivatableView(io.bitsquare.gui.common.view.ActivatableView) VBox(javafx.scene.layout.VBox) Tradable(io.bitsquare.trade.Tradable) GUIUtil(io.bitsquare.gui.util.GUIUtil) KeyCombination(javafx.scene.input.KeyCombination) Inject(javax.inject.Inject) TradeManager(io.bitsquare.trade.TradeManager) FailedTradesManager(io.bitsquare.trade.failed.FailedTradesManager) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) WalletService(io.bitsquare.btc.WalletService) TradeDetailsWindow(io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow) FeePolicy(io.bitsquare.btc.FeePolicy) Callback(javafx.util.Callback) Nullable(javax.annotation.Nullable) DateFormat(java.text.DateFormat) BSFormatter(io.bitsquare.gui.util.BSFormatter) SortedList(javafx.collections.transformation.SortedList) KeyCode(javafx.scene.input.KeyCode) Utilities(io.bitsquare.common.util.Utilities) OfferDetailsWindow(io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow) ClosedTradableManager(io.bitsquare.trade.closed.ClosedTradableManager) KeyEvent(javafx.scene.input.KeyEvent) Collectors(java.util.stream.Collectors) org.bitcoinj.core(org.bitcoinj.core) FXML(javafx.fxml.FXML) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Preferences(io.bitsquare.user.Preferences) HyperlinkWithIcon(io.bitsquare.gui.components.HyperlinkWithIcon) Script(org.bitcoinj.script.Script) Stream(java.util.stream.Stream) Stage(javafx.stage.Stage) Tuple4(io.bitsquare.common.util.Tuple4) OpenOfferManager(io.bitsquare.trade.offer.OpenOfferManager) ObservableList(javafx.collections.ObservableList) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon) FxmlView(io.bitsquare.gui.common.view.FxmlView) AddressWithIconAndDirection(io.bitsquare.gui.components.AddressWithIconAndDirection)

Aggregations

CSVEntryConverter (com.googlecode.jcsv.writer.CSVEntryConverter)1 AwesomeIcon (de.jensd.fx.fontawesome.AwesomeIcon)1 DisputeManager (io.bitsquare.arbitration.DisputeManager)1 FeePolicy (io.bitsquare.btc.FeePolicy)1 WalletService (io.bitsquare.btc.WalletService)1 Tuple2 (io.bitsquare.common.util.Tuple2)1 Tuple4 (io.bitsquare.common.util.Tuple4)1 Utilities (io.bitsquare.common.util.Utilities)1 ActivatableView (io.bitsquare.gui.common.view.ActivatableView)1 FxmlView (io.bitsquare.gui.common.view.FxmlView)1 AddressWithIconAndDirection (io.bitsquare.gui.components.AddressWithIconAndDirection)1 HyperlinkWithIcon (io.bitsquare.gui.components.HyperlinkWithIcon)1 Popup (io.bitsquare.gui.main.overlays.popups.Popup)1 OfferDetailsWindow (io.bitsquare.gui.main.overlays.windows.OfferDetailsWindow)1 TradeDetailsWindow (io.bitsquare.gui.main.overlays.windows.TradeDetailsWindow)1 BSFormatter (io.bitsquare.gui.util.BSFormatter)1 GUIUtil (io.bitsquare.gui.util.GUIUtil)1 Tradable (io.bitsquare.trade.Tradable)1 Trade (io.bitsquare.trade.Trade)1 TradeManager (io.bitsquare.trade.TradeManager)1