Package org.openstreetmap.josm.actions

Examples of org.openstreetmap.josm.actions.ExtensionFileFilter


public class GpxImporter extends FileImporter {
  private GpxData lastData;

  public GpxImporter() {
    super(new ExtensionFileFilter("gpx,gpx.gz", "gpx", tr("GPX Files")
        + " (*.gpx *.gpx.gz)"));
  }
 
View Full Code Here


            @Override
            public void actionPerformed(ActionEvent e) {
                FileFilter ff;
                switch (sourceType) {
                case MAP_PAINT_STYLE:
                    ff = new ExtensionFileFilter("xml,mapcss,css,zip", "xml", tr("Map paint style file (*.xml, *.mapcss, *.zip)"));
                    break;
                case TAGGING_PRESET:
                    ff = new ExtensionFileFilter("xml,zip", "xml", tr("Preset definition file (*.xml, *.zip)"));
                    break;
                case TAGCHECKER_RULE:
                    ff = new ExtensionFileFilter("validator.mapcss,zip", "validator.mapcss", tr("Tag checker rule (*.validator.mapcss, *.zip)"));
                    break;
                default:
                    Main.error("Unsupported source type: "+sourceType);
                    return;
                }
View Full Code Here

            JFileChooserManager fcm = new JFileChooserManager(false, "mappaint.clone-style.lastDirectory", System.getProperty("user.home"));
            String suggestion = fcm.getInitialDirectory() + File.separator + s.getFileNamePart();

            FileFilter ff;
            if (s instanceof MapCSSStyleSource) {
                ff = new ExtensionFileFilter("mapcss,css,zip", "mapcss", tr("Map paint style file (*.mapcss, *.zip)"));
            } else {
                ff = new ExtensionFileFilter("xml,zip", "xml", tr("Map paint style file (*.xml, *.zip)"));
            }
            fcm.createFileChooser(false, null, Arrays.asList(ff, FileFilterAllFiles.getInstance()), ff, JFileChooser.FILES_ONLY)
                    .getFileChooser().setSelectedFile(new File(suggestion));
            JFileChooser fc = fcm.openFileChooser();
            if (fc == null)
View Full Code Here

/**
* Dummy importer that adds the "All Formats"-Filter when opening files
*/
public class AllFormatsImporter extends FileImporter {
    public AllFormatsImporter() {
        super(new ExtensionFileFilter(getAllExtensions(), "", tr("All Formats")
                + " (*.gpx *.osm *.nmea *.jpg ...)"));
    }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.actions.ExtensionFileFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.