Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java 10 support #1660

Merged
merged 21 commits into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
9b4b062
Clean up errors for testing
ripcurlx Aug 21, 2018
4725191
Remove files that use classes that can't be accessed anymore
ripcurlx Sep 5, 2018
73e4ee5
Update lombok library
ripcurlx Sep 5, 2018
bd9a208
Update source compatibility to Java 10
ripcurlx Sep 7, 2018
5d23971
Update travis Java version
ripcurlx Sep 7, 2018
e319449
Make power mock tests Java 10 compatibile
ripcurlx Sep 7, 2018
8ed7f42
Add not working JMockit setup (help wanted)
ripcurlx Sep 7, 2018
13266b2
Use FXCollections instead of not existing ObservableListWrapper
ripcurlx Sep 7, 2018
dd6a372
Change progress indicator skin to work with Java 9+
ripcurlx Sep 10, 2018
2efe20a
Add temporary workaround for running desktop build
ripcurlx Sep 11, 2018
672e362
Add -srcdir for Java 10 javapackager
ripcurlx Sep 11, 2018
64370f7
Fix JMockit setup
ripcurlx Sep 13, 2018
1c783e4
Update fontawesome library
ripcurlx Sep 14, 2018
4c068af
Use default security provider instead of Bouncy Castle
ripcurlx Sep 14, 2018
40eadcc
Merge branch 'master' into java10-support
ripcurlx Sep 14, 2018
28c96d6
Merge branch 'master' of github.com:bisq-network/bisq-desktop into ja…
ripcurlx Sep 15, 2018
68fb116
Add Java 10 configuration for merged repositories
ripcurlx Sep 17, 2018
a8dd11c
Add workaround to prevent javapackager to fail because of module conf…
ripcurlx Sep 18, 2018
f7e4e5a
Add missing result handler execution
ripcurlx Sep 18, 2018
0643357
Clear list before setting all currencies
ripcurlx Sep 18, 2018
db17991
Remove not thrown exceptions
ripcurlx Sep 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ protected void activate() {
}
});

model.currencyListItems.addListener(currencyListItemsListener);
model.currencyListItems.getObservableList().addListener(currencyListItemsListener);

model.getOfferBookListItems().addListener(changeListener);
tradeCurrencySubscriber = EasyBind.subscribe(model.selectedTradeCurrencyProperty,
Expand Down Expand Up @@ -295,7 +295,7 @@ public Number fromString(String string) {
protected void deactivate() {
model.getOfferBookListItems().removeListener(changeListener);
tabPaneSelectionModel.selectedIndexProperty().removeListener(selectedTabIndexListener);
model.currencyListItems.removeListener(currencyListItemsListener);
model.currencyListItems.getObservableList().removeListener(currencyListItemsListener);
tradeCurrencySubscriber.unsubscribe();
currencyComboBox.setOnAction(null);
buyOfferTableView.getSelectionModel().selectedItemProperty().removeListener(buyTableRowSelectionListener);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ public ObservableList<OfferListItem> getTopSellOfferList() {
}

public ObservableList<CurrencyListItem> getCurrencyListItems() {
return currencyListItems;
return currencyListItems.getObservableList();
}

public Optional<CurrencyListItem> getSelectedCurrencyListItem() {
return currencyListItems.stream().filter(e -> e.tradeCurrency.equals(selectedTradeCurrencyProperty.get())).findAny();
return currencyListItems.getObservableList().stream().filter(e -> e.tradeCurrency.equals(selectedTradeCurrencyProperty.get())).findAny();
}

public int getMaxNumberOfPriceZeroDecimalsToColorize(Offer offer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,11 @@ public String getCurrencyCode() {
}

public ObservableList<CurrencyListItem> getCurrencyListItems() {
return currencyListItems;
return currencyListItems.getObservableList();
}

public Optional<CurrencyListItem> getSelectedCurrencyListItem() {
return currencyListItems.stream().filter(e -> e.tradeCurrency.equals(selectedTradeCurrencyProperty.get())).findAny();
return currencyListItems.getObservableList().stream().filter(e -> e.tradeCurrency.equals(selectedTradeCurrencyProperty.get())).findAny();
}

///////////////////////////////////////////////////////////////////////////////////////////
Expand Down
16 changes: 11 additions & 5 deletions desktop/src/main/java/bisq/desktop/util/CurrencyList.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

import com.google.common.collect.Lists;

import com.sun.javafx.collections.ObservableListWrapper;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

import java.util.ArrayList;
import java.util.Comparator;
Expand All @@ -36,25 +37,30 @@

import javax.annotation.Nullable;

public class CurrencyList extends ObservableListWrapper<CurrencyListItem> {
public class CurrencyList {
private final CurrencyPredicates predicates;
private final Preferences preferences;
private final List<CurrencyListItem> delegate;

public CurrencyList(Preferences preferences) {
this(new ArrayList<>(), preferences, new CurrencyPredicates());
}

CurrencyList(List<CurrencyListItem> delegate, Preferences preferences, CurrencyPredicates predicates) {
super(delegate);
public CurrencyList(List<CurrencyListItem> delegate, Preferences preferences, CurrencyPredicates predicates) {
this.delegate = delegate;
this.predicates = predicates;
this.preferences = preferences;
}

public ObservableList<CurrencyListItem> getObservableList() {
return FXCollections.observableList(delegate);
}

public void updateWithCurrencies(List<TradeCurrency> currencies, @Nullable CurrencyListItem first) {
List<CurrencyListItem> result = Lists.newLinkedList();
Optional.ofNullable(first).ifPresent(result::add);
result.addAll(getPartitionedSortedItems(currencies));
setAll(result);
delegate.addAll(result);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have the same behaviour as before (setAll) we should add a clear() before the addAll.

}

private List<CurrencyListItem> getPartitionedSortedItems(List<TradeCurrency> currencies) {
Expand Down