source: josm/trunk/src/org/openstreetmap/josm/actions/UnselectAllAction.java@ 1728

Last change on this file since 1728 was 1169, checked in by stoecker, 15 years ago

removed usage of tab stops

  • Property svn:eol-style set to native
File size: 1.7 KB
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.KeyEvent;
8import javax.swing.JComponent;
9
10import org.openstreetmap.josm.Main;
11import org.openstreetmap.josm.tools.Shortcut;
12
13public class UnselectAllAction extends JosmAction {
14
15 public UnselectAllAction() {
16 super(tr("Unselect All"), "unselectall", tr("Unselect all objects."),
17 Shortcut.registerShortcut("edit:unselectall", tr("Edit: {0}", tr("Unselect All")), KeyEvent.VK_U, Shortcut.GROUP_EDIT), true);
18 // this is not really GROUP_EDIT, but users really would complain if the yhad to reconfigure because we put
19 // the correct group in
20
21 // Add extra shortcut C-S-a
22 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
23 Shortcut.registerShortcut("edit:unselectallfocus", tr("Edit: {0}", tr("Unselect All (Focus)")),
24 KeyEvent.VK_A, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT).getKeyStroke(),
25 tr("Unselect All"));
26
27 // Add extra shortcut ESCAPE
28 /*
29 * FIXME: this isn't optimal. In a better world the mapmode actions
30 * would be able to capture keyboard events and react accordingly. But
31 * for now this is a reasonable approximation.
32 */
33 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
34 Shortcut.registerShortcut("edit:unselectallescape", tr("Edit: {0}", tr("Unselect All (Escape)")),
35 KeyEvent.VK_ESCAPE, Shortcut.GROUP_DIRECT).getKeyStroke(),
36 tr("Unselect All"));
37 }
38
39 public void actionPerformed(ActionEvent e) {
40 Main.ds.setSelected();
41 }
42}
Note: See TracBrowser for help on using the repository browser.