[8378] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
[4408] | 2 | package org.openstreetmap.josm.actions;
|
---|
| 3 |
|
---|
[5926] | 4 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
[4408] | 5 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
| 6 |
|
---|
| 7 | import java.awt.event.KeyEvent;
|
---|
| 8 |
|
---|
[7678] | 9 | import org.openstreetmap.josm.Main;
|
---|
[4408] | 10 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
---|
| 11 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
|
---|
| 12 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
| 13 |
|
---|
[9136] | 14 | /**
|
---|
| 15 | * Display history information about OSM ways, nodes, or relations in web browser.
|
---|
| 16 | * @since 4408
|
---|
| 17 | */
|
---|
[4408] | 18 | public class HistoryInfoWebAction extends AbstractInfoAction {
|
---|
| 19 |
|
---|
[8378] | 20 | /**
|
---|
| 21 | * Constructs a new {@code HistoryInfoWebAction}.
|
---|
| 22 | */
|
---|
[4408] | 23 | public HistoryInfoWebAction() {
|
---|
[7771] | 24 | super(tr("History (web)"), "dialogs/history",
|
---|
[4408] | 25 | tr("Display history information about OSM ways, nodes, or relations in web browser."),
|
---|
| 26 | Shortcut.registerShortcut("core:historyinfoweb",
|
---|
[4982] | 27 | tr("History (web)"), KeyEvent.VK_H, Shortcut.CTRL_SHIFT),
|
---|
[4942] | 28 | true, "action/historyinfoweb", true);
|
---|
[4700] | 29 | putValue("help", ht("/Action/ObjectHistoryWeb"));
|
---|
[4408] | 30 | }
|
---|
| 31 |
|
---|
| 32 | @Override
|
---|
[10378] | 33 | protected String createInfoUrl(Object infoObject) {
|
---|
[8475] | 34 | if (infoObject instanceof OsmPrimitive) {
|
---|
| 35 | OsmPrimitive primitive = (OsmPrimitive) infoObject;
|
---|
[8846] | 36 | return Main.getBaseBrowseUrl() + '/' + OsmPrimitiveType.from(primitive).getAPIName() + '/' + primitive.getId() + "/history";
|
---|
[8475] | 37 | } else {
|
---|
| 38 | return null;
|
---|
| 39 | }
|
---|
[4408] | 40 | }
|
---|
| 41 | }
|
---|