Search in sources :

Example 1 with Dispute

use of bisq.core.arbitration.Dispute in project bisq-desktop by bisq-network.

the class TraderDisputeView method initialize.

@Override
public void initialize() {
    Label label = new AutoTooltipLabel(Res.get("support.filter"));
    HBox.setMargin(label, new Insets(5, 0, 0, 0));
    filterTextField = new InputTextField();
    filterTextField.setText("open");
    filterTextFieldListener = (observable, oldValue, newValue) -> applyFilteredListPredicate(filterTextField.getText());
    filterBox = new HBox();
    filterBox.setSpacing(5);
    filterBox.getChildren().addAll(label, filterTextField);
    VBox.setVgrow(filterBox, Priority.NEVER);
    filterBox.setVisible(false);
    filterBox.setManaged(false);
    tableView = new TableView<>();
    VBox.setVgrow(tableView, Priority.SOMETIMES);
    tableView.setMinHeight(150);
    root.getChildren().addAll(filterBox, tableView);
    tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    Label placeholder = new AutoTooltipLabel(Res.get("support.noTickets"));
    placeholder.setWrapText(true);
    tableView.setPlaceholder(placeholder);
    tableView.getSelectionModel().clearSelection();
    tableView.getColumns().add(getSelectColumn());
    TableColumn<Dispute, Dispute> contractColumn = getContractColumn();
    tableView.getColumns().add(contractColumn);
    TableColumn<Dispute, Dispute> dateColumn = getDateColumn();
    tableView.getColumns().add(dateColumn);
    TableColumn<Dispute, Dispute> tradeIdColumn = getTradeIdColumn();
    tableView.getColumns().add(tradeIdColumn);
    TableColumn<Dispute, Dispute> buyerOnionAddressColumn = getBuyerOnionAddressColumn();
    tableView.getColumns().add(buyerOnionAddressColumn);
    TableColumn<Dispute, Dispute> sellerOnionAddressColumn = getSellerOnionAddressColumn();
    tableView.getColumns().add(sellerOnionAddressColumn);
    TableColumn<Dispute, Dispute> marketColumn = getMarketColumn();
    tableView.getColumns().add(marketColumn);
    TableColumn<Dispute, Dispute> roleColumn = getRoleColumn();
    tableView.getColumns().add(roleColumn);
    TableColumn<Dispute, Dispute> stateColumn = getStateColumn();
    tableView.getColumns().add(stateColumn);
    tradeIdColumn.setComparator((o1, o2) -> o1.getTradeId().compareTo(o2.getTradeId()));
    dateColumn.setComparator((o1, o2) -> o1.getOpeningDate().compareTo(o2.getOpeningDate()));
    buyerOnionAddressColumn.setComparator((o1, o2) -> getBuyerOnionAddressColumnLabel(o1).compareTo(getBuyerOnionAddressColumnLabel(o2)));
    sellerOnionAddressColumn.setComparator((o1, o2) -> getSellerOnionAddressColumnLabel(o1).compareTo(getSellerOnionAddressColumnLabel(o2)));
    marketColumn.setComparator((o1, o2) -> formatter.getCurrencyPair(o1.getContract().getOfferPayload().getCurrencyCode()).compareTo(o2.getContract().getOfferPayload().getCurrencyCode()));
    dateColumn.setSortType(TableColumn.SortType.DESCENDING);
    tableView.getSortOrder().add(dateColumn);
    /*inputTextAreaListener = (observable, oldValue, newValue) ->
                sendButton.setDisable(newValue.length() == 0
                        && tempAttachments.size() == 0 &&
                        selectedDispute.disputeResultProperty().get() == null);*/
    selectedDisputeClosedPropertyListener = (observable, oldValue, newValue) -> {
        messagesInputBox.setVisible(!newValue);
        messagesInputBox.setManaged(!newValue);
        AnchorPane.setBottomAnchor(messageListView, newValue ? 0d : 120d);
    };
    disputeDirectMessageListListener = c -> scrollToBottom();
    keyEventEventHandler = event -> {
        if (Utilities.isAltOrCtrlPressed(KeyCode.L, event)) {
            Map<String, List<Dispute>> map = new HashMap<>();
            disputeManager.getDisputesAsObservableList().stream().forEach(dispute -> {
                String tradeId = dispute.getTradeId();
                List<Dispute> list;
                if (!map.containsKey(tradeId))
                    map.put(tradeId, new ArrayList<>());
                list = map.get(tradeId);
                list.add(dispute);
            });
            List<List<Dispute>> disputeGroups = new ArrayList<>();
            map.entrySet().stream().forEach(entry -> disputeGroups.add(entry.getValue()));
            disputeGroups.sort((o1, o2) -> !o1.isEmpty() && !o2.isEmpty() ? o1.get(0).getOpeningDate().compareTo(o2.get(0).getOpeningDate()) : 0);
            StringBuilder stringBuilder = new StringBuilder();
            // We don't translate that as it is not intended for the public
            stringBuilder.append("Summary of all disputes (No. of disputes: ").append(disputeGroups.size()).append(")\n\n");
            disputeGroups.stream().forEach(disputeGroup -> {
                Dispute dispute0 = disputeGroup.get(0);
                stringBuilder.append("##########################################################################################/\n").append("## Trade ID: ").append(dispute0.getTradeId()).append("\n").append("## Date: ").append(formatter.formatDateTime(dispute0.getOpeningDate())).append("\n").append("## Is support ticket: ").append(dispute0.isSupportTicket()).append("\n");
                if (dispute0.disputeResultProperty().get() != null && dispute0.disputeResultProperty().get().getReason() != null) {
                    stringBuilder.append("## Reason: ").append(dispute0.disputeResultProperty().get().getReason()).append("\n");
                }
                stringBuilder.append("##########################################################################################/\n").append("\n");
                disputeGroup.stream().forEach(dispute -> {
                    stringBuilder.append("*******************************************************************************************\n").append("** Trader's ID: ").append(dispute.getTraderId()).append("\n*******************************************************************************************\n").append("\n");
                    dispute.getDisputeCommunicationMessages().stream().forEach(m -> {
                        String role = m.isSenderIsTrader() ? ">> Trader's msg: " : "<< Arbitrator's msg: ";
                        stringBuilder.append(role).append(m.getMessage()).append("\n");
                    });
                    stringBuilder.append("\n");
                });
                stringBuilder.append("\n");
            });
            String message = stringBuilder.toString();
            // We don't translate that as it is not intended for the public
            new Popup<>().headLine("All disputes (" + disputeGroups.size() + ")").information(message).width(1000).actionButtonText("Copy").onAction(() -> Utilities.copyToClipboard(message)).show();
        } else if (Utilities.isAltOrCtrlPressed(KeyCode.U, event)) {
            // Hidden shortcut to re-open a dispute. Allow it also for traders not only arbitrator.
            if (selectedDispute != null) {
                if (selectedDisputeClosedPropertyListener != null)
                    selectedDispute.isClosedProperty().removeListener(selectedDisputeClosedPropertyListener);
                selectedDispute.setIsClosed(false);
            }
        } else if (Utilities.isAltOrCtrlPressed(KeyCode.R, event)) {
            if (selectedDispute != null) {
                PubKeyRing pubKeyRing = selectedDispute.getTraderPubKeyRing();
                NodeAddress nodeAddress;
                if (pubKeyRing.equals(selectedDispute.getContract().getBuyerPubKeyRing()))
                    nodeAddress = selectedDispute.getContract().getBuyerNodeAddress();
                else
                    nodeAddress = selectedDispute.getContract().getSellerNodeAddress();
                new SendPrivateNotificationWindow(pubKeyRing, nodeAddress, useDevPrivilegeKeys).onAddAlertMessage(privateNotificationManager::sendPrivateNotificationMessageIfKeyIsValid).show();
            }
        } else if (Utilities.isAltOrCtrlPressed(KeyCode.ENTER, event)) {
            if (selectedDispute != null && messagesInputBox.isVisible() && inputTextArea.isFocused())
                onTrySendMessage();
        }
    };
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) HashMap(java.util.HashMap) InputTextField(bisq.desktop.components.InputTextField) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) Label(javafx.scene.control.Label) ArrayList(java.util.ArrayList) SendPrivateNotificationWindow(bisq.desktop.main.overlays.windows.SendPrivateNotificationWindow) Popup(bisq.desktop.main.overlays.popups.Popup) PubKeyRing(bisq.common.crypto.PubKeyRing) Dispute(bisq.core.arbitration.Dispute) SortedList(javafx.collections.transformation.SortedList) FilteredList(javafx.collections.transformation.FilteredList) List(java.util.List) ObservableList(javafx.collections.ObservableList) ArrayList(java.util.ArrayList) NodeAddress(bisq.network.p2p.NodeAddress) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel)

Example 2 with Dispute

use of bisq.core.arbitration.Dispute in project bisq-desktop by bisq-network.

the class TraderDisputeView method getContractColumn.

private TableColumn<Dispute, Dispute> getContractColumn() {
    TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.details")) {

        {
            setMinWidth(80);
            setSortable(false);
        }
    };
    column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
    column.setCellFactory(new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {

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

                Button button;

                @Override
                public void updateItem(final Dispute item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        if (button == null) {
                            button = new AutoTooltipButton(Res.get("shared.details"));
                            setGraphic(button);
                        }
                        button.setOnAction(e -> onOpenContract(item));
                    } else {
                        setGraphic(null);
                        if (button != null) {
                            button.setOnAction(null);
                            button = null;
                        }
                    }
                }
            };
        }
    });
    return column;
}
Also used : Button(javafx.scene.control.Button) EventHandler(javafx.event.EventHandler) PubKeyRing(bisq.common.crypto.PubKeyRing) BusyAnimation(bisq.desktop.components.BusyAnimation) Utilities(bisq.common.util.Utilities) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) ListCell(javafx.scene.control.ListCell) URL(java.net.URL) Date(java.util.Date) ReadOnlyBooleanProperty(javafx.beans.property.ReadOnlyBooleanProperty) DisputeManager(bisq.core.arbitration.DisputeManager) VBox(javafx.scene.layout.VBox) BSFormatter(bisq.desktop.util.BSFormatter) Contract(bisq.core.trade.Contract) InputTextField(bisq.desktop.components.InputTextField) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) ListChangeListener(javafx.collections.ListChangeListener) Res(bisq.core.locale.Res) Map(java.util.Map) TableView(javafx.scene.control.TableView) ParseException(java.text.ParseException) DateFormat(java.text.DateFormat) Pane(javafx.scene.layout.Pane) SortedList(javafx.collections.transformation.SortedList) HBox(javafx.scene.layout.HBox) Popup(bisq.desktop.main.overlays.popups.Popup) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) P2PService(bisq.network.p2p.P2PService) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) FilteredList(javafx.collections.transformation.FilteredList) KeyEvent(javafx.scene.input.KeyEvent) Subscription(org.fxmisc.easybind.Subscription) SendPrivateNotificationWindow(bisq.desktop.main.overlays.windows.SendPrivateNotificationWindow) Priority(javafx.scene.layout.Priority) List(java.util.List) TradeManager(bisq.core.trade.TradeManager) AnchorPane(javafx.scene.layout.AnchorPane) Paint(javafx.scene.paint.Paint) NodeAddress(bisq.network.p2p.NodeAddress) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AppOptionKeys(bisq.core.app.AppOptionKeys) UserThread(bisq.common.UserThread) ByteStreams(com.google.common.io.ByteStreams) Optional(java.util.Optional) Attachment(bisq.core.arbitration.Attachment) ObservableList(javafx.collections.ObservableList) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon) TableGroupHeadline(bisq.desktop.components.TableGroupHeadline) GUIUtil(bisq.desktop.util.GUIUtil) Scene(javafx.scene.Scene) ActivatableView(bisq.desktop.common.view.ActivatableView) ListView(javafx.scene.control.ListView) DisputeSummaryWindow(bisq.desktop.main.overlays.windows.DisputeSummaryWindow) TextArea(javafx.scene.control.TextArea) SimpleDateFormat(java.text.SimpleDateFormat) Timer(bisq.common.Timer) HashMap(java.util.HashMap) Dispute(bisq.core.arbitration.Dispute) ContractWindow(bisq.desktop.main.overlays.windows.ContractWindow) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) TableCell(javafx.scene.control.TableCell) Lists(com.google.common.collect.Lists) Insets(javafx.geometry.Insets) Connection(bisq.network.p2p.network.Connection) TextAlignment(javafx.scene.text.TextAlignment) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) PrivateNotificationManager(bisq.core.alert.PrivateNotificationManager) Nullable(javax.annotation.Nullable) KeyCode(javafx.scene.input.KeyCode) Version(bisq.common.app.Version) Label(javafx.scene.control.Label) TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) MalformedURLException(java.net.MalformedURLException) Trade(bisq.core.trade.Trade) AwesomeDude(de.jensd.fx.fontawesome.AwesomeDude) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) FileChooser(javafx.stage.FileChooser) DisputeCommunicationMessage(bisq.core.arbitration.messages.DisputeCommunicationMessage) Stage(javafx.stage.Stage) EasyBind(org.fxmisc.easybind.EasyBind) ImageView(javafx.scene.image.ImageView) ArbitratorDisputeView(bisq.desktop.main.disputes.arbitrator.ArbitratorDisputeView) Named(com.google.inject.name.Named) KeyRing(bisq.common.crypto.KeyRing) ChangeListener(javafx.beans.value.ChangeListener) InputStream(java.io.InputStream) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) TableColumn(javafx.scene.control.TableColumn) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) TableCell(javafx.scene.control.TableCell) Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) Dispute(bisq.core.arbitration.Dispute)

Example 3 with Dispute

use of bisq.core.arbitration.Dispute in project bisq-desktop by bisq-network.

the class TraderDisputeView method getTradeIdColumn.

private TableColumn<Dispute, Dispute> getTradeIdColumn() {
    TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.tradeId")) {

        {
            setMinWidth(110);
        }
    };
    column.setCellValueFactory((dispute) -> new ReadOnlyObjectWrapper<>(dispute.getValue()));
    column.setCellFactory(new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {

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

                private HyperlinkWithIcon field;

                @Override
                public void updateItem(final Dispute item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        field = new HyperlinkWithIcon(item.getShortTradeId());
                        Optional<Trade> tradeOptional = tradeManager.getTradeById(item.getTradeId());
                        if (tradeOptional.isPresent()) {
                            field.setMouseTransparent(false);
                            field.setTooltip(new Tooltip(Res.get("tooltip.openPopupForDetails")));
                            field.setOnAction(event -> tradeDetailsWindow.show(tradeOptional.get()));
                        } else {
                            field.setMouseTransparent(true);
                        }
                        setGraphic(field);
                    } else {
                        setGraphic(null);
                        if (field != null)
                            field.setOnAction(null);
                    }
                }
            };
        }
    });
    return column;
}
Also used : Button(javafx.scene.control.Button) EventHandler(javafx.event.EventHandler) PubKeyRing(bisq.common.crypto.PubKeyRing) BusyAnimation(bisq.desktop.components.BusyAnimation) Utilities(bisq.common.util.Utilities) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) ListCell(javafx.scene.control.ListCell) URL(java.net.URL) Date(java.util.Date) ReadOnlyBooleanProperty(javafx.beans.property.ReadOnlyBooleanProperty) DisputeManager(bisq.core.arbitration.DisputeManager) VBox(javafx.scene.layout.VBox) BSFormatter(bisq.desktop.util.BSFormatter) Contract(bisq.core.trade.Contract) InputTextField(bisq.desktop.components.InputTextField) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) ListChangeListener(javafx.collections.ListChangeListener) Res(bisq.core.locale.Res) Map(java.util.Map) TableView(javafx.scene.control.TableView) ParseException(java.text.ParseException) DateFormat(java.text.DateFormat) Pane(javafx.scene.layout.Pane) SortedList(javafx.collections.transformation.SortedList) HBox(javafx.scene.layout.HBox) Popup(bisq.desktop.main.overlays.popups.Popup) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) P2PService(bisq.network.p2p.P2PService) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) FilteredList(javafx.collections.transformation.FilteredList) KeyEvent(javafx.scene.input.KeyEvent) Subscription(org.fxmisc.easybind.Subscription) SendPrivateNotificationWindow(bisq.desktop.main.overlays.windows.SendPrivateNotificationWindow) Priority(javafx.scene.layout.Priority) List(java.util.List) TradeManager(bisq.core.trade.TradeManager) AnchorPane(javafx.scene.layout.AnchorPane) Paint(javafx.scene.paint.Paint) NodeAddress(bisq.network.p2p.NodeAddress) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AppOptionKeys(bisq.core.app.AppOptionKeys) UserThread(bisq.common.UserThread) ByteStreams(com.google.common.io.ByteStreams) Optional(java.util.Optional) Attachment(bisq.core.arbitration.Attachment) ObservableList(javafx.collections.ObservableList) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon) TableGroupHeadline(bisq.desktop.components.TableGroupHeadline) GUIUtil(bisq.desktop.util.GUIUtil) Scene(javafx.scene.Scene) ActivatableView(bisq.desktop.common.view.ActivatableView) ListView(javafx.scene.control.ListView) DisputeSummaryWindow(bisq.desktop.main.overlays.windows.DisputeSummaryWindow) TextArea(javafx.scene.control.TextArea) SimpleDateFormat(java.text.SimpleDateFormat) Timer(bisq.common.Timer) HashMap(java.util.HashMap) Dispute(bisq.core.arbitration.Dispute) ContractWindow(bisq.desktop.main.overlays.windows.ContractWindow) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) TableCell(javafx.scene.control.TableCell) Lists(com.google.common.collect.Lists) Insets(javafx.geometry.Insets) Connection(bisq.network.p2p.network.Connection) TextAlignment(javafx.scene.text.TextAlignment) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) PrivateNotificationManager(bisq.core.alert.PrivateNotificationManager) Nullable(javax.annotation.Nullable) KeyCode(javafx.scene.input.KeyCode) Version(bisq.common.app.Version) Label(javafx.scene.control.Label) TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) MalformedURLException(java.net.MalformedURLException) Trade(bisq.core.trade.Trade) AwesomeDude(de.jensd.fx.fontawesome.AwesomeDude) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) FileChooser(javafx.stage.FileChooser) DisputeCommunicationMessage(bisq.core.arbitration.messages.DisputeCommunicationMessage) Stage(javafx.stage.Stage) EasyBind(org.fxmisc.easybind.EasyBind) ImageView(javafx.scene.image.ImageView) ArbitratorDisputeView(bisq.desktop.main.disputes.arbitrator.ArbitratorDisputeView) Named(com.google.inject.name.Named) KeyRing(bisq.common.crypto.KeyRing) ChangeListener(javafx.beans.value.ChangeListener) InputStream(java.io.InputStream) Optional(java.util.Optional) Tooltip(javafx.scene.control.Tooltip) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) TableColumn(javafx.scene.control.TableColumn) TableCell(javafx.scene.control.TableCell) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) Dispute(bisq.core.arbitration.Dispute) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon)

Example 4 with Dispute

use of bisq.core.arbitration.Dispute in project bisq-desktop by bisq-network.

the class PendingTradesDataModel method doOpenDispute.

private void doOpenDispute(boolean isSupportTicket, Transaction depositTx) {
    Log.traceCall("depositTx=" + depositTx);
    byte[] depositTxSerialized = null;
    byte[] payoutTxSerialized = null;
    String depositTxHashAsString = null;
    String payoutTxHashAsString = null;
    if (depositTx != null) {
        depositTxSerialized = depositTx.bitcoinSerialize();
        depositTxHashAsString = depositTx.getHashAsString();
    } else {
        log.warn("depositTx is null");
    }
    Trade trade = getTrade();
    if (trade != null) {
        Transaction payoutTx = trade.getPayoutTx();
        if (payoutTx != null) {
            payoutTxSerialized = payoutTx.bitcoinSerialize();
            payoutTxHashAsString = payoutTx.getHashAsString();
        } else {
            log.debug("payoutTx is null at doOpenDispute");
        }
        final PubKeyRing arbitratorPubKeyRing = trade.getArbitratorPubKeyRing();
        checkNotNull(arbitratorPubKeyRing, "arbitratorPubKeyRing must no tbe null");
        Dispute dispute = new Dispute(disputeManager.getDisputeStorage(), trade.getId(), // traderId
        keyRing.getPubKeyRing().hashCode(), trade.getOffer().getDirection() == OfferPayload.Direction.BUY ? isMaker : !isMaker, isMaker, keyRing.getPubKeyRing(), trade.getDate().getTime(), trade.getContract(), trade.getContractHash(), depositTxSerialized, payoutTxSerialized, depositTxHashAsString, payoutTxHashAsString, trade.getContractAsJson(), trade.getMakerContractSignature(), trade.getTakerContractSignature(), arbitratorPubKeyRing, isSupportTicket);
        trade.setDisputeState(Trade.DisputeState.DISPUTE_REQUESTED);
        if (p2PService.isBootstrapped()) {
            sendOpenNewDisputeMessage(dispute, false);
        } else {
            new Popup<>().information(Res.get("popup.warning.notFullyConnected")).show();
        }
    } else {
        log.warn("trade is null at doOpenDispute");
    }
}
Also used : SellerTrade(bisq.core.trade.SellerTrade) Trade(bisq.core.trade.Trade) BuyerTrade(bisq.core.trade.BuyerTrade) Transaction(org.bitcoinj.core.Transaction) Popup(bisq.desktop.main.overlays.popups.Popup) PubKeyRing(bisq.common.crypto.PubKeyRing) Dispute(bisq.core.arbitration.Dispute)

Example 5 with Dispute

use of bisq.core.arbitration.Dispute in project bisq-desktop by bisq-network.

the class TraderDisputeView method getSelectColumn.

// /////////////////////////////////////////////////////////////////////////////////////////
// Table
// /////////////////////////////////////////////////////////////////////////////////////////
private TableColumn<Dispute, Dispute> getSelectColumn() {
    TableColumn<Dispute, Dispute> column = new AutoTooltipTableColumn<Dispute, Dispute>(Res.get("shared.select"));
    column.setMinWidth(80);
    column.setMaxWidth(80);
    column.setSortable(false);
    column.setCellValueFactory((addressListItem) -> new ReadOnlyObjectWrapper<>(addressListItem.getValue()));
    column.setCellFactory(new Callback<TableColumn<Dispute, Dispute>, TableCell<Dispute, Dispute>>() {

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

                Button button;

                @Override
                public void updateItem(final Dispute item, boolean empty) {
                    super.updateItem(item, empty);
                    if (item != null && !empty) {
                        if (button == null) {
                            button = new AutoTooltipButton(Res.get("shared.select"));
                            setGraphic(button);
                        }
                        button.setOnAction(e -> tableView.getSelectionModel().select(item));
                    } else {
                        setGraphic(null);
                        if (button != null) {
                            button.setOnAction(null);
                            button = null;
                        }
                    }
                }
            };
        }
    });
    return column;
}
Also used : Button(javafx.scene.control.Button) EventHandler(javafx.event.EventHandler) PubKeyRing(bisq.common.crypto.PubKeyRing) BusyAnimation(bisq.desktop.components.BusyAnimation) Utilities(bisq.common.util.Utilities) HyperlinkWithIcon(bisq.desktop.components.HyperlinkWithIcon) ListCell(javafx.scene.control.ListCell) URL(java.net.URL) Date(java.util.Date) ReadOnlyBooleanProperty(javafx.beans.property.ReadOnlyBooleanProperty) DisputeManager(bisq.core.arbitration.DisputeManager) VBox(javafx.scene.layout.VBox) BSFormatter(bisq.desktop.util.BSFormatter) Contract(bisq.core.trade.Contract) InputTextField(bisq.desktop.components.InputTextField) ReadOnlyObjectWrapper(javafx.beans.property.ReadOnlyObjectWrapper) ListChangeListener(javafx.collections.ListChangeListener) Res(bisq.core.locale.Res) Map(java.util.Map) TableView(javafx.scene.control.TableView) ParseException(java.text.ParseException) DateFormat(java.text.DateFormat) Pane(javafx.scene.layout.Pane) SortedList(javafx.collections.transformation.SortedList) HBox(javafx.scene.layout.HBox) Popup(bisq.desktop.main.overlays.popups.Popup) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) P2PService(bisq.network.p2p.P2PService) AutoTooltipLabel(bisq.desktop.components.AutoTooltipLabel) FilteredList(javafx.collections.transformation.FilteredList) KeyEvent(javafx.scene.input.KeyEvent) Subscription(org.fxmisc.easybind.Subscription) SendPrivateNotificationWindow(bisq.desktop.main.overlays.windows.SendPrivateNotificationWindow) Priority(javafx.scene.layout.Priority) List(java.util.List) TradeManager(bisq.core.trade.TradeManager) AnchorPane(javafx.scene.layout.AnchorPane) Paint(javafx.scene.paint.Paint) NodeAddress(bisq.network.p2p.NodeAddress) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AppOptionKeys(bisq.core.app.AppOptionKeys) UserThread(bisq.common.UserThread) ByteStreams(com.google.common.io.ByteStreams) Optional(java.util.Optional) Attachment(bisq.core.arbitration.Attachment) ObservableList(javafx.collections.ObservableList) AwesomeIcon(de.jensd.fx.fontawesome.AwesomeIcon) TableGroupHeadline(bisq.desktop.components.TableGroupHeadline) GUIUtil(bisq.desktop.util.GUIUtil) Scene(javafx.scene.Scene) ActivatableView(bisq.desktop.common.view.ActivatableView) ListView(javafx.scene.control.ListView) DisputeSummaryWindow(bisq.desktop.main.overlays.windows.DisputeSummaryWindow) TextArea(javafx.scene.control.TextArea) SimpleDateFormat(java.text.SimpleDateFormat) Timer(bisq.common.Timer) HashMap(java.util.HashMap) Dispute(bisq.core.arbitration.Dispute) ContractWindow(bisq.desktop.main.overlays.windows.ContractWindow) FxmlView(bisq.desktop.common.view.FxmlView) TableColumn(javafx.scene.control.TableColumn) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) TableCell(javafx.scene.control.TableCell) Lists(com.google.common.collect.Lists) Insets(javafx.geometry.Insets) Connection(bisq.network.p2p.network.Connection) TextAlignment(javafx.scene.text.TextAlignment) Callback(javafx.util.Callback) Tooltip(javafx.scene.control.Tooltip) PrivateNotificationManager(bisq.core.alert.PrivateNotificationManager) Nullable(javax.annotation.Nullable) KeyCode(javafx.scene.input.KeyCode) Version(bisq.common.app.Version) Label(javafx.scene.control.Label) TradeDetailsWindow(bisq.desktop.main.overlays.windows.TradeDetailsWindow) MalformedURLException(java.net.MalformedURLException) Trade(bisq.core.trade.Trade) AwesomeDude(de.jensd.fx.fontawesome.AwesomeDude) FileOutputStream(java.io.FileOutputStream) IOException(java.io.IOException) File(java.io.File) TimeUnit(java.util.concurrent.TimeUnit) FileChooser(javafx.stage.FileChooser) DisputeCommunicationMessage(bisq.core.arbitration.messages.DisputeCommunicationMessage) Stage(javafx.stage.Stage) EasyBind(org.fxmisc.easybind.EasyBind) ImageView(javafx.scene.image.ImageView) ArbitratorDisputeView(bisq.desktop.main.disputes.arbitrator.ArbitratorDisputeView) Named(com.google.inject.name.Named) KeyRing(bisq.common.crypto.KeyRing) ChangeListener(javafx.beans.value.ChangeListener) InputStream(java.io.InputStream) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) TableColumn(javafx.scene.control.TableColumn) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) TableCell(javafx.scene.control.TableCell) Button(javafx.scene.control.Button) AutoTooltipButton(bisq.desktop.components.AutoTooltipButton) AutoTooltipTableColumn(bisq.desktop.components.AutoTooltipTableColumn) Dispute(bisq.core.arbitration.Dispute)

Aggregations

Dispute (bisq.core.arbitration.Dispute)11 Popup (bisq.desktop.main.overlays.popups.Popup)9 HashMap (java.util.HashMap)8 List (java.util.List)8 ObservableList (javafx.collections.ObservableList)8 PubKeyRing (bisq.common.crypto.PubKeyRing)7 Trade (bisq.core.trade.Trade)7 ArrayList (java.util.ArrayList)7 FilteredList (javafx.collections.transformation.FilteredList)7 SortedList (javafx.collections.transformation.SortedList)7 Timer (bisq.common.Timer)6 UserThread (bisq.common.UserThread)6 Version (bisq.common.app.Version)6 KeyRing (bisq.common.crypto.KeyRing)6 PrivateNotificationManager (bisq.core.alert.PrivateNotificationManager)6 AppOptionKeys (bisq.core.app.AppOptionKeys)6 DisputeManager (bisq.core.arbitration.DisputeManager)6 Res (bisq.core.locale.Res)6 TradeManager (bisq.core.trade.TradeManager)6 Date (java.util.Date)6