Changeset 28975 in osm for applications/editors
- Timestamp:
- 2012-11-24T23:46:58+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaCopyTemplate.java
r28465 r28975 4 4 5 5 import java.awt.event.ActionEvent; 6 import java.util.Arrays; 6 7 import java.util.Collection; 8 import java.util.List; 9 import javax.swing.JMenuItem; 7 10 import org.openstreetmap.josm.Main; 8 11 import org.openstreetmap.josm.actions.JosmAction; … … 14 17 public class WikipediaCopyTemplate { 15 18 19 private static final List<CoordCopyTemplate> TEMPLATES = Arrays.asList( 20 new CoordCopyTemplate(tr("Copy {0} template", "{{Coordinate}}"), "wikipedia-coordinate", "{{Coordinate|NS={lat}|EW={lon}|type=landmark|region=}}"), 21 new CoordCopyTemplate(tr("Copy {0} template", "{{Coord}}"), "wikipedia-coord", "{{Coord|{lat}|{lon}}}"), 22 new CoordCopyTemplate(tr("Copy {0} template", "{{Location dec}}"), "wikipedia-location-dec", "{{Location dec|{lat}|{lon}}}"), 23 new CoordCopyTemplate(tr("Copy {0} template", "{{Object location dec}}"), "wikipedia-object-location-dec", "{{Object location dec|{lat}|{lon}}}") 24 ); 25 16 26 public WikipediaCopyTemplate() { 17 final CoordCopyTemplate coord = new CoordCopyTemplate( 18 tr("Copy {0} template", "''{{Coord}}''"), "wikipedia-coord", 19 "{{Coord|{lat}|{lon}}}"); 20 final CoordCopyTemplate coordinate = new CoordCopyTemplate( 21 tr("Copy {0} template", "''{{Coordinate}}''"), "wikipedia-coordinate", 22 "{{Coordinate|NS={lat}|EW={lon}|type=landmark|region=}}"); 23 MainMenu.addAfter(Main.main.menu.editMenu, coord, false, Main.main.menu.copyCoordinates); 24 MainMenu.addAfter(Main.main.menu.editMenu, coordinate, false, Main.main.menu.copyCoordinates); 27 JosmAction previous = Main.main.menu.copyCoordinates; 28 for (final CoordCopyTemplate t : TEMPLATES) { 29 MainMenu.addAfter(Main.main.menu.editMenu, t, false, previous); 30 previous = t; 31 //MainMenu.addAfter(Main.main.menu.editMenu, coord, false, Main.main.menu.copyCoordinates); 32 } 25 33 } 26 34
Note:
See TracChangeset
for help on using the changeset viewer.