| Revision 5048,
1.1 KB
checked in by akks, 2 months ago
(diff) |
|
fix #7429 - Shortcut redefinition in Save As feature
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others |
|---|
| 2 | package org.openstreetmap.josm.actions; |
|---|
| 3 | |
|---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr; |
|---|
| 5 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht; |
|---|
| 6 | |
|---|
| 7 | import java.awt.event.KeyEvent; |
|---|
| 8 | import java.io.File; |
|---|
| 9 | |
|---|
| 10 | import org.openstreetmap.josm.gui.layer.Layer; |
|---|
| 11 | import org.openstreetmap.josm.tools.Shortcut; |
|---|
| 12 | |
|---|
| 13 | /** |
|---|
| 14 | * Export the data. |
|---|
| 15 | * |
|---|
| 16 | * @author imi |
|---|
| 17 | */ |
|---|
| 18 | public class SaveAsAction extends SaveActionBase { |
|---|
| 19 | private static SaveAsAction instance = new SaveAsAction(); |
|---|
| 20 | |
|---|
| 21 | /** |
|---|
| 22 | * Construct the action with "Save" as label. |
|---|
| 23 | * @param layer Save this layer. |
|---|
| 24 | */ |
|---|
| 25 | public SaveAsAction() { |
|---|
| 26 | super(tr("Save As..."), "save_as", tr("Save the current data to a new file."), |
|---|
| 27 | Shortcut.registerShortcut("system:saveas", tr("File: {0}", tr("Save As...")), |
|---|
| 28 | KeyEvent.VK_S, Shortcut.CTRL_SHIFT)); |
|---|
| 29 | putValue("help", ht("/Action/SaveAs")); |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | public static SaveAsAction getInstance() { |
|---|
| 33 | return instance; |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | @Override protected File getFile(Layer layer) { |
|---|
| 37 | return openFileDialog(layer); |
|---|
| 38 | } |
|---|
| 39 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.