source: josm/trunk/src/org/openstreetmap/josm/actions/SelectAllAction.java@ 8961

Last change on this file since 8961 was 8510, checked in by Don-vip, 9 years ago

checkstyle: enable relevant whitespace checks and fix them

  • Property svn:eol-style set to native
File size: 1.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions;
3
4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
5import static org.openstreetmap.josm.tools.I18n.tr;
6
7import java.awt.event.ActionEvent;
8import java.awt.event.KeyEvent;
9
10import org.openstreetmap.josm.tools.Shortcut;
11
12public class SelectAllAction extends JosmAction {
13
14 /**
15 * Constructs a new {@code SelectAllAction}.
16 */
17 public SelectAllAction() {
18 super(tr("Select All"), "selectall", tr("Select all undeleted objects in the data layer. This selects incomplete objects too."),
19 Shortcut.registerShortcut("system:selectall", tr("Edit: {0}", tr("Select All")), KeyEvent.VK_A, Shortcut.CTRL), true);
20 putValue("help", ht("/Action/SelectAll"));
21 }
22
23 @Override
24 public void actionPerformed(ActionEvent e) {
25 if (!isEnabled())
26 return;
27 getCurrentDataSet().setSelected(getCurrentDataSet().allNonDeletedCompletePrimitives());
28 }
29
30 /**
31 * Refreshes the enabled state
32 *
33 */
34 @Override
35 protected void updateEnabledState() {
36 setEnabled(getEditLayer() != null);
37 }
38}
Note: See TracBrowser for help on using the repository browser.