mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-03-15 10:26:37 -04:00
Use CopyOnWriteArrayList for listeners
This commit is contained in:
parent
2840311853
commit
8ae0dd8b41
@ -65,6 +65,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.locks.ReentrantLock;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@ -104,10 +105,10 @@ public class WalletFacade {
|
||||
private final FeePolicy feePolicy;
|
||||
private final CryptoFacade cryptoFacade;
|
||||
private final Persistence persistence;
|
||||
private final List<DownloadListener> downloadListeners = new ArrayList<>();
|
||||
private final List<AddressConfidenceListener> addressConfidenceListeners = new ArrayList<>();
|
||||
private final List<TxConfidenceListener> txConfidenceListeners = new ArrayList<>();
|
||||
private final List<BalanceListener> balanceListeners = new ArrayList<>();
|
||||
private final List<DownloadListener> downloadListeners = new CopyOnWriteArrayList<>();
|
||||
private final List<AddressConfidenceListener> addressConfidenceListeners = new CopyOnWriteArrayList<>();
|
||||
private final List<TxConfidenceListener> txConfidenceListeners = new CopyOnWriteArrayList<>();
|
||||
private final List<BalanceListener> balanceListeners = new CopyOnWriteArrayList<>();
|
||||
private Wallet wallet;
|
||||
private WalletEventListener walletEventListener;
|
||||
private AddressEntry registrationAddressEntry;
|
||||
|
@ -67,6 +67,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||
private ChangeListener<PendingTradesPM.State> offererStateChangeListener;
|
||||
private ChangeListener<PendingTradesPM.State> takerStateChangeListener;
|
||||
private ChangeListener<Throwable> faultChangeListener;
|
||||
private ChangeListener<PendingTradesListItem> listItemChangeListener;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -136,6 +137,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||
|
||||
txIdTextField.setup(presentationModel.getWalletFacade(), presentationModel.txId.get());
|
||||
table.getSelectionModel().select(presentationModel.getSelectedItem());
|
||||
table.getSelectionModel().selectedItemProperty().addListener(selectedItemChangeListener);
|
||||
|
||||
// TODO Set focus does not work yet...
|
||||
/* table.requestFocus();
|
||||
@ -553,7 +555,7 @@ public class PendingTradesViewCB extends CachedViewCB<PendingTradesPM> {
|
||||
}
|
||||
|
||||
private void showTradeDetails(PendingTradesListItem item) {
|
||||
presentationModel.selectPendingTrade(item);
|
||||
table.getSelectionModel().select(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ package io.bitsquare.trade;
|
||||
import io.bitsquare.btc.BlockChainFacade;
|
||||
import io.bitsquare.btc.WalletFacade;
|
||||
import io.bitsquare.crypto.CryptoFacade;
|
||||
import io.bitsquare.gui.components.Popups;
|
||||
import io.bitsquare.msg.MessageFacade;
|
||||
import io.bitsquare.persistence.Persistence;
|
||||
import io.bitsquare.settings.Settings;
|
||||
@ -393,8 +392,11 @@ public class TradeManager {
|
||||
}
|
||||
else {
|
||||
// For usability tests we don't want to crash
|
||||
Popups.openWarningPopup("Sorry, you cannot continue. You have restarted the application in the meantime. " +
|
||||
"Interruption of the trade process is not supported yet. Will need more time to be implemented.");
|
||||
//TODO move to gui package
|
||||
/* Popups.openWarningPopup("Sorry, you cannot continue. You have restarted the application in the meantime
|
||||
. " +
|
||||
|
||||
"Interruption of the trade process is not supported yet. Will need more time to be implemented.");*/
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user