mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 09:52:23 +01:00
Extract setupFieldFromPaymentAccountFiltersList method in FilterWindow
This commit is contained in:
parent
415648e257
commit
0c2639a87b
@ -150,22 +150,7 @@ public class FilterWindow extends Overlay<FilterWindow> {
|
||||
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<FilterWindow> {
|
||||
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<FilterWindow> {
|
||||
field.setText(values.stream().collect(Collectors.joining(", ")));
|
||||
}
|
||||
|
||||
private void setupFieldFromPaymentAccountFiltersList(InputTextField field, List<PaymentAccountFilter> 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<String> readAsList(InputTextField field) {
|
||||
if (field.getText().isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
|
Loading…
Reference in New Issue
Block a user