001// License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.actions;
003
004import static org.openstreetmap.josm.tools.I18n.tr;
005import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
006
007import java.awt.event.KeyEvent;
008import java.io.File;
009
010import org.openstreetmap.josm.gui.layer.Layer;
011import org.openstreetmap.josm.tools.Shortcut;
012
013/**
014 * Export the data.
015 *
016 * @author imi
017 */
018public class SaveAsAction extends SaveActionBase {
019    private static SaveAsAction instance = new SaveAsAction();
020
021    /**
022     * Construct the action with "Save" as label.
023     */
024    public SaveAsAction() {
025        super(tr("Save As..."), "save_as", tr("Save the current data to a new file."),
026            Shortcut.registerShortcut("system:saveas", tr("File: {0}", tr("Save As...")),
027            KeyEvent.VK_S, Shortcut.CTRL_SHIFT));
028        putValue("help", ht("/Action/SaveAs"));
029    }
030
031    public static SaveAsAction getInstance() {
032        return instance;
033    }
034
035    @Override protected File getFile(Layer layer) {
036        return layer.createAndOpenSaveFileChooser();
037    }
038}