mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-21 22:31:44 +01:00
Refactor OrderBookInfo (renamed from OrderBookFilter)
This commit is contained in:
parent
f20fe3a22b
commit
870cd062f5
10 changed files with 66 additions and 100 deletions
|
@ -30,7 +30,7 @@ public class BuyViewCB extends TradeViewCB {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initOrderBook() {
|
protected void initOrderBook() {
|
||||||
orderBookViewCB.initOrderBook(Direction.BUY);
|
orderBookViewCB.initOrderBook(Direction.BUY, presentationModel.getOrderBookInfo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,16 +22,18 @@ import io.bitsquare.trade.Direction;
|
||||||
import com.google.bitcoin.core.Coin;
|
import com.google.bitcoin.core.Coin;
|
||||||
import com.google.bitcoin.utils.Fiat;
|
import com.google.bitcoin.utils.Fiat;
|
||||||
|
|
||||||
import javafx.beans.property.SimpleBooleanProperty;
|
import javafx.beans.property.ObjectProperty;
|
||||||
|
import javafx.beans.property.SimpleObjectProperty;
|
||||||
|
|
||||||
//TODO move to OrderBookModel when converted to new UI structure
|
/**
|
||||||
public class OrderBookFilter {
|
* Shared data between the different trade UIs
|
||||||
// TODO use ObjectProperty<Direction> instead
|
*/
|
||||||
private final SimpleBooleanProperty directionChangedProperty = new SimpleBooleanProperty();
|
public class OrderBookInfo {
|
||||||
|
|
||||||
|
private final ObjectProperty<Direction> direction = new SimpleObjectProperty<>();
|
||||||
|
|
||||||
private Fiat price;
|
private Fiat price;
|
||||||
private Coin amount;
|
private Coin amount;
|
||||||
private Direction direction;
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -46,8 +48,8 @@ public class OrderBookFilter {
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Direction getDirection() {
|
public void setDirection(Direction direction) {
|
||||||
return direction;
|
this.direction.set(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -55,11 +57,6 @@ public class OrderBookFilter {
|
||||||
// Getters
|
// Getters
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public void setDirection(Direction direction) {
|
|
||||||
this.direction = direction;
|
|
||||||
directionChangedProperty.set(!directionChangedProperty.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Fiat getPrice() {
|
public Fiat getPrice() {
|
||||||
return price;
|
return price;
|
||||||
}
|
}
|
||||||
|
@ -68,7 +65,13 @@ public class OrderBookFilter {
|
||||||
this.price = price;
|
this.price = price;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleBooleanProperty getDirectionChangedProperty() {
|
public Direction getDirection() {
|
||||||
return directionChangedProperty;
|
return direction.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ObjectProperty<Direction> directionProperty() {
|
||||||
|
return direction;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -30,7 +30,7 @@ public class SellViewCB extends TradeViewCB {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initOrderBook() {
|
protected void initOrderBook() {
|
||||||
orderBookViewCB.initOrderBook(Direction.SELL);
|
orderBookViewCB.initOrderBook(Direction.SELL, presentationModel.getOrderBookInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,33 +27,23 @@ import org.slf4j.LoggerFactory;
|
||||||
public class TradeModel extends UIModel {
|
public class TradeModel extends UIModel {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TradeModel.class);
|
private static final Logger log = LoggerFactory.getLogger(TradeModel.class);
|
||||||
|
|
||||||
|
private OrderBookInfo orderBookInfo;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Constructor
|
// Constructor
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public TradeModel() {
|
public TradeModel(OrderBookInfo orderBookInfo) {
|
||||||
|
this.orderBookInfo = orderBookInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Getters
|
// Getters
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public OrderBookInfo getOrderBookInfo() {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
return orderBookInfo;
|
||||||
// Setters
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,29 +37,11 @@ public class TradePM extends PresentationModel<TradeModel> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Interface implementation: Initializable
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Getters
|
// Getters
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public OrderBookInfo getOrderBookInfo() {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
return model.getOrderBookInfo();
|
||||||
// Setters
|
}
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Private methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,8 @@ public abstract class TradeViewCB extends CachedViewCB<TradePM> {
|
||||||
private static final Logger log = LoggerFactory.getLogger(TradeViewCB.class);
|
private static final Logger log = LoggerFactory.getLogger(TradeViewCB.class);
|
||||||
|
|
||||||
protected OrderBookViewCB orderBookViewCB;
|
protected OrderBookViewCB orderBookViewCB;
|
||||||
protected CreateOfferViewCB createOfferViewCB;
|
private CreateOfferViewCB createOfferViewCB;
|
||||||
protected TakeOfferController takeOfferController;
|
private TakeOfferController takeOfferController;
|
||||||
private Node createOfferView;
|
private Node createOfferView;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ package io.bitsquare.gui.main.trade.createoffer;
|
||||||
|
|
||||||
import io.bitsquare.btc.WalletFacade;
|
import io.bitsquare.btc.WalletFacade;
|
||||||
import io.bitsquare.gui.PresentationModel;
|
import io.bitsquare.gui.PresentationModel;
|
||||||
import io.bitsquare.gui.main.trade.OrderBookFilter;
|
import io.bitsquare.gui.main.trade.OrderBookInfo;
|
||||||
import io.bitsquare.gui.util.BSFormatter;
|
import io.bitsquare.gui.util.BSFormatter;
|
||||||
import io.bitsquare.gui.util.validation.BtcValidator;
|
import io.bitsquare.gui.util.validation.BtcValidator;
|
||||||
import io.bitsquare.gui.util.validation.FiatValidator;
|
import io.bitsquare.gui.util.validation.FiatValidator;
|
||||||
|
@ -154,21 +154,21 @@ public class CreateOfferPM extends PresentationModel<CreateOfferModel> {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// setOrderBookFilter is a one time call
|
// setOrderBookFilter is a one time call
|
||||||
public void setOrderBookFilter(@NotNull OrderBookFilter orderBookFilter) {
|
public void setOrderBookFilter(@NotNull OrderBookInfo orderBookInfo) {
|
||||||
model.setDirection(orderBookFilter.getDirection());
|
model.setDirection(orderBookInfo.getDirection());
|
||||||
directionLabel.set(model.getDirection() == Direction.BUY ? BSResources.get("shared.buy") : BSResources.get
|
directionLabel.set(model.getDirection() == Direction.BUY ? BSResources.get("shared.buy") : BSResources.get
|
||||||
("shared.sell"));
|
("shared.sell"));
|
||||||
|
|
||||||
// apply only if valid
|
// apply only if valid
|
||||||
if (orderBookFilter.getAmount() != null && isBtcInputValid(orderBookFilter.getAmount().toPlainString())
|
if (orderBookInfo.getAmount() != null && isBtcInputValid(orderBookInfo.getAmount().toPlainString())
|
||||||
.isValid) {
|
.isValid) {
|
||||||
model.amountAsCoin.set(orderBookFilter.getAmount());
|
model.amountAsCoin.set(orderBookInfo.getAmount());
|
||||||
model.minAmountAsCoin.set(orderBookFilter.getAmount());
|
model.minAmountAsCoin.set(orderBookInfo.getAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply only if valid
|
// apply only if valid
|
||||||
if (orderBookFilter.getPrice() != null && isBtcInputValid(orderBookFilter.getPrice().toPlainString()).isValid)
|
if (orderBookInfo.getPrice() != null && isBtcInputValid(orderBookInfo.getPrice().toPlainString()).isValid)
|
||||||
model.priceAsFiat.set(parseToFiatWith2Decimals(orderBookFilter.getPrice().toPlainString()));
|
model.priceAsFiat.set(parseToFiatWith2Decimals(orderBookInfo.getPrice().toPlainString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import io.bitsquare.gui.components.btc.AddressTextField;
|
||||||
import io.bitsquare.gui.components.btc.BalanceTextField;
|
import io.bitsquare.gui.components.btc.BalanceTextField;
|
||||||
import io.bitsquare.gui.main.help.Help;
|
import io.bitsquare.gui.main.help.Help;
|
||||||
import io.bitsquare.gui.main.help.HelpId;
|
import io.bitsquare.gui.main.help.HelpId;
|
||||||
import io.bitsquare.gui.main.trade.OrderBookFilter;
|
import io.bitsquare.gui.main.trade.OrderBookInfo;
|
||||||
import io.bitsquare.gui.util.ImageUtil;
|
import io.bitsquare.gui.util.ImageUtil;
|
||||||
import io.bitsquare.locale.BSResources;
|
import io.bitsquare.locale.BSResources;
|
||||||
|
|
||||||
|
@ -162,8 +162,8 @@ public class CreateOfferViewCB extends CachedViewCB<CreateOfferPM> {
|
||||||
// Public methods (called form other views/CB)
|
// Public methods (called form other views/CB)
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
public void setOrderBookFilter(OrderBookFilter orderBookFilter) {
|
public void setOrderBookFilter(OrderBookInfo orderBookInfo) {
|
||||||
presentationModel.setOrderBookFilter(orderBookFilter);
|
presentationModel.setOrderBookFilter(orderBookInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ package io.bitsquare.gui.main.trade.orderbook;
|
||||||
|
|
||||||
import io.bitsquare.arbitrator.Arbitrator;
|
import io.bitsquare.arbitrator.Arbitrator;
|
||||||
import io.bitsquare.bank.BankAccount;
|
import io.bitsquare.bank.BankAccount;
|
||||||
import io.bitsquare.gui.main.trade.OrderBookFilter;
|
import io.bitsquare.gui.main.trade.OrderBookInfo;
|
||||||
import io.bitsquare.locale.Country;
|
import io.bitsquare.locale.Country;
|
||||||
import io.bitsquare.locale.CurrencyUtil;
|
import io.bitsquare.locale.CurrencyUtil;
|
||||||
import io.bitsquare.msg.MessageFacade;
|
import io.bitsquare.msg.MessageFacade;
|
||||||
|
@ -106,12 +106,12 @@ public class OrderBook implements OrderBookListener {
|
||||||
tradeManager.removeOffer(offer);
|
tradeManager.removeOffer(offer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyFilter(OrderBookFilter orderBookFilter) {
|
public void applyFilter(OrderBookInfo orderBookInfo) {
|
||||||
filteredList.setPredicate(orderBookListItem -> {
|
filteredList.setPredicate(orderBookListItem -> {
|
||||||
Offer offer = orderBookListItem.getOffer();
|
Offer offer = orderBookListItem.getOffer();
|
||||||
BankAccount currentBankAccount = user.getCurrentBankAccount();
|
BankAccount currentBankAccount = user.getCurrentBankAccount();
|
||||||
|
|
||||||
if (orderBookFilter == null || currentBankAccount == null || orderBookFilter.getDirection() == null) {
|
if (orderBookInfo == null || currentBankAccount == null || orderBookInfo.getDirection() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,19 +128,19 @@ public class OrderBook implements OrderBookListener {
|
||||||
// Apply applyFilter only if there is a valid value set
|
// Apply applyFilter only if there is a valid value set
|
||||||
// The requested amount must be lower or equal then the offer amount
|
// The requested amount must be lower or equal then the offer amount
|
||||||
boolean amountResult = true;
|
boolean amountResult = true;
|
||||||
if (orderBookFilter.getAmount() != null)
|
if (orderBookInfo.getAmount() != null)
|
||||||
amountResult = orderBookFilter.getAmount().compareTo(offer.getAmount()) <= 0;
|
amountResult = orderBookInfo.getAmount().compareTo(offer.getAmount()) <= 0;
|
||||||
|
|
||||||
// The requested trade direction must be opposite of the offerList trade direction
|
// The requested trade direction must be opposite of the offerList trade direction
|
||||||
boolean directionResult = !orderBookFilter.getDirection().equals(offer.getDirection());
|
boolean directionResult = !orderBookInfo.getDirection().equals(offer.getDirection());
|
||||||
|
|
||||||
// Apply applyFilter only if there is a valid value set
|
// Apply applyFilter only if there is a valid value set
|
||||||
boolean priceResult = true;
|
boolean priceResult = true;
|
||||||
if (orderBookFilter.getPrice() != null) {
|
if (orderBookInfo.getPrice() != null) {
|
||||||
if (offer.getDirection() == Direction.SELL)
|
if (offer.getDirection() == Direction.SELL)
|
||||||
priceResult = orderBookFilter.getPrice().compareTo(offer.getPrice()) >= 0;
|
priceResult = orderBookInfo.getPrice().compareTo(offer.getPrice()) >= 0;
|
||||||
else
|
else
|
||||||
priceResult = orderBookFilter.getPrice().compareTo(offer.getPrice()) <= 0;
|
priceResult = orderBookInfo.getPrice().compareTo(offer.getPrice()) <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The arbitrator defined in the offer must match one of the accepted arbitrators defined in the settings
|
// The arbitrator defined in the offer must match one of the accepted arbitrators defined in the settings
|
||||||
|
|
|
@ -26,7 +26,7 @@ import io.bitsquare.gui.OverlayController;
|
||||||
import io.bitsquare.gui.ViewCB;
|
import io.bitsquare.gui.ViewCB;
|
||||||
import io.bitsquare.gui.ViewController;
|
import io.bitsquare.gui.ViewController;
|
||||||
import io.bitsquare.gui.components.Popups;
|
import io.bitsquare.gui.components.Popups;
|
||||||
import io.bitsquare.gui.main.trade.OrderBookFilter;
|
import io.bitsquare.gui.main.trade.OrderBookInfo;
|
||||||
import io.bitsquare.gui.main.trade.createoffer.CreateOfferViewCB;
|
import io.bitsquare.gui.main.trade.createoffer.CreateOfferViewCB;
|
||||||
import io.bitsquare.gui.main.trade.takeoffer.TakeOfferController;
|
import io.bitsquare.gui.main.trade.takeoffer.TakeOfferController;
|
||||||
import io.bitsquare.gui.util.BSFormatter;
|
import io.bitsquare.gui.util.BSFormatter;
|
||||||
|
@ -88,7 +88,7 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
private NavigationController navigationController;
|
private NavigationController navigationController;
|
||||||
private OverlayController overlayController;
|
private OverlayController overlayController;
|
||||||
private final OrderBook orderBook;
|
private final OrderBook orderBook;
|
||||||
private final OrderBookFilter orderBookFilter;
|
private OrderBookInfo orderBookInfo;
|
||||||
private final User user;
|
private final User user;
|
||||||
private final MessageFacade messageFacade;
|
private final MessageFacade messageFacade;
|
||||||
private final WalletFacade walletFacade;
|
private final WalletFacade walletFacade;
|
||||||
|
@ -130,8 +130,6 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
this.walletFacade = walletFacade;
|
this.walletFacade = walletFacade;
|
||||||
this.settings = settings;
|
this.settings = settings;
|
||||||
this.persistence = persistence;
|
this.persistence = persistence;
|
||||||
|
|
||||||
this.orderBookFilter = new OrderBookFilter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -186,11 +184,13 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Private
|
// Public methods
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private void init() {
|
public void initOrderBook(Direction direction, OrderBookInfo orderBookInfo) {
|
||||||
|
this.orderBookInfo = orderBookInfo;
|
||||||
orderBook.init();
|
orderBook.init();
|
||||||
offerList = orderBook.getOfferList();
|
offerList = orderBook.getOfferList();
|
||||||
offerList.comparatorProperty().bind(orderBookTable.comparatorProperty());
|
offerList.comparatorProperty().bind(orderBookTable.comparatorProperty());
|
||||||
|
@ -202,16 +202,16 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
|
|
||||||
// handlers
|
// handlers
|
||||||
amount.textProperty().addListener((observable, oldValue, newValue) -> {
|
amount.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
orderBookFilter.setAmount(BSFormatter.parseToCoin(newValue));
|
orderBookInfo.setAmount(BSFormatter.parseToCoin(newValue));
|
||||||
updateVolume();
|
updateVolume();
|
||||||
});
|
});
|
||||||
|
|
||||||
price.textProperty().addListener((observable, oldValue, newValue) -> {
|
price.textProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
orderBookFilter.setPrice(BSFormatter.parseToFiat(newValue));
|
orderBookInfo.setPrice(BSFormatter.parseToFiat(newValue));
|
||||||
updateVolume();
|
updateVolume();
|
||||||
});
|
});
|
||||||
|
|
||||||
orderBookFilter.getDirectionChangedProperty().addListener((observable) -> applyOffers());
|
orderBookInfo.directionProperty().addListener((observable) -> applyOffers());
|
||||||
|
|
||||||
user.currentBankAccountProperty().addListener((ov) -> orderBook.loadOffers());
|
user.currentBankAccountProperty().addListener((ov) -> orderBook.loadOffers());
|
||||||
|
|
||||||
|
@ -219,18 +219,9 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
|
|
||||||
//TODO do polling until broadcast works
|
//TODO do polling until broadcast works
|
||||||
setupPolling();
|
setupPolling();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Public methods
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
public void initOrderBook(Direction direction) {
|
|
||||||
init();
|
|
||||||
orderBookTable.getSelectionModel().clearSelection();
|
orderBookTable.getSelectionModel().clearSelection();
|
||||||
price.setText("");
|
price.setText("");
|
||||||
orderBookFilter.setDirection(direction);
|
this.orderBookInfo.setDirection(direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,7 +246,7 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nextController != null)
|
if (nextController != null)
|
||||||
((CreateOfferViewCB) nextController).setOrderBookFilter(orderBookFilter);
|
((CreateOfferViewCB) nextController).setOrderBookFilter(orderBookInfo);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
openSetupScreen();
|
openSetupScreen();
|
||||||
|
@ -358,9 +349,9 @@ public class OrderBookViewCB extends CachedViewCB<OrderBookPM> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void applyOffers() {
|
private void applyOffers() {
|
||||||
orderBook.applyFilter(orderBookFilter);
|
orderBook.applyFilter(orderBookInfo);
|
||||||
|
|
||||||
priceColumn.setSortType((orderBookFilter.getDirection() == Direction.BUY) ?
|
priceColumn.setSortType((orderBookInfo.getDirection() == Direction.BUY) ?
|
||||||
TableColumn.SortType.ASCENDING : TableColumn.SortType.DESCENDING);
|
TableColumn.SortType.ASCENDING : TableColumn.SortType.DESCENDING);
|
||||||
orderBookTable.sort();
|
orderBookTable.sort();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue