Index: trunk/src/org/openstreetmap/josm/gui/HideableButton.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/HideableButton.java	(revision 15632)
+++ trunk/src/org/openstreetmap/josm/gui/HideableButton.java	(revision 15633)
@@ -23,4 +23,6 @@
     boolean isButtonVisible();
 
+    boolean isExpert();
+
     void setShowHideButtonListener(ShowHideButtonListener l);
 }
Index: trunk/src/org/openstreetmap/josm/gui/IconToggleButton.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/IconToggleButton.java	(revision 15632)
+++ trunk/src/org/openstreetmap/josm/gui/IconToggleButton.java	(revision 15633)
@@ -162,4 +162,9 @@
 
     @Override
+    public boolean isExpert() {
+        return isExpert;
+    }
+
+    @Override
     public void setShowHideButtonListener(ShowHideButtonListener l) {
         listener = l;
Index: trunk/src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 15632)
+++ trunk/src/org/openstreetmap/josm/gui/MainMenu.java	(revision 15633)
@@ -448,9 +448,8 @@
             final JPopupMenu m = ((JMenu) a.getSource()).getPopupMenu();
             for (int i = 0; i < m.getComponentCount()-1; i++) {
-                if (!(m.getComponent(i) instanceof JSeparator)) {
-                    continue;
+                // hide separator if the next menu item is one as well
+                if (m.getComponent(i) instanceof JSeparator && m.getComponent(i+1) instanceof JSeparator) {
+                    ((JSeparator) m.getComponent(i)).setVisible(false);
                 }
-                // hide separator if the next menu item is one as well
-                ((JSeparator) m.getComponent(i)).setVisible(!(m.getComponent(i+1) instanceof JSeparator));
             }
             // hide separator at the end of the menu
@@ -566,5 +565,5 @@
         if (action.getShortcut().isAutomatic())
             return null;
-        int i = getInsertionIndexForGroup(menu, group.ordinal());
+        int i = getInsertionIndexForGroup(menu, group.ordinal(), false);
         JMenuItem menuitem = (JMenuItem) menu.add(new JMenuItem(action), i);
         KeyStroke ks = action.getShortcut().getKeyStroke();
@@ -587,5 +586,24 @@
      */
     public static <E extends Enum<E>> JCheckBoxMenuItem addWithCheckbox(JMenu menu, JosmAction action, Enum<E> group) {
-        int i = getInsertionIndexForGroup(menu, group.ordinal());
+        return addWithCheckbox(menu, action, group, false, false);
+    }
+
+    /**
+     * Add a JosmAction to a menu and automatically prints accelerator if available.
+     * Also adds a checkbox that may be toggled.
+     * @param <E> group enum item type
+     * @param menu to add the action to
+     * @param action the action that should get a menu item
+     * @param group the item should be added to. Groups are split by a separator. Use
+     *        one of the enums that are defined for some of the menus to tell in which
+     *        group the item should go.
+     * @param isEntryExpert whether the entry should only be visible if the expert mode is activated
+     * @param isGroupSeparatorExpert whether the group separator should only be visible if the expert mode is activated
+     * @return The created menu item
+     * @since 15633
+     */
+    public static <E extends Enum<E>> JCheckBoxMenuItem addWithCheckbox(JMenu menu, JosmAction action, Enum<E> group,
+            boolean isEntryExpert, boolean isGroupSeparatorExpert) {
+        int i = getInsertionIndexForGroup(menu, group.ordinal(), isGroupSeparatorExpert);
         final JCheckBoxMenuItem mi = (JCheckBoxMenuItem) menu.add(new JCheckBoxMenuItem(action), i);
         final KeyStroke ks = action.getShortcut().getKeyStroke();
@@ -593,4 +611,7 @@
             mi.setAccelerator(ks);
         }
+        if (isEntryExpert) {
+            ExpertToggleAction.addVisibilitySwitcher(mi);
+        }
         return mi;
     }
@@ -600,7 +621,8 @@
      * @param menu menu
      * @param group group number
+     * @param isGroupSeparatorExpert whether the added separators should only be visible if the expert mode is activated
      * @return correct insertion index
      */
-    private static int getInsertionIndexForGroup(JMenu menu, int group) {
+    private static int getInsertionIndexForGroup(JMenu menu, int group, boolean isGroupSeparatorExpert) {
         if (group < 0)
             return -1;
@@ -619,4 +641,7 @@
         while (group > 0) {
             menu.addSeparator();
+            if (isGroupSeparatorExpert) {
+                ExpertToggleAction.addVisibilitySwitcher(menu.getMenuComponent(menu.getMenuComponentCount() - 1));
+            }
             group--;
             i++;
@@ -832,5 +857,5 @@
         // -- changeset manager toggle action
         final JCheckBoxMenuItem mi = MainMenu.addWithCheckbox(windowMenu, changesetManager,
-                MainMenu.WINDOW_MENU_GROUP.ALWAYS);
+                MainMenu.WINDOW_MENU_GROUP.ALWAYS, true, false);
         changesetManager.addButtonModel(mi.getModel());
 
Index: trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 15632)
+++ trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 15633)
@@ -44,4 +44,5 @@
 import javax.swing.plaf.basic.BasicSplitPaneUI;
 
+import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.actions.mapmode.DeleteAction;
 import org.openstreetmap.josm.actions.mapmode.DrawAction;
@@ -671,23 +672,25 @@
             JPopupMenu menu = new JPopupMenu();
             for (HideableButton b : buttons) {
-                final HideableButton t = b;
-                menu.add(new JCheckBoxMenuItem(new AbstractAction() {
-                    {
-                        putValue(NAME, t.getActionName());
-                        putValue(SMALL_ICON, t.getIcon());
-                        putValue(SELECTED_KEY, t.isButtonVisible());
-                        putValue(SHORT_DESCRIPTION, tr("Hide or show this toggle button"));
-                    }
-
-                    @Override
-                    public void actionPerformed(ActionEvent e) {
-                        if ((Boolean) getValue(SELECTED_KEY)) {
-                            t.showButton();
-                        } else {
-                            t.hideButton();
+                if (!b.isExpert() || ExpertToggleAction.isExpert()) {
+                    final HideableButton t = b;
+                    menu.add(new JCheckBoxMenuItem(new AbstractAction() {
+                        {
+                            putValue(NAME, t.getActionName());
+                            putValue(SMALL_ICON, t.getIcon());
+                            putValue(SELECTED_KEY, t.isButtonVisible());
+                            putValue(SHORT_DESCRIPTION, tr("Hide or show this toggle button"));
                         }
-                        validateToolBarsVisibility();
-                    }
-                }));
+
+                        @Override
+                        public void actionPerformed(ActionEvent e) {
+                            if ((Boolean) getValue(SELECTED_KEY)) {
+                                t.showButton();
+                            } else {
+                                t.hideButton();
+                            }
+                            validateToolBarsVisibility();
+                        }
+                    }));
+                }
             }
             if (button != null && button.isShowing()) {
Index: trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 15632)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java	(revision 15633)
@@ -266,5 +266,5 @@
         windowMenuItem = MainMenu.addWithCheckbox(MainApplication.getMenu().windowMenu,
                 (JosmAction) getToggleAction(),
-                MainMenu.WINDOW_MENU_GROUP.TOGGLE_DIALOG);
+                MainMenu.WINDOW_MENU_GROUP.TOGGLE_DIALOG, false, true);
     }
 
