Changeset 11004 in josm for trunk


Ignore:
Timestamp:
2016-09-15T21:40:33+02:00 (3 years ago)
Author:
simon04
Message:

fix #13414 - Allow non-default file formats with native file chooser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java

    r10931 r11004  
    77import java.io.File;
    88import java.io.FilenameFilter;
     9import java.util.ArrayList;
     10import java.util.List;
    911
    1012import javax.swing.JFileChooser;
     
    2426    private final FileDialog fileDialog;
    2527    private FileFilter fileFilter;
     28    private List<FileFilter> fileFilters = new ArrayList<>();
    2629    private int selectionMode;
    2730
     
    4548        // https://bugs.openjdk.java.net/browse/JDK-4811090 : Extend awt filedialog
    4649        // https://bugs.openjdk.java.net/browse/JDK-6192906 : Add more features to java.awt.FileDialog
     50        fileFilters.add(filter);
    4751    }
    4852
     
    5256        // https://bugs.openjdk.java.net/browse/JDK-4811090 : Extend awt filedialog
    5357        // https://bugs.openjdk.java.net/browse/JDK-6192906 : Add more features to java.awt.FileDialog
    54         return new FileFilter[]{};
     58        return fileFilters.toArray(new FileFilter[0]);
    5559    }
    5660
Note: See TracChangeset for help on using the changeset viewer.