Changeset 20079 in osm for applications/editors/josm


Ignore:
Timestamp:
2010-02-20T10:35:41+01:00 (14 years ago)
Author:
bastik
Message:

'Tageditor: fixed josm bug 2416'

Location:
applications/editors/josm/plugins/tageditor
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tageditor/build.xml

    r20058 r20079  
    2828
    2929
    30         <property name="commit.message" value="Tageditor plugin cleaned up" />
     30        <property name="commit.message" value="Tageditor: fixed josm bug 2416" />
    3131        <property name="plugin.main.version" value="3015" />
    3232
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/LaunchAction.java

    r20058 r20079  
    2121public class LaunchAction extends JosmAction implements SelectionChangedListener {
    2222
    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) != null
    30                                         && 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 
    5023        public LaunchAction()  {
    5124                super(
     
    5831                                                KeyEvent.VK_T,
    5932                                                Shortcut.GROUP_EDIT),
    60                                                 false // don't register, plugin will add the action to the menu
     33                                                true
    6134                );
    6235
    6336                DataSet.selListeners.add(this);
    64                 registerAsMenuItem();
    6537                setEnabled(false);
    6638        }
  • applications/editors/josm/plugins/tageditor/src/org/openstreetmap/josm/plugins/tageditor/TagEditorPlugin.java

    r19413 r20079  
    11package org.openstreetmap.josm.plugins.tageditor;
    22
     3import org.openstreetmap.josm.Main;
     4import org.openstreetmap.josm.gui.MainMenu;
    35import org.openstreetmap.josm.plugins.Plugin;
    46import org.openstreetmap.josm.plugins.PluginInformation;
    57
    68public class TagEditorPlugin extends Plugin {
    7 
    8         LaunchAction action = null;
     9        LaunchAction action;
    910       
    1011        /**
     
    1415                super(info);
    1516                action = new LaunchAction();
     17                MainMenu.add(Main.main.menu.editMenu, action);
    1618        }
    1719}
Note: See TracChangeset for help on using the changeset viewer.