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.Main;
|
---|
10 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
11 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
|
---|
12 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Display object information about OSM nodes, ways, or relations in web browser.
|
---|
16 | * @since 4408
|
---|
17 | */
|
---|
18 | public class InfoWebAction extends AbstractInfoAction {
|
---|
19 |
|
---|
20 | /**
|
---|
21 | * Constructs a new {@code InfoWebAction}.
|
---|
22 | */
|
---|
23 | public InfoWebAction() {
|
---|
24 | super(tr("Advanced info (web)"), "info",
|
---|
25 | tr("Display object information about OSM nodes, ways, or relations in web browser."),
|
---|
26 | Shortcut.registerShortcut("core:infoweb",
|
---|
27 | tr("Advanced info (web)"), KeyEvent.VK_I, Shortcut.CTRL_SHIFT),
|
---|
28 | true, "action/infoweb", true);
|
---|
29 | putValue("help", ht("/Action/InfoAboutElementsWeb"));
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Override
|
---|
33 | protected String createInfoUrl(Object infoObject) {
|
---|
34 | OsmPrimitive primitive = (OsmPrimitive)infoObject;
|
---|
35 | return Main.getBaseBrowseUrl() + "/" + OsmPrimitiveType.from(primitive).getAPIName() + "/" + primitive.getId();
|
---|
36 | }
|
---|
37 | }
|
---|