Ticket #7215: MapkiHistory.patch
| File MapkiHistory.patch, 2.9 KB (added by , 14 years ago) |
|---|
-
src/org/openstreetmap/josm/actions/HistoryInfoMapkiAction.java
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 public class HistoryInfoMapkiAction extends AbstractInfoAction { 15 16 public HistoryInfoMapkiAction() { 17 super(tr("History (mapki/web)"), "about", 18 tr("Display history information about OSM ways, nodes, or relations with the mapki service in web browser."), 19 Shortcut.registerShortcut("core:historyinfomapki", 20 tr("History (mapki/web)"), KeyEvent.VK_H, Shortcut.GROUP_HOTKEY, Shortcut.SHIFT_DEFAULT), false); 21 putValue("help", ht("/Action/ObjectHistoryMapki")); 22 putValue("toolbar", "action/historyinfomapki"); 23 Main.toolbar.register(this); 24 } 25 26 @Override 27 protected String createInfoUrl(Object infoObject) { 28 OsmPrimitive primitive = (OsmPrimitive) infoObject; 29 return "http://osm.mapki.com/history/" + OsmPrimitiveType.from(primitive).getAPIName() + ".php?id=" + primitive.getId(); 30 } 31 32 } -
src/org/openstreetmap/josm/gui/MainMenu.java
43 43 import org.openstreetmap.josm.actions.GpxExportAction; 44 44 import org.openstreetmap.josm.actions.HelpAction; 45 45 import org.openstreetmap.josm.actions.HistoryInfoAction; 46 import org.openstreetmap.josm.actions.HistoryInfoMapkiAction; 46 47 import org.openstreetmap.josm.actions.HistoryInfoWebAction; 47 48 import org.openstreetmap.josm.actions.InfoAction; 48 49 import org.openstreetmap.josm.actions.InfoWebAction; … … 157 158 public final InfoWebAction infoweb = new InfoWebAction(); 158 159 public final HistoryInfoAction historyinfo = new HistoryInfoAction(); 159 160 public final HistoryInfoWebAction historyinfoweb = new HistoryInfoWebAction(); 161 public final HistoryInfoMapkiAction historyinfomapki = new HistoryInfoMapkiAction(); 160 162 161 163 /* Tools menu */ 162 164 public final JosmAction splitWay = new SplitWayAction(); … … 445 447 add(viewMenu, infoweb); 446 448 add(viewMenu, historyinfo); 447 449 add(viewMenu, historyinfoweb); 450 add(viewMenu, historyinfomapki); 448 451 449 452 add(presetsMenu, presetSearchAction); 450 453 presetsMenu.addSeparator();
