* fix FileChooser issues

@see https://www.filebot.net/forums/viewtopic.php?f=6&t=2165&p=12432#p12432
This commit is contained in:
Reinhard Pointner 2014-11-07 16:43:19 +00:00
parent 2676762686
commit f1ddcb3e7e
2 changed files with 5 additions and 3 deletions

View File

@ -98,7 +98,9 @@ public class MediaTypes {
public static ExtensionFileFilter combineFilter(ExtensionFileFilter... filters) {
List<String> extensions = new ArrayList<String>();
for (ExtensionFileFilter it : filters) {
addAll(extensions, it.extensions());
if (!it.acceptAny()) {
addAll(extensions, it.extensions());
}
}
return new ExtensionFileFilter(extensions);
}

View File

@ -112,7 +112,7 @@ public class UserFiles {
}
}
if (filter != null) {
if (filter != null && !filter.acceptAny()) {
chooser.setFileFilter(new javax.swing.filechooser.FileNameExtensionFilter(filter.toString(), filter.extensions()));
}
@ -259,7 +259,7 @@ public class UserFiles {
// show FileChooser
javafx.stage.FileChooser fileChooser = new javafx.stage.FileChooser();
fileChooser.setTitle(title);
if (filter != null) {
if (filter != null && !filter.acceptAny()) {
String[] globFilter = filter.extensions();
for (int i = 0; i < globFilter.length; i++) {
globFilter[i] = "*." + globFilter[i];