Changeset 20079 in osm for applications/editors
- Timestamp:
- 2010-02-20T10:35:41+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/tageditor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tageditor/build.xml
r20058 r20079 28 28 29 29 30 <property name="commit.message" value="Tageditor plugin cleaned up" />30 <property name="commit.message" value="Tageditor: fixed josm bug 2416" /> 31 31 <property name="plugin.main.version" value="3015" /> 32 32 -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java
r20058 r20079 21 21 public class LaunchAction extends JosmAction implements SelectionChangedListener { 22 22 23 protected void registerAsMenuItem() {24 JMenuBar menu = Main.main.menu;25 JMenu edit = null;26 JMenuItem item = new JMenuItem(this);27 28 for (int i = 0; i < menu.getMenuCount(); ++i) {29 if (menu.getMenu(i) != null30 && tr("Edit").equals(menu.getMenu(i).getText())) {31 edit = menu.getMenu(i);32 break;33 }34 }35 36 if (edit != null) {37 edit.insertSeparator(edit.getItemCount());38 JMenuItem mitem = edit.insert(this, edit.getItemCount());39 mitem.setAccelerator(KeyStroke.getKeyStroke('T'));40 } else if (menu.getMenuCount() > 0) {41 edit = menu.getMenu(0);42 JMenuItem mitem = edit.insert(this, 0);43 mitem.setAccelerator(KeyStroke.getKeyStroke('T'));44 45 }46 47 item.setVisible(true);48 }49 50 23 public LaunchAction() { 51 24 super( … … 58 31 KeyEvent.VK_T, 59 32 Shortcut.GROUP_EDIT), 60 false // don't register, plugin will add the action to the menu33 true 61 34 ); 62 35 63 36 DataSet.selListeners.add(this); 64 registerAsMenuItem();65 37 setEnabled(false); 66 38 } -
applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java
r19413 r20079 1 1 package org.openstreetmap.josm.plugins.tageditor; 2 2 3 import org.openstreetmap.josm.Main; 4 import org.openstreetmap.josm.gui.MainMenu; 3 5 import org.openstreetmap.josm.plugins.Plugin; 4 6 import org.openstreetmap.josm.plugins.PluginInformation; 5 7 6 8 public class TagEditorPlugin extends Plugin { 7 8 LaunchAction action = null; 9 LaunchAction action; 9 10 10 11 /** … … 14 15 super(info); 15 16 action = new LaunchAction(); 17 MainMenu.add(Main.main.menu.editMenu, action); 16 18 } 17 19 }
Note:
See TracChangeset
for help on using the changeset viewer.