| 1 | //License: GPL. Copyright 2007 by Immanuel Scholz and others |
|---|
| 2 | package org.openstreetmap.josm.actions; |
|---|
| 3 | |
|---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr; |
|---|
| 5 | |
|---|
| 6 | import java.awt.event.KeyEvent; |
|---|
| 7 | |
|---|
| 8 | import org.openstreetmap.josm.Main; |
|---|
| 9 | import org.openstreetmap.josm.data.osm.OsmPrimitive; |
|---|
| 10 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType; |
|---|
| 11 | import org.openstreetmap.josm.tools.Shortcut; |
|---|
| 12 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht; |
|---|
| 13 | |
|---|
| 14 | public class HistoryInfoWebAction extends AbstractInfoAction { |
|---|
| 15 | |
|---|
| 16 | public HistoryInfoWebAction() { |
|---|
| 17 | super(tr("History (web)"), "about", |
|---|
| 18 | tr("Display history information about OSM ways, nodes, or relations in web browser."), |
|---|
| 19 | Shortcut.registerShortcut("core:historyinfoweb", |
|---|
| 20 | tr("History (web)"), KeyEvent.VK_H, Shortcut.CTRL_SHIFT), |
|---|
| 21 | true, "action/historyinfoweb", true); |
|---|
| 22 | putValue("help", ht("/Action/ObjectHistoryWeb")); |
|---|
| 23 | } |
|---|
| 24 | |
|---|
| 25 | @Override |
|---|
| 26 | protected String createInfoUrl(Object infoObject) { |
|---|
| 27 | OsmPrimitive primitive = (OsmPrimitive) infoObject; |
|---|
| 28 | return getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId() + "/history"; |
|---|
| 29 | } |
|---|
| 30 | } |
|---|