Changeset 4408 in josm for trunk/src/org/openstreetmap/josm/actions/InfoAction.java
- Timestamp:
- 08.09.2011 00:08:02 (9 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/InfoAction.java
r4139 r4408 2 2 package org.openstreetmap.josm.actions; 3 3 4 import java.awt.event.ActionEvent; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; … … 7 8 import java.awt.event.KeyEvent; 8 9 10 import java.util.Collection; 9 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.data.osm.DataSet; 10 13 import org.openstreetmap.josm.data.osm.OsmPrimitive; 11 import org.openstreetmap.josm. data.osm.OsmPrimitiveType;14 import org.openstreetmap.josm.gui.dialogs.InspectPrimitiveDialog; 12 15 import org.openstreetmap.josm.tools.Shortcut; 13 16 14 public class InfoAction extends AbstractInfoAction {17 public class InfoAction extends JosmAction { 15 18 16 19 public InfoAction() { 17 super(tr(" Info about Element"), "about",18 tr("Display object information about OSM nodes, ways, or relations."),19 Shortcut.registerShortcut("core:info rmation",20 tr("Info about Element"), KeyEvent.VK_I, Shortcut.GROUP_HOTKEY), false);20 super(tr("Advanced info"), "about", 21 tr("Display advanced object information about OSM nodes, ways, or relations."), 22 Shortcut.registerShortcut("core:info", 23 tr("Advanced info"), KeyEvent.VK_I, Shortcut.GROUP_HOTKEY), false); 21 24 putValue("help", ht("/Action/InfoAboutElements")); 22 25 putValue("toolbar", "action/info"); … … 25 28 26 29 @Override 27 protected String createInfoUrl(Object infoObject) { 28 OsmPrimitive primitive = (OsmPrimitive)infoObject; 29 return getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId(); 30 public void actionPerformed(ActionEvent ae) { 31 DataSet set = getCurrentDataSet(); 32 if (set != null) { 33 new InspectPrimitiveDialog(set.getSelected(), Main.map.mapView.getEditLayer()).showDialog(); 34 } 35 } 36 37 @Override 38 public void updateEnabledState() { 39 if (getCurrentDataSet() == null) { 40 setEnabled(false); 41 } else { 42 updateEnabledState(getCurrentDataSet().getSelected()); 43 } 44 } 45 46 @Override 47 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 48 setEnabled(!selection.isEmpty()); 30 49 } 31 50 }
Note: See TracChangeset
for help on using the changeset viewer.
