Ignore:
Timestamp:
2009-03-18T15:55:16+01:00 (15 years ago)
Author:
stoecker
Message:

fix the menu changes in JOSM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java

    r13497 r14120  
    1111
    1212import javax.swing.JFileChooser;
    13 import javax.swing.JMenu;
    14 import javax.swing.JMenuBar;
    15 import javax.swing.JMenuItem;
    1613import javax.swing.filechooser.FileFilter;
    1714
    1815import org.openstreetmap.josm.Main;
    1916import org.openstreetmap.josm.actions.JosmAction;
     17import org.openstreetmap.josm.gui.MainMenu;
    2018import org.openstreetmap.josm.gui.MapFrame;
    2119import org.openstreetmap.josm.gui.layer.Layer;
     
    9896     */
    9997    public ImageWayPointPlugin() {
    100     // find the File menu
    101     final JMenuBar menuBar = Main.main.menu;
    102     JMenu fileMenu = null;
    103 
    104     if (null != menuBar) {
    105         for (int index = 0; index < menuBar.getMenuCount()
    106             && null == fileMenu; index++) {
    107         if (I18n.tr("File").equals(menuBar.getMenu(index).getText())) {
    108             fileMenu = menuBar.getMenu(index);
    109         }
    110         }
    111     }
    112 
    113     if (null != fileMenu) {
    114         // now create our 'load' menu item and add to the file menu
    115         final JMenuItem menuItem = new JMenuItem(new LoadImagesAction(this));
    116         fileMenu.add(menuItem, 2);
    117     }
     98        MainMenu menu = Main.main.menu;
     99        menu.add(menu.fileMenu, new LoadImagesAction(this));
    118100    }
    119101
Note: See TracChangeset for help on using the changeset viewer.