source: josm/trunk/src/org/openstreetmap/josm/actions/HistoryInfoWebAction.java@ 8684

Last change on this file since 8684 was 8475, checked in by Don-vip, 9 years ago

fix #11219 - Open notes in browser with Ctrl-Shift-I: "Advanced info (web)"

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.actions;
3
4import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
5import static org.openstreetmap.josm.tools.I18n.tr;
6
7import java.awt.event.KeyEvent;
8
9import org.openstreetmap.josm.Main;
10import org.openstreetmap.josm.data.osm.OsmPrimitive;
11import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
12import org.openstreetmap.josm.tools.Shortcut;
13
14public class HistoryInfoWebAction extends AbstractInfoAction {
15
16 /**
17 * Constructs a new {@code HistoryInfoWebAction}.
18 */
19 public HistoryInfoWebAction() {
20 super(tr("History (web)"), "dialogs/history",
21 tr("Display history information about OSM ways, nodes, or relations in web browser."),
22 Shortcut.registerShortcut("core:historyinfoweb",
23 tr("History (web)"), KeyEvent.VK_H, Shortcut.CTRL_SHIFT),
24 true, "action/historyinfoweb", true);
25 putValue("help", ht("/Action/ObjectHistoryWeb"));
26 }
27
28 @Override
29 protected String createInfoUrl(Object infoObject) {
30 if (infoObject instanceof OsmPrimitive) {
31 OsmPrimitive primitive = (OsmPrimitive) infoObject;
32 return Main.getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId() + "/history";
33 } else {
34 return null;
35 }
36 }
37}
Note: See TracBrowser for help on using the repository browser.