Changeset 5131 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2012-03-29T22:37:42+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/AllFormatsImporter.java
r4533 r5131 5 5 6 6 import java.io.File; 7 import java.util.Iterator; 7 8 8 9 import org.openstreetmap.josm.actions.ExtensionFileFilter; … … 13 14 public class AllFormatsImporter extends FileImporter { 14 15 public AllFormatsImporter() { 15 super(new ExtensionFileFilter( "osm,xml,osm.gz,osm.bz2,osm.bz,osc,gpx,gpx.gz,nmea,nme,nma,log,txt,wms,jpg", "", tr("All Formats")16 16 super(new ExtensionFileFilter(getAllExtensions(), "", tr("All Formats") 17 + " (*.gpx *.osm *.nmea *.jpg ...)")); 17 18 } 19 18 20 @Override public boolean acceptFile(File pathname) { 19 21 return false; 20 22 } 23 24 /** 25 * Builds list of all supported extensions by the registered FileImporters. 26 * @return String comma separated list of supported file extensions 27 */ 28 private static String getAllExtensions() { 29 Iterator<FileImporter> imp = ExtensionFileFilter.importers.iterator(); 30 StringBuilder ext = new StringBuilder(); 31 while(imp.hasNext()) { 32 FileImporter fi = imp.next(); 33 if(fi instanceof AllFormatsImporter) { 34 continue; 35 } 36 ext.append(fi.filter.getExtensions()); 37 ext.append(","); 38 } 39 // remove last comma 40 return ext.substring(0, ext.length()-1).toString(); 41 } 21 42 }
Note:
See TracChangeset
for help on using the changeset viewer.