source: josm/trunk/src/org/openstreetmap/josm/actions/UndoAction.java@ 1023

Last change on this file since 1023 was 1023, checked in by stoecker, 16 years ago

close bug #1622. Keyboard shortcuts and specific OS handling

  • Property svn:eol-style set to native
File size: 845 bytes
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.actions;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import java.awt.event.ActionEvent;
7import java.awt.event.InputEvent;
8import java.awt.event.KeyEvent;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.tools.ShortCut;
12
13/**
14 * Undoes the last command.
15 *
16 * @author imi
17 */
18public class UndoAction extends JosmAction {
19
20 /**
21 * Construct the action with "Undo" as label.
22 */
23 public UndoAction() {
24 super(tr("Undo"), "undo", tr("Undo the last action."),
25 ShortCut.registerShortCut("system:undo", tr("Edit: Undo"), KeyEvent.VK_Z, ShortCut.GROUP_MENU), true);
26 setEnabled(false);
27 }
28
29 public void actionPerformed(ActionEvent e) {
30 if (Main.map == null)
31 return;
32 Main.map.repaint();
33 Main.main.undoRedo.undo();
34 }
35}
Note: See TracBrowser for help on using the repository browser.