Last change
on this file since 9242 was 9059, checked in by Don-vip, 8 years ago |
checkstyle
|
-
Property svn:eol-style
set to
native
|
File size:
1.1 KB
|
Line | |
---|
1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
6 |
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 | import java.awt.event.KeyEvent;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
11 |
|
---|
12 | public class UnselectAllAction extends JosmAction {
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Constructs a new {@code UnselectAllAction}.
|
---|
16 | */
|
---|
17 | public UnselectAllAction() {
|
---|
18 | super(tr("Unselect All"), "unselectall", tr("Unselect all objects."),
|
---|
19 | Shortcut.registerShortcut("edit:unselectall", tr("Edit: {0}",
|
---|
20 | tr("Unselect All")), KeyEvent.VK_ESCAPE, Shortcut.DIRECT), true);
|
---|
21 |
|
---|
22 | putValue("help", ht("/Action/UnselectAll"));
|
---|
23 | }
|
---|
24 |
|
---|
25 | @Override
|
---|
26 | public void actionPerformed(ActionEvent e) {
|
---|
27 | if (!isEnabled())
|
---|
28 | return;
|
---|
29 | getCurrentDataSet().setSelected();
|
---|
30 | }
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * Refreshes the enabled state
|
---|
34 | */
|
---|
35 | @Override
|
---|
36 | protected void updateEnabledState() {
|
---|
37 | setEnabled(getEditLayer() != null);
|
---|
38 | }
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.