From 7d0d89bd1a08c484a408bffcbac64bd958d2e8d6 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 11 Jan 2022 19:25:30 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-65722=20=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=20=E8=AE=A1=E5=99=A8=E7=82=B9=E5=87=BB=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=8C=89=E9=92=AE=E6=8E=A7=E4=BB=B6=E5=9B=BE=E6=A0=87?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E5=8F=8D=E5=BA=94=EF=BC=8C=E6=B2=A1=E6=9C=89?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E5=8E=9F=E7=94=9F=E6=96=87=E4=BB=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E5=99=A8=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ifilechooser/JavaFxNativeFileChooser.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java index 4d3688324..855a1357f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java +++ b/designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java @@ -197,7 +197,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { private File currentDirectory; public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) { - this.fileSelectionMode = fileSelectionMode; + if (fileSelectionMode != null) { + this.fileSelectionMode = fileSelectionMode; + } return this; } @@ -209,20 +211,17 @@ public class JavaFxNativeFileChooser implements FileChooserProvider { } public Builder filters(FileChooser.ExtensionFilter[] filters) { - this.filters = filters; - return this; - } - - public Builder filters(ExtensionFilter[] filters) { - for (ExtensionFilter filter : filters) { - this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions())); + if (filters != null) { + this.filters = filters; } return this; } - public Builder filter(String des, String... extensions) { - if (extensions != null) { - this.filters = new FileChooser.ExtensionFilter[]{new FileChooser.ExtensionFilter(des, extensions)}; + public Builder filters(ExtensionFilter[] filters) { + if (filters != null) { + for (ExtensionFilter filter : filters) { + this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions())); + } } return this; }