Changeset 2020 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-08-31T09:40:29+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DiskAccessAction.java
r2001 r2020 24 24 25 25 public static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title) { 26 return createAndOpenFileChooser(open, multiple, title, null); 27 } 28 29 public static JFileChooser createAndOpenFileChooser(boolean open, boolean multiple, String title, String extension) { 26 30 String curDir = Main.pref.get("lastDirectory"); 27 31 if (curDir.equals("")) { … … 38 42 for (FileImporter imExporter: ExtensionFileFilter.importers) { 39 43 fc.addChoosableFileFilter(imExporter.filter); 40 if ( imExporter instanceof ExtensionFileFilter.AllFormatsImporter) {44 if (extension != null && extension.endsWith(imExporter.filter.defaultExtension)) { 41 45 defaultFilter = imExporter.filter; 42 46 } 43 44 47 } 45 48 46 if (defaultFilter != null) {47 fc.setFileFilter(defaultFilter);49 if (defaultFilter == null) { 50 defaultFilter = new ExtensionFileFilter.AllFormatsImporter().filter; 48 51 } 49 52 fc.setFileFilter(defaultFilter); 50 53 51 54 int answer = open ? fc.showOpenDialog(Main.parent) : fc.showSaveDialog(Main.parent);
Note:
See TracChangeset
for help on using the changeset viewer.