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

Last change on this file since 13434 was 13434, checked in by Don-vip, 6 years ago

see #8039, see #10456 - support read-only data layers

  • Property svn:eol-style set to native
File size: 1.6 KB
RevLine 
[6336]1// License: GPL. For details, see LICENSE file.
[2512]2package org.openstreetmap.josm.actions;
3
[7859]4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
[2512]5import static org.openstreetmap.josm.tools.I18n.tr;
6
[7859]7import java.awt.event.ActionEvent;
[2512]8import java.awt.event.KeyEvent;
[7859]9import java.util.Collection;
[2512]10
[4408]11import org.openstreetmap.josm.data.osm.DataSet;
[2512]12import org.openstreetmap.josm.data.osm.OsmPrimitive;
[4408]13import org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDialog;
[2512]14import org.openstreetmap.josm.tools.Shortcut;
15
[7859]16/**
17 * Display advanced object information about OSM nodes, ways, or relations.
18 * @since 1697
19 */
[4408]20public class InfoAction extends JosmAction {
[2512]21
[6336]22 /**
23 * Constructs a new {@code InfoAction}.
24 */
[2512]25 public InfoAction() {
[7771]26 super(tr("Advanced info"), "info",
[4942]27 tr("Display advanced object information about OSM nodes, ways, or relations."),
28 Shortcut.registerShortcut("core:info",
[4982]29 tr("Advanced info"), KeyEvent.VK_I, Shortcut.CTRL),
[4942]30 true, "action/info", true);
[3761]31 putValue("help", ht("/Action/InfoAboutElements"));
[2512]32 }
33
34 @Override
[4408]35 public void actionPerformed(ActionEvent ae) {
[13434]36 DataSet set = getLayerManager().getActiveDataSet();
[5925]37 if (set != null) {
[12672]38 new InspectPrimitiveDialog(set.getAllSelected(), set).showDialog();
[5925]39 }
[2512]40 }
[4408]41
42 @Override
43 public void updateEnabledState() {
[13434]44 updateEnabledStateOnCurrentSelection(true);
[4408]45 }
46
47 @Override
48 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
49 setEnabled(!selection.isEmpty());
50 }
[2512]51}
Note: See TracBrowser for help on using the repository browser.