Last change
on this file since 2100 was 1820, checked in by Gubaer, 15 years ago |
JosmAction is now a LayerChangeListener and a SelectionChangeListener
updated all JosmActions
fixed #3018: Make sure tools menu entries (and actions) are deactivated when no layer
|
-
Property svn:eol-style
set to
native
|
File size:
1004 bytes
|
Rev | Line | |
---|
[298] | 1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
[626] | 2 | package org.openstreetmap.josm.actions;
|
---|
| 3 |
|
---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
| 5 |
|
---|
| 6 | import java.awt.event.ActionEvent;
|
---|
| 7 | import java.awt.event.KeyEvent;
|
---|
| 8 |
|
---|
| 9 | import org.openstreetmap.josm.Main;
|
---|
[1084] | 10 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
[626] | 11 |
|
---|
| 12 | /**
|
---|
| 13 | * Redoes the last command.
|
---|
[1023] | 14 | *
|
---|
[626] | 15 | * @author imi
|
---|
| 16 | */
|
---|
| 17 | public class RedoAction extends JosmAction {
|
---|
| 18 |
|
---|
[1169] | 19 | /**
|
---|
| 20 | * Construct the action with "Redo" as label.
|
---|
| 21 | */
|
---|
| 22 | public RedoAction() {
|
---|
| 23 | super(tr("Redo"), "redo", tr("Redo the last undone action."),
|
---|
[1820] | 24 | Shortcut.registerShortcut("system:redo", tr("Edit: {0}", tr("Redo")), KeyEvent.VK_Y, Shortcut.GROUP_MENU), true);
|
---|
[1169] | 25 | setEnabled(false);
|
---|
| 26 | }
|
---|
[626] | 27 |
|
---|
[1169] | 28 | public void actionPerformed(ActionEvent e) {
|
---|
| 29 | if (Main.map == null)
|
---|
| 30 | return;
|
---|
| 31 | Main.map.repaint();
|
---|
| 32 | Main.main.undoRedo.redo();
|
---|
| 33 | }
|
---|
[1820] | 34 |
|
---|
| 35 | @Override
|
---|
| 36 | protected void updateEnabledState() {
|
---|
| 37 | setEnabled(Main.map != null);
|
---|
| 38 | }
|
---|
[626] | 39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.