Index: /applications/editors/josm/plugins/cadastre-fr/build.xml
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 14119)
+++ /applications/editors/josm/plugins/cadastre-fr/build.xml	(revision 14120)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="A special handler for the french land registry WMS server."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/FR:JOSM/Fr:Plugin/Cadastre"/>
-                <attribute name="Plugin-Mainversion" value="1465"/>
+                <attribute name="Plugin-Mainversion" value="1498"/>
                 <attribute name="Plugin-Stage" value="60"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
Index: /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
===================================================================
--- /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java	(revision 14120)
@@ -1,4 +1,5 @@
 package cadastre_fr;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -10,5 +11,4 @@
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JMenu;
-import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
@@ -20,4 +20,5 @@
 import org.openstreetmap.josm.actions.UploadAction.UploadHook;
 import org.openstreetmap.josm.gui.IconToggleButton;
+import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
@@ -26,15 +27,15 @@
 
 /**
- * 
+ *
  * Plugin to access the french Cadastre WMS server at www.cadastre.gouv.fr This
  * WMS server requires some specific handling like retrieving a cookie for a
  * limitation in case of no activity, or the request to the server shall provide
  * a city/town/village code.
- * 
- * @author Pieren <pieren3@gmail.com>, 
+ *
+ * @author Pieren <pieren3@gmail.com>,
  * @author <matthieu.lochegnies@gmail.com> for the extension to codeCommune
  * @version 0.8
- * History: 
- * 0.1 17-Jun-2008 first prototype using a first Lambert projection impl. in core 
+ * History:
+ * 0.1 17-Jun-2008 first prototype using a first Lambert projection impl. in core
  * 0.2 22-Jun-2008 first stable version
  * 0.3 24-Jun-2008 add code departement
@@ -43,5 +44,5 @@
  *                 - add option to force a Lambert zone (for median locations)
  *                 - add auto-sourcing
- * 0.5 16-Aug-2008 - add transparency in layer (allowing multiple wms layers displayed together) 
+ * 0.5 16-Aug-2008 - add transparency in layer (allowing multiple wms layers displayed together)
  *                 - no overlapping of grabbed images if transparency is enabled
  *                 - set one layer per location
@@ -61,12 +62,12 @@
  *                 - validate projection name by Lambert.toString() method
  * 0.8 25-Jan-2009 - display returned list of communes if direct name is not recognized by server
- *                 - new possible grab factor of 100 square meters fixed size                     
+ *                 - new possible grab factor of 100 square meters fixed size
  *                 - minor fixes due to changes in JOSM core classes
- *                 - first draft of raster image support 
+ *                 - first draft of raster image support
  * 0.9 05-Feb-2009 - grab vectorized full commune bbox, save in file, convert to OSM way
  *                   and simplify
- * 1.0 18-Feb-2009 - fix various bugs in color management and preference dialog 
+ * 1.0 18-Feb-2009 - fix various bugs in color management and preference dialog
  *                 - increase PNG picture size requested to WMS (800x1000)
- *                 - set 4th grab scale fixed size configurable (from 25 to 1000 meters) 
+ *                 - set 4th grab scale fixed size configurable (from 25 to 1000 meters)
  */
 public class CadastrePlugin extends Plugin {
@@ -78,26 +79,26 @@
 
     public static String source = "";
-    
+
     // true if the checkbox "auto-sourcing" is set in the plugin menu
     public static boolean autoSourcing = false;
-    
+
     // true when the plugin is first used, e.g. grab from WMS or download cache file
     public static boolean pluginUsed = false;
-    
+
     public static String cacheDir = null;
-    
+
     public static boolean alterColors = false;
-    
+
     public static boolean backgroundTransparent = false;
-    
+
     public static float transparency = 1.0f;
-    
+
     public static boolean drawBoundaries = false;
-    
+
     static private boolean menuEnabled = false;
 
     /**
      * Creates the plugin and setup the default settings if necessary
-     * 
+     *
      * @throws Exception
      */
@@ -123,10 +124,8 @@
     public void refreshMenu() throws Exception {
         boolean isLambertProjection = Main.proj.toString().equals(new Lambert().toString());
-        JMenuBar menu = Main.main.menu;
+        MainMenu menu = Main.main.menu;
 
         if (cadastreJMenu == null) {
-            cadastreJMenu = new JMenu(tr("Cadastre"));
-            cadastreJMenu.setMnemonic(KeyEvent.VK_C);
-            menu.add(cadastreJMenu, menu.getMenuCount()-2);
+            cadastreJMenu = menu.addMenu(marktr("Cadastre"), KeyEvent.VK_C, menu.defaultMenuPos);
             if (isLambertProjection) {
                 JosmAction grab = new MenuActionGrab();
@@ -138,5 +137,5 @@
                 JMenuItem menuSettings = new JMenuItem(new MenuActionNewLocation());
                 final JCheckBoxMenuItem menuSource = new JCheckBoxMenuItem(tr("Auto sourcing"));
-                menuSource.setSelected(autoSourcing);     
+                menuSource.setSelected(autoSourcing);
                 menuSource.addActionListener(new ActionListener() {
                     public void actionPerformed(ActionEvent ev) {
@@ -145,5 +144,5 @@
                     }
                 });
-    
+
                 JMenuItem menuResetCookie = new JMenuItem(new MenuActionResetCookie());
                 JMenuItem menuLambertZone = new JMenuItem(new MenuActionLambertZone());
@@ -151,5 +150,5 @@
                 //JMenuItem menuActionBoundaries = new JMenuItem(new MenuActionBoundaries());
                 //JMenuItem menuActionBuildings = new JMenuItem(new MenuActionBuildings());
-                
+
                 cadastreJMenu.add(menuGrab);
                 cadastreJMenu.add(menuSettings);
@@ -159,5 +158,5 @@
                 cadastreJMenu.add(menuLoadFromCache);
                 // all SVG features disabled until official WMS is released
-                //cadastreJMenu.add(menuActionBoundaries); 
+                //cadastreJMenu.add(menuActionBoundaries);
                 //cadastreJMenu.add(menuActionBuildings);
             } else {
Index: /applications/editors/josm/plugins/duplicateway/src/org/openstreetmap/josm/plugins/duplicateway/DuplicateWayPlugin.java
===================================================================
--- /applications/editors/josm/plugins/duplicateway/src/org/openstreetmap/josm/plugins/duplicateway/DuplicateWayPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/duplicateway/src/org/openstreetmap/josm/plugins/duplicateway/DuplicateWayPlugin.java	(revision 14120)
@@ -20,24 +20,7 @@
   public DuplicateWayPlugin() {
     name = tr("Duplicate Way");
-    JMenu toolsMenu = null;
-    for (int i = 0; i < Main.main.menu.getMenuCount() && toolsMenu == null; i++) {
-      JMenu menu = Main.main.menu.getMenu(i);
-      String name = menu.getText();
-      if (name != null && name.equals(tr("Tools"))) {
-        toolsMenu = menu;
-      }
-    }
-
-    if (toolsMenu == null) {
-      toolsMenu = new JMenu(name);
-      toolsMenu.add(new JMenuItem(new DuplicateWayAction()));
-      Main.main.menu.add(toolsMenu, 2);
-    }
-    else {
-      toolsMenu.addSeparator();
-      toolsMenu.add(new JMenuItem(new DuplicateWayAction()));
-    }
-
+    JMenu toolsMenu = Main.main.menu.toolsMenu;
+    toolsMenu.addSeparator();
+    toolsMenu.add(new JMenuItem(new DuplicateWayAction()));
   }
-
 }
Index: /applications/editors/josm/plugins/grid/src/grid/GridPlugin.java
===================================================================
--- /applications/editors/josm/plugins/grid/src/grid/GridPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/grid/src/grid/GridPlugin.java	(revision 14120)
@@ -15,5 +15,4 @@
 import org.openstreetmap.josm.data.osm.DataSet;
 import org.openstreetmap.josm.data.osm.Node;
-import org.openstreetmap.josm.data.osm.Segment;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.visitor.AddVisitor;
@@ -26,5 +25,5 @@
     private class Action extends AbstractAction {
     public Action() {
-        super("add grid");
+        super(tr("Add grid"));
     }
     public void actionPerformed(ActionEvent e) {
@@ -38,19 +37,7 @@
 
     public GridPlugin() {
-    JMenuBar menu = Main.main.menu;
-    edit = null;
-    for (int i = 0; i < menu.getMenuCount(); ++i) {
-        if (menu.getMenu(i) != null && tr("Edit").equals(menu.getMenu(i).getName())) {
-        edit = menu.getMenu(i);
-        break;
-        }
-    }
-    if (edit == null) {
-        edit = new JMenu(tr("Edit"));
-        menu.add(edit, 2);
-        edit.setVisible(false);
-    }
-    edit.add(addGridMenu);
-    addGridMenu.setVisible(false);
+        edit = Main.main.menu.editMenu;
+        edit.add(addGridMenu);
+        addGridMenu.setVisible(false);
     }
     @Override
Index: /applications/editors/josm/plugins/imagewaypoint/build.xml
===================================================================
--- /applications/editors/josm/plugins/imagewaypoint/build.xml	(revision 14119)
+++ /applications/editors/josm/plugins/imagewaypoint/build.xml	(revision 14120)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="Another plugin to match images to the waypoints in a GPX file. A match is made when the 'name', 'cmt' or 'desc' attribute of a waypoint tag matches the filename of an image."/>
                 <attribute name="Plugin-Early" value="false"/>
-                <attribute name="Plugin-Mainversion" value="1465"/>
+                <attribute name="Plugin-Mainversion" value="1498"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: /applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java
===================================================================
--- /applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java	(revision 14120)
@@ -11,11 +11,9 @@
 
 import javax.swing.JFileChooser;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
 import javax.swing.filechooser.FileFilter;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.gui.MapFrame;
 import org.openstreetmap.josm.gui.layer.Layer;
@@ -98,22 +96,6 @@
      */
     public ImageWayPointPlugin() {
-    // find the File menu
-    final JMenuBar menuBar = Main.main.menu;
-    JMenu fileMenu = null;
-
-    if (null != menuBar) {
-        for (int index = 0; index < menuBar.getMenuCount()
-            && null == fileMenu; index++) {
-        if (I18n.tr("File").equals(menuBar.getMenu(index).getText())) {
-            fileMenu = menuBar.getMenu(index);
-        }
-        }
-    }
-
-    if (null != fileMenu) {
-        // now create our 'load' menu item and add to the file menu
-        final JMenuItem menuItem = new JMenuItem(new LoadImagesAction(this));
-        fileMenu.add(menuItem, 2);
-    }
+        MainMenu menu = Main.main.menu;
+        menu.add(menu.fileMenu, new LoadImagesAction(this));
     }
 
Index: /applications/editors/josm/plugins/livegps/build.xml
===================================================================
--- /applications/editors/josm/plugins/livegps/build.xml	(revision 14119)
+++ /applications/editors/josm/plugins/livegps/build.xml	(revision 14120)
@@ -26,5 +26,5 @@
                 <attribute name="Plugin-Description" value="Support live GPS input (moving dot) through a connection to gpsd server."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/LiveGPS"/>
-                <attribute name="Plugin-Mainversion" value="1465"/>
+                <attribute name="Plugin-Mainversion" value="1498"/>
                 <attribute name="Plugin-Stage" value="50"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
Index: /applications/editors/josm/plugins/livegps/src/livegps/LiveGpsPlugin.java
===================================================================
--- /applications/editors/josm/plugins/livegps/src/livegps/LiveGpsPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/livegps/src/livegps/LiveGpsPlugin.java	(revision 14120)
@@ -1,4 +1,5 @@
 package livegps;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -11,5 +12,4 @@
 import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JMenu;
-import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 
@@ -80,7 +80,5 @@
     {
         MainMenu menu = Main.main.menu;
-        lgpsmenu = new JMenu(tr("LiveGPS"));
-        menu.add(lgpsmenu, KeyEvent.VK_G, "livegps");
-        menu.add(lgpsmenu, 5);
+        lgpsmenu = menu.addMenu(marktr("LiveGPS"), KeyEvent.VK_G, menu.defaultMenuPos);
 
         JosmAction captureAction = new CaptureAction();
Index: /applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/navigator/src/at/dallermassl/josm/plugin/navigator/NavigatorPlugin.java	(revision 14120)
@@ -4,4 +4,5 @@
 package at.dallermassl.josm.plugin.navigator;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 
@@ -11,8 +12,8 @@
 
 import javax.swing.JMenu;
-import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.MainMenu;
 import org.openstreetmap.josm.gui.IconToggleButton;
 import org.openstreetmap.josm.gui.MapFrame;
@@ -41,6 +42,6 @@
         navigatorLayer.setNavigatorNodeModel(navigatorModel);
 
-        JMenuBar menu = Main.main.menu;
-        JMenu navigatorMenu = new JMenu(tr("Navigation"));
+        MainMenu menu = Main.main.menu;
+        JMenu navigatorMenu = menu.addMenu(marktr("Navigation"), KeyEvent.VK_N, menu.defaultMenuPos);
         JMenuItem navigatorMenuItem = new JMenuItem(new NavigatorAction(this));
         navigatorMenu.add(navigatorMenuItem);
Index: /applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisiblePlugin.java
===================================================================
--- /applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisiblePlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/openvisible/src/at/dallermassl/josm/plugin/openvisible/OpenVisiblePlugin.java	(revision 14120)
@@ -3,7 +3,4 @@
  */
 package at.dallermassl.josm.plugin.openvisible;
-
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
 
 import org.openstreetmap.josm.Main;
Index: /applications/editors/josm/plugins/osmarender/src/OsmarenderPlugin.java
===================================================================
--- /applications/editors/josm/plugins/osmarender/src/OsmarenderPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/osmarender/src/OsmarenderPlugin.java	(revision 14120)
@@ -13,6 +13,4 @@
 import javax.swing.AbstractAction;
 import javax.swing.JLabel;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
Index: /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java
===================================================================
--- /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java	(revision 14120)
@@ -13,5 +13,4 @@
 import javax.swing.JFrame;
 import javax.swing.JMenu;
-import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
 import javax.swing.KeyStroke;
Index: /applications/editors/josm/plugins/tcxplugin/src/org/openstreetmap/josm/plugins/TcxPlugin.java
===================================================================
--- /applications/editors/josm/plugins/tcxplugin/src/org/openstreetmap/josm/plugins/TcxPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/tcxplugin/src/org/openstreetmap/josm/plugins/TcxPlugin.java	(revision 14120)
@@ -2,5 +2,5 @@
  * josm.tcx.plugin
  * (c) Copyright by M.IT 2002-2008
- * www.emaitie.de 
+ * www.emaitie.de
  */
 
@@ -15,6 +15,4 @@
 
 import javax.swing.JFileChooser;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
 
 import org.openstreetmap.josm.Main;
@@ -41,5 +39,5 @@
             KeyEvent.VK_T, Shortcut.GROUP_MENU));
         }
-        
+
         private void addTcxFileFilter()
         {
@@ -49,9 +47,9 @@
 //              => check if filters contains a tcx entry, if not create a new array with tcx in it
 //              assign it to filters
-            
-    // TODO later we can remove the filter from the file filter list, so the extension does not appear 
+
+    // TODO later we can remove the filter from the file filter list, so the extension does not appear
     // when the user wants to open a normal file.
         }
-        
+
 
         public void actionPerformed(ActionEvent e)
Index: /applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/UtilsPlugin.java
===================================================================
--- /applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/UtilsPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/UtilsPlugin.java	(revision 14120)
@@ -6,9 +6,6 @@
 import java.awt.event.ActionEvent;
 import javax.swing.AbstractAction;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 import javax.swing.JOptionPane;
-
 import javax.swing.JPanel;
 import javax.swing.BoxLayout;
Index: /applications/editors/josm/plugins/wmsplugin/build.xml
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/build.xml	(revision 14119)
+++ /applications/editors/josm/plugins/wmsplugin/build.xml	(revision 14120)
@@ -29,5 +29,5 @@
                 <attribute name="Plugin-Description" value="Display georeferenced images as background in JOSM (WMS servers, Yahoo, ...)."/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/WMSPlugin"/>
-                <attribute name="Plugin-Mainversion" value="1465"/>
+                <attribute name="Plugin-Mainversion" value="1498"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
                 <attribute name="de_Plugin-Link" value="http://wiki.openstreetmap.org/wiki/DE:JOSM/Plugins/WMSPlugin"/>
Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 14119)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java	(revision 14120)
@@ -1,6 +1,6 @@
 package wmsplugin;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
-
 
 import java.awt.event.ActionEvent;
@@ -16,5 +16,4 @@
 import javax.swing.AbstractButton;
 import javax.swing.JMenu;
-import javax.swing.JMenuBar;
 import javax.swing.JMenuItem;
 
@@ -130,11 +129,8 @@
         MainMenu menu = Main.main.menu;
 
-        if (wmsJMenu == null) {
-            wmsJMenu = new JMenu(tr("WMS"));
-            menu.add(wmsJMenu, KeyEvent.VK_W, "wms");
-            menu.add(wmsJMenu, 5);
-        } else {
+        if (wmsJMenu == null)
+            wmsJMenu = menu.addMenu(marktr("WMS"), KeyEvent.VK_W, menu.defaultMenuPos);
+        else
             wmsJMenu.removeAll();
-        }
 
         // for each configured WMSInfo, add a menu entry.
