source: josm/trunk/src/org/openstreetmap/josm/actions/InfoAction.java@ 13243

Last change on this file since 13243 was 12672, checked in by Don-vip, 7 years ago

see #15182 - move ConflictCollection from OsmDataLayer to DataSet. Simplifies some code where a data set is enough, and a layer is not needed

  • Property svn:eol-style set to native
File size: 1.6 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;
9import java.util.Collection;
10
11import org.openstreetmap.josm.data.osm.DataSet;
12import org.openstreetmap.josm.data.osm.OsmPrimitive;
13import org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDialog;
14import org.openstreetmap.josm.tools.Shortcut;
15
16/**
17 * Display advanced object information about OSM nodes, ways, or relations.
18 * @since 1697
19 */
20public class InfoAction extends JosmAction {
21
22 /**
23 * Constructs a new {@code InfoAction}.
24 */
25 public InfoAction() {
26 super(tr("Advanced info"), "info",
27 tr("Display advanced object information about OSM nodes, ways, or relations."),
28 Shortcut.registerShortcut("core:info",
29 tr("Advanced info"), KeyEvent.VK_I, Shortcut.CTRL),
30 true, "action/info", true);
31 putValue("help", ht("/Action/InfoAboutElements"));
32 }
33
34 @Override
35 public void actionPerformed(ActionEvent ae) {
36 DataSet set = getLayerManager().getEditDataSet();
37 if (set != null) {
38 new InspectPrimitiveDialog(set.getAllSelected(), set).showDialog();
39 }
40 }
41
42 @Override
43 public void updateEnabledState() {
44 updateEnabledStateOnCurrentSelection();
45 }
46
47 @Override
48 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
49 setEnabled(!selection.isEmpty());
50 }
51}
Note: See TracBrowser for help on using the repository browser.