From 0c2639a87b2930cc0eff29d31cf31bf00987becb Mon Sep 17 00:00:00 2001 From: lusarz Date: Fri, 15 Nov 2019 12:30:27 +0100 Subject: [PATCH] Extract setupFieldFromPaymentAccountFiltersList method in FilterWindow --- .../main/overlays/windows/FilterWindow.java | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java index 8f4943734d..23ee00f4fa 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/FilterWindow.java @@ -150,22 +150,7 @@ public class FilterWindow extends Overlay { if (filter != null) { setupFieldFromList(offerIdsInputTextField, filter.getBannedOfferIds()); setupFieldFromList(nodesInputTextField, filter.getBannedNodeAddress()); - - if (filter.getBannedPaymentAccounts() != null) { - StringBuilder sb = new StringBuilder(); - filter.getBannedPaymentAccounts().stream().forEach(e -> { - if (e != null && e.getPaymentMethodId() != null) { - sb.append(e.getPaymentMethodId()) - .append("|") - .append(e.getGetMethodName()) - .append("|") - .append(e.getValue()) - .append(", "); - } - }); - paymentAccountFilterInputTextField.setText(sb.toString()); - } - + setupFieldFromPaymentAccountFiltersList(paymentAccountFilterInputTextField, filter.getBannedPaymentAccounts()); setupFieldFromList(bannedCurrenciesInputTextField, filter.getBannedCurrencies()); setupFieldFromList(bannedPaymentMethodsInputTextField, filter.getBannedPaymentMethods()); setupFieldFromList(arbitratorsInputTextField, filter.getArbitrators()); @@ -174,9 +159,7 @@ public class FilterWindow extends Overlay { setupFieldFromList(seedNodesInputTextField, filter.getSeedNodes()); setupFieldFromList(priceRelayNodesInputTextField, filter.getPriceRelayNodes()); setupFieldFromList(btcNodesInputTextField, filter.getBtcNodes()); - preventPublicBtcNetworkCheckBox.setSelected(filter.isPreventPublicBtcNetwork()); - disableDaoCheckBox.setSelected(filter.isDisableDao()); disableDaoBelowVersionInputTextField.setText(filter.getDisableDaoBelowVersion()); disableTradeBelowVersionInputTextField.setText(filter.getDisableTradeBelowVersion()); @@ -234,6 +217,24 @@ public class FilterWindow extends Overlay { field.setText(values.stream().collect(Collectors.joining(", "))); } + private void setupFieldFromPaymentAccountFiltersList(InputTextField field, List values) { + if (values != null) { + StringBuilder sb = new StringBuilder(); + values.stream().forEach(e -> { + if (e != null && e.getPaymentMethodId() != null) { + sb + .append(e.getPaymentMethodId()) + .append("|") + .append(e.getGetMethodName()) + .append("|") + .append(e.getValue()) + .append(", "); + } + }); + field.setText(sb.toString()); + } + } + private List readAsList(InputTextField field) { if (field.getText().isEmpty()) { return Collections.emptyList();