mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-01 11:16:11 -04:00
invert sorting, apply code inspection
This commit is contained in:
parent
489f834e1c
commit
7ab6cfed60
1 changed files with 16 additions and 26 deletions
|
@ -23,11 +23,8 @@ import de.jensd.fx.fontawesome.AwesomeIcon;
|
||||||
import io.bitsquare.arbitration.Dispute;
|
import io.bitsquare.arbitration.Dispute;
|
||||||
import io.bitsquare.arbitration.DisputeManager;
|
import io.bitsquare.arbitration.DisputeManager;
|
||||||
import io.bitsquare.arbitration.messages.DisputeMailMessage;
|
import io.bitsquare.arbitration.messages.DisputeMailMessage;
|
||||||
import io.bitsquare.btc.TradeWalletService;
|
|
||||||
import io.bitsquare.btc.WalletService;
|
|
||||||
import io.bitsquare.common.UserThread;
|
import io.bitsquare.common.UserThread;
|
||||||
import io.bitsquare.common.crypto.KeyRing;
|
import io.bitsquare.common.crypto.KeyRing;
|
||||||
import io.bitsquare.gui.Navigation;
|
|
||||||
import io.bitsquare.gui.common.view.ActivatableView;
|
import io.bitsquare.gui.common.view.ActivatableView;
|
||||||
import io.bitsquare.gui.common.view.FxmlView;
|
import io.bitsquare.gui.common.view.FxmlView;
|
||||||
import io.bitsquare.gui.components.TableGroupHeadline;
|
import io.bitsquare.gui.components.TableGroupHeadline;
|
||||||
|
@ -75,19 +72,15 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
|
|
||||||
private final DisputeManager disputeManager;
|
private final DisputeManager disputeManager;
|
||||||
protected final KeyRing keyRing;
|
protected final KeyRing keyRing;
|
||||||
private final TradeWalletService tradeWalletService;
|
private final TradeManager tradeManager;
|
||||||
private final WalletService walletService;
|
|
||||||
private TradeManager tradeManager;
|
|
||||||
private final Stage stage;
|
private final Stage stage;
|
||||||
private final BSFormatter formatter;
|
private final BSFormatter formatter;
|
||||||
private final Navigation navigation;
|
|
||||||
private final DisputeSummaryPopup disputeSummaryPopup;
|
private final DisputeSummaryPopup disputeSummaryPopup;
|
||||||
private ContractPopup contractPopup;
|
private final ContractPopup contractPopup;
|
||||||
private TradeDetailsPopup tradeDetailsPopup;
|
private final TradeDetailsPopup tradeDetailsPopup;
|
||||||
|
|
||||||
private final List<DisputeMailMessage.Attachment> tempAttachments = new ArrayList<>();
|
private final List<DisputeMailMessage.Attachment> tempAttachments = new ArrayList<>();
|
||||||
|
|
||||||
private TableColumn<Dispute, Dispute> tradeIdColumn, roleColumn, dateColumn, contractColumn, stateColumn;
|
|
||||||
private TableView<Dispute> disputesTable;
|
private TableView<Dispute> disputesTable;
|
||||||
private Dispute selectedDispute;
|
private Dispute selectedDispute;
|
||||||
private ChangeListener<Dispute> disputeChangeListener;
|
private ChangeListener<Dispute> disputeChangeListener;
|
||||||
|
@ -104,17 +97,14 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TraderDisputeView(DisputeManager disputeManager, KeyRing keyRing, TradeWalletService tradeWalletService, WalletService walletService,
|
public TraderDisputeView(DisputeManager disputeManager, KeyRing keyRing, TradeManager tradeManager, Stage stage,
|
||||||
TradeManager tradeManager, Stage stage, BSFormatter formatter, Navigation navigation, DisputeSummaryPopup disputeSummaryPopup,
|
BSFormatter formatter, DisputeSummaryPopup disputeSummaryPopup,
|
||||||
ContractPopup contractPopup, TradeDetailsPopup tradeDetailsPopup) {
|
ContractPopup contractPopup, TradeDetailsPopup tradeDetailsPopup) {
|
||||||
this.disputeManager = disputeManager;
|
this.disputeManager = disputeManager;
|
||||||
this.keyRing = keyRing;
|
this.keyRing = keyRing;
|
||||||
this.tradeWalletService = tradeWalletService;
|
|
||||||
this.walletService = walletService;
|
|
||||||
this.tradeManager = tradeManager;
|
this.tradeManager = tradeManager;
|
||||||
this.stage = stage;
|
this.stage = stage;
|
||||||
this.formatter = formatter;
|
this.formatter = formatter;
|
||||||
this.navigation = navigation;
|
|
||||||
this.disputeSummaryPopup = disputeSummaryPopup;
|
this.disputeSummaryPopup = disputeSummaryPopup;
|
||||||
this.contractPopup = contractPopup;
|
this.contractPopup = contractPopup;
|
||||||
this.tradeDetailsPopup = tradeDetailsPopup;
|
this.tradeDetailsPopup = tradeDetailsPopup;
|
||||||
|
@ -127,15 +117,15 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
disputesTable.setMinHeight(150);
|
disputesTable.setMinHeight(150);
|
||||||
root.getChildren().add(disputesTable);
|
root.getChildren().add(disputesTable);
|
||||||
|
|
||||||
tradeIdColumn = getTradeIdColumn();
|
TableColumn<Dispute, Dispute> tradeIdColumn = getTradeIdColumn();
|
||||||
disputesTable.getColumns().add(tradeIdColumn);
|
disputesTable.getColumns().add(tradeIdColumn);
|
||||||
roleColumn = getRoleColumn();
|
TableColumn<Dispute, Dispute> roleColumn = getRoleColumn();
|
||||||
disputesTable.getColumns().add(roleColumn);
|
disputesTable.getColumns().add(roleColumn);
|
||||||
dateColumn = getDateColumn();
|
TableColumn<Dispute, Dispute> dateColumn = getDateColumn();
|
||||||
disputesTable.getColumns().add(dateColumn);
|
disputesTable.getColumns().add(dateColumn);
|
||||||
contractColumn = getContractColumn();
|
TableColumn<Dispute, Dispute> contractColumn = getContractColumn();
|
||||||
disputesTable.getColumns().add(contractColumn);
|
disputesTable.getColumns().add(contractColumn);
|
||||||
stateColumn = getStateColumn();
|
TableColumn<Dispute, Dispute> stateColumn = getStateColumn();
|
||||||
disputesTable.getColumns().add(stateColumn);
|
disputesTable.getColumns().add(stateColumn);
|
||||||
|
|
||||||
disputesTable.getSortOrder().add(dateColumn);
|
disputesTable.getSortOrder().add(dateColumn);
|
||||||
|
@ -152,8 +142,8 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
protected void activate() {
|
protected void activate() {
|
||||||
FilteredList<Dispute> filteredList = new FilteredList<>(disputeManager.getDisputesAsObservableList());
|
FilteredList<Dispute> filteredList = new FilteredList<>(disputeManager.getDisputesAsObservableList());
|
||||||
setFilteredListPredicate(filteredList);
|
setFilteredListPredicate(filteredList);
|
||||||
SortedList<Dispute> sortedList = new SortedList(filteredList);
|
SortedList<Dispute> sortedList = new SortedList<>(filteredList);
|
||||||
sortedList.setComparator((o1, o2) -> o1.getOpeningDate().compareTo(o2.getOpeningDate()));
|
sortedList.setComparator((o1, o2) -> o2.getOpeningDate().compareTo(o1.getOpeningDate()));
|
||||||
disputesTable.setItems(sortedList);
|
disputesTable.setItems(sortedList);
|
||||||
disputesTable.getSelectionModel().selectedItemProperty().addListener(disputeChangeListener);
|
disputesTable.getSelectionModel().selectedItemProperty().addListener(disputeChangeListener);
|
||||||
|
|
||||||
|
@ -286,7 +276,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
if (root.getChildren().size() > 1)
|
if (root.getChildren().size() > 1)
|
||||||
root.getChildren().remove(1);
|
root.getChildren().remove(1);
|
||||||
|
|
||||||
this.selectedDispute = dispute;
|
selectedDispute = null;
|
||||||
} else if (selectedDispute != dispute) {
|
} else if (selectedDispute != dispute) {
|
||||||
this.selectedDispute = dispute;
|
this.selectedDispute = dispute;
|
||||||
|
|
||||||
|
@ -301,7 +291,7 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
AnchorPane.setLeftAnchor(tableGroupHeadline, 0d);
|
AnchorPane.setLeftAnchor(tableGroupHeadline, 0d);
|
||||||
|
|
||||||
ObservableList<DisputeMailMessage> list = dispute.getDisputeMailMessagesAsObservableList();
|
ObservableList<DisputeMailMessage> list = dispute.getDisputeMailMessagesAsObservableList();
|
||||||
SortedList<DisputeMailMessage> sortedList = new SortedList(list);
|
SortedList<DisputeMailMessage> sortedList = new SortedList<>(list);
|
||||||
sortedList.setComparator((o1, o2) -> o1.getDate().compareTo(o2.getDate()));
|
sortedList.setComparator((o1, o2) -> o1.getDate().compareTo(o2.getDate()));
|
||||||
list.addListener((ListChangeListener<DisputeMailMessage>) c -> scrollToBottom());
|
list.addListener((ListChangeListener<DisputeMailMessage>) c -> scrollToBottom());
|
||||||
messageListView = new ListView<>(sortedList);
|
messageListView = new ListView<>(sortedList);
|
||||||
|
@ -547,12 +537,12 @@ public class TraderDisputeView extends ActivatableView<VBox, Void> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNotArrivedIcon() {
|
/* private void showNotArrivedIcon() {
|
||||||
statusIcon.setVisible(true);
|
statusIcon.setVisible(true);
|
||||||
AwesomeDude.setIcon(statusIcon, AwesomeIcon.WARNING_SIGN, "14");
|
AwesomeDude.setIcon(statusIcon, AwesomeIcon.WARNING_SIGN, "14");
|
||||||
Tooltip.install(statusIcon, new Tooltip("Message did not arrive. Please try to send again."));
|
Tooltip.install(statusIcon, new Tooltip("Message did not arrive. Please try to send again."));
|
||||||
statusIcon.setTextFill(Paint.valueOf("#dd0000"));
|
statusIcon.setTextFill(Paint.valueOf("#dd0000"));
|
||||||
}
|
}*/
|
||||||
|
|
||||||
private void showMailboxIcon() {
|
private void showMailboxIcon() {
|
||||||
statusIcon.setVisible(true);
|
statusIcon.setVisible(true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue