mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Sort payment methods by display string not by id.
Apply sorting in drop down boxes.
This commit is contained in:
parent
7d12b94c6a
commit
5c68ad0b47
3 changed files with 3 additions and 1 deletions
|
@ -332,7 +332,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable<Payme
|
|||
|
||||
@Override
|
||||
public int compareTo(@NotNull PaymentMethod other) {
|
||||
return id.compareTo(other.id);
|
||||
return Res.get(id).compareTo(Res.get(other.id));
|
||||
}
|
||||
|
||||
public String getDisplayString() {
|
||||
|
|
|
@ -385,6 +385,7 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
|
|||
paymentMethodComboBox.setPrefWidth(250);
|
||||
List<PaymentMethod> list = PaymentMethod.getPaymentMethods().stream()
|
||||
.filter(paymentMethod -> !paymentMethod.isAsset())
|
||||
.sorted()
|
||||
.collect(Collectors.toList());
|
||||
paymentMethodComboBox.setItems(FXCollections.observableArrayList(list));
|
||||
paymentMethodComboBox.setConverter(new StringConverter<>() {
|
||||
|
|
|
@ -343,6 +343,7 @@ class OfferBookViewModel extends ActivatableViewModel {
|
|||
|
||||
ObservableList<PaymentMethod> getPaymentMethods() {
|
||||
ObservableList<PaymentMethod> list = FXCollections.observableArrayList(PaymentMethod.getPaymentMethods());
|
||||
list.sort(Comparator.naturalOrder());
|
||||
list.add(0, PaymentMethod.getDummyPaymentMethod(GUIUtil.SHOW_ALL_FLAG));
|
||||
return list;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue