001//License: GPL. For details, see LICENSE file.
002package org.openstreetmap.josm.actions;
003
004import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
005import static org.openstreetmap.josm.tools.I18n.tr;
006
007import java.awt.event.KeyEvent;
008
009import org.openstreetmap.josm.data.osm.OsmPrimitive;
010import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
011import org.openstreetmap.josm.tools.Shortcut;
012
013public class HistoryInfoWebAction extends AbstractInfoAction {
014
015    public HistoryInfoWebAction() {
016        super(tr("History (web)"), "about",
017                tr("Display history information about OSM ways, nodes, or relations in web browser."),
018                Shortcut.registerShortcut("core:historyinfoweb",
019                        tr("History (web)"), KeyEvent.VK_H, Shortcut.CTRL_SHIFT),
020                true, "action/historyinfoweb", true);
021        putValue("help", ht("/Action/ObjectHistoryWeb"));
022    }
023
024    @Override
025    protected  String createInfoUrl(Object infoObject) {
026        OsmPrimitive primitive = (OsmPrimitive) infoObject;
027        return getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId() + "/history";
028    }
029}