1 | //License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
6 |
|
---|
7 | import java.awt.event.KeyEvent;
|
---|
8 |
|
---|
9 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
10 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
|
---|
11 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
12 |
|
---|
13 | public class InfoWebAction extends AbstractInfoAction {
|
---|
14 |
|
---|
15 | public InfoWebAction() {
|
---|
16 | super(tr("Advanced info (web)"), "about",
|
---|
17 | tr("Display object information about OSM nodes, ways, or relations in web browser."),
|
---|
18 | Shortcut.registerShortcut("core:infoweb",
|
---|
19 | tr("Advanced info (web)"), KeyEvent.VK_I, Shortcut.CTRL_SHIFT),
|
---|
20 | true, "action/infoweb", true);
|
---|
21 | putValue("help", ht("/Action/InfoAboutElementsWeb"));
|
---|
22 | }
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | protected String createInfoUrl(Object infoObject) {
|
---|
26 | OsmPrimitive primitive = (OsmPrimitive)infoObject;
|
---|
27 | return getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId();
|
---|
28 | }
|
---|
29 | }
|
---|