001 //License: GPL. Copyright 2007 by Immanuel Scholz and others
002 package org.openstreetmap.josm.actions;
003
004 import static org.openstreetmap.josm.tools.I18n.tr;
005 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
006
007 import java.awt.event.KeyEvent;
008
009 import org.openstreetmap.josm.Main;
010 import org.openstreetmap.josm.data.osm.OsmPrimitive;
011 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
012 import org.openstreetmap.josm.tools.Shortcut;
013
014 public class InfoWebAction extends AbstractInfoAction {
015
016 public InfoWebAction() {
017 super(tr("Advanced info (web)"), "about",
018 tr("Display object information about OSM nodes, ways, or relations in web browser."),
019 Shortcut.registerShortcut("core:infoweb",
020 tr("Advanced info (web)"), KeyEvent.VK_I, Shortcut.CTRL_SHIFT),
021 true, "action/infoweb", true);
022 putValue("help", ht("/Action/InfoAboutElementsWeb"));
023 }
024
025 @Override
026 protected String createInfoUrl(Object infoObject) {
027 OsmPrimitive primitive = (OsmPrimitive)infoObject;
028 return getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId();
029 }
030 }