Browse Source

Merge pull request #7542 in DESIGN/design from final/10.0 to release/10.0

* commit '39ebb98721848505e604102bb0062b1be65a0d48':
  REPORT-65722 【冒烟】 计器点击选择按钮控件图标时无反应,没有出现原生文件选择器弹窗
security/10.0
superman 3 years ago
parent
commit
ae7f4d0f79
  1. 21
      designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

21
designer-base/src/main/java/com/fr/design/gui/ifilechooser/JavaFxNativeFileChooser.java

@ -197,7 +197,9 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
private File currentDirectory; private File currentDirectory;
public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) { public Builder fileSelectionMode(FileSelectionMode fileSelectionMode) {
this.fileSelectionMode = fileSelectionMode; if (fileSelectionMode != null) {
this.fileSelectionMode = fileSelectionMode;
}
return this; return this;
} }
@ -209,20 +211,17 @@ public class JavaFxNativeFileChooser implements FileChooserProvider {
} }
public Builder filters(FileChooser.ExtensionFilter[] filters) { public Builder filters(FileChooser.ExtensionFilter[] filters) {
this.filters = filters; if (filters != null) {
return this; this.filters = filters;
}
public Builder filters(ExtensionFilter[] filters) {
for (ExtensionFilter filter : filters) {
this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions()));
} }
return this; return this;
} }
public Builder filter(String des, String... extensions) { public Builder filters(ExtensionFilter[] filters) {
if (extensions != null) { if (filters != null) {
this.filters = new FileChooser.ExtensionFilter[]{new FileChooser.ExtensionFilter(des, extensions)}; for (ExtensionFilter filter : filters) {
this.filters = ArrayUtils.add(this.filters, new FileChooser.ExtensionFilter(filter.getDes(), filter.getExtensions()));
}
} }
return this; return this;
} }

Loading…
Cancel
Save