Index: org/openstreetmap/josm/actions/DialogsToggleAction.java
===================================================================
--- org/openstreetmap/josm/actions/DialogsToggleAction.java	(revision 0)
+++ org/openstreetmap/josm/actions/DialogsToggleAction.java	(revision 0)
@@ -0,0 +1,86 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions;
+
+import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.ButtonModel;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.Shortcut;
+
+public class DialogsToggleAction extends JosmAction {
+    private final List<ButtonModel> buttonModels = new ArrayList<ButtonModel>();
+    private boolean selected;
+
+    public DialogsToggleAction() {
+        super(
+                tr("Toggle dialogs panel"),
+                null, /* no icon */
+                tr("Toggle dialogs panel, maximize mapview"),
+                Shortcut.registerShortcut("menu:view:dialogspanel", tr("Toggle dialogs panel"),KeyEvent.VK_TAB, Shortcut.DIRECT),
+                false /* register */
+        );
+        putValue("help", ht("/Action/ToggleDialogsPanel"));
+        putValue("toolbar", "dialogspanel");
+        Main.toolbar.register(this);
+        selected = Main.pref.getBoolean("draw.dialogspanel", true);
+        notifySelectedState();
+    }
+
+    public void addButtonModel(ButtonModel model) {
+        if (model != null && !buttonModels.contains(model)) {
+            buttonModels.add(model);
+        }
+    }
+
+    public void removeButtonModel(ButtonModel model) {
+        if (model != null && buttonModels.contains(model)) {
+            buttonModels.remove(model);
+        }
+    }
+
+    protected void notifySelectedState() {
+        for (ButtonModel model: buttonModels) {
+            if (model.isSelected() != selected) {
+                model.setSelected(selected);
+            }
+        }
+    }
+
+    protected void toggleSelectedState() {
+        selected = !selected;
+        Main.pref.put("draw.dialogspanel", selected);
+        notifySelectedState();
+        setMode();
+    }
+
+    public void initial() {
+        if(selected) {
+            setMode();
+        }
+    }
+
+    protected void setMode() {
+        if (Main.isDisplayingMapView()) {
+            Main.map.setDialogsPanelVisible(selected);
+            Main.map.statusLine.setVisible(selected || Main.pref.getBoolean("statusbar.always-visible", true));
+            Main.toolbar.control.setVisible(selected || Main.pref.getBoolean("toolbar.always-visible", true));
+            Main.main.menu.setVisible(selected || Main.pref.getBoolean("menu.always-visible", true));
+            // sideToolBar listens to preference changes, use it here
+            if (!Main.pref.getBoolean("sidetoolbar.always-visible", true)) {
+                Main.pref.put("sidetoolbar.visible", selected);
+            }
+        }
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        toggleSelectedState();
+    }
+}

Property changes on: org\openstreetmap\josm\actions\DialogsToggleAction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 5957)
+++ org/openstreetmap/josm/actions/mapmode/DrawAction.java	(working copy)
@@ -127,7 +127,7 @@
                 mapFrame, ImageProvider.getCursor("crosshair", null));
 
         snappingShortcut = Shortcut.registerShortcut("mapmode:drawanglesnapping",
-                tr("Mode: Draw Angle snapping"), KeyEvent.VK_TAB, Shortcut.DIRECT);
+                tr("Mode: Draw Angle snapping"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
         snapChangeAction = new SnapChangeAction();
         snapCheckboxMenuItem = addMenuItem();
         snapHelper.setMenuCheckBox(snapCheckboxMenuItem);
Index: org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- org/openstreetmap/josm/gui/MainMenu.java	(revision 5957)
+++ org/openstreetmap/josm/gui/MainMenu.java	(working copy)
@@ -33,6 +33,7 @@
 import org.openstreetmap.josm.actions.CreateCircleAction;
 import org.openstreetmap.josm.actions.CreateMultipolygonAction;
 import org.openstreetmap.josm.actions.DeleteAction;
+import org.openstreetmap.josm.actions.DialogsToggleAction;
 import org.openstreetmap.josm.actions.DistributeAction;
 import org.openstreetmap.josm.actions.DownloadAction;
 import org.openstreetmap.josm.actions.DownloadPrimitiveAction;
@@ -62,8 +63,10 @@
 import org.openstreetmap.josm.actions.OpenFileAction;
 import org.openstreetmap.josm.actions.OpenLocationAction;
 import org.openstreetmap.josm.actions.OrthogonalizeAction;
+import org.openstreetmap.josm.actions.OrthogonalizeAction.Undo;
 import org.openstreetmap.josm.actions.PasteAction;
 import org.openstreetmap.josm.actions.PasteTagsAction;
+import org.openstreetmap.josm.actions.PreferenceToggleAction;
 import org.openstreetmap.josm.actions.PreferencesAction;
 import org.openstreetmap.josm.actions.PurgeAction;
 import org.openstreetmap.josm.actions.RedoAction;
@@ -90,8 +93,6 @@
 import org.openstreetmap.josm.actions.WireframeToggleAction;
 import org.openstreetmap.josm.actions.ZoomInAction;
 import org.openstreetmap.josm.actions.ZoomOutAction;
-import org.openstreetmap.josm.actions.OrthogonalizeAction.Undo;
-import org.openstreetmap.josm.actions.PreferenceToggleAction;
 import org.openstreetmap.josm.actions.audio.AudioBackAction;
 import org.openstreetmap.josm.actions.audio.AudioFasterAction;
 import org.openstreetmap.josm.actions.audio.AudioFwdAction;
@@ -229,6 +230,7 @@
     public final JumpToAction jumpToAct = new JumpToAction();
 
     public final TaggingPresetSearchAction presetSearchAction = new TaggingPresetSearchAction();
+    public final DialogsToggleAction dialogsToggleAction = new DialogsToggleAction();
     public FullscreenToggleAction fullscreenToggleAction = null;
 
     /** this menu listener hides unnecessary JSeparators in a menu list but does not remove them.
@@ -514,6 +516,13 @@
             fullscreen.setAccelerator(fullscreenToggleAction.getShortcut().getKeyStroke());
             fullscreenToggleAction.addButtonModel(fullscreen.getModel());
         }
+
+        // -- dialogs panel toggle action
+        final JCheckBoxMenuItem dialogspanel = new JCheckBoxMenuItem(dialogsToggleAction);
+        dialogspanel.setAccelerator(dialogsToggleAction.getShortcut().getKeyStroke());
+        dialogsToggleAction.addButtonModel(dialogspanel.getModel());
+        viewMenu.add(dialogspanel);
+
         viewMenu.addSeparator();
         add(viewMenu, info);
         add(viewMenu, infoweb);
Index: org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
===================================================================
--- org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(revision 5957)
+++ org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java	(working copy)
@@ -418,7 +418,7 @@
 
         @Override
         public void setupDialog() {
-            setResizable(false);
+            //setResizable(false);
             super.setupDialog();
             
             setRememberWindowGeometry(getClass().getName() + ".geometry",
Index: org/openstreetmap/josm/gui/MapView.java
===================================================================
--- org/openstreetmap/josm/gui/MapView.java	(revision 5957)
+++ org/openstreetmap/josm/gui/MapView.java	(working copy)
@@ -22,7 +22,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.Enumeration;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -779,16 +778,14 @@
          * the user to re-select the tool after i.e. moving a layer. While testing I found
          * that I switch layers and actions at the same time and it was annoying to mind the
          * order. This way it works as visual clue for new users */
-        for (Enumeration<AbstractButton> e = Main.map.toolGroup.getElements() ; e.hasMoreElements() ;) {
-            AbstractButton button = e.nextElement();
-            MapMode mode = (MapMode)button.getAction();
-            boolean isLayerSupported = mode.layerIsSupported(layer);
-            button.setEnabled(isLayerSupported);
-            // Also update associated shortcut (fix #6876)
-            if (isLayerSupported) {
-                Main.registerActionShortcut(mode, mode.getShortcut());
+        for (AbstractButton b: Main.map.allMapModeButtons) {
+            MapMode mode = (MapMode)b.getAction();
+            if (mode.layerIsSupported(layer)) {
+                Main.registerActionShortcut(mode, mode.getShortcut()); //fix #6876
+                b.setEnabled(true);
             } else {
                 Main.unregisterShortcut(mode.getShortcut());
+                b.setEnabled(false);
             }
         }
         AudioPlayer.reset();
Index: org/openstreetmap/josm/gui/ExtendedDialog.java
===================================================================
--- org/openstreetmap/josm/gui/ExtendedDialog.java	(revision 5957)
+++ org/openstreetmap/josm/gui/ExtendedDialog.java	(working copy)
@@ -3,7 +3,9 @@
 
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.AWTKeyStroke;
 import java.awt.Component;
+import java.awt.DefaultKeyboardFocusManager;
 import java.awt.Dimension;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
@@ -14,9 +16,11 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Set;
 
 import javax.swing.AbstractAction;
 import javax.swing.Action;
+import javax.swing.FocusManager;
 import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
@@ -100,6 +104,13 @@
      */
     private boolean placeContentInScrollPane;
 
+    /**
+     * TAB is de-registered as a defaultFocusTraversalKey and reused
+     * in the main application to quickly toggle dialogs.  Within
+     * ExtendedDialogs however, we'll want TAB to traverse focus.
+     */
+    private static Set<AWTKeyStroke> defaultFocusTraversalKeys = (new DefaultKeyboardFocusManager()).getDefaultFocusTraversalKeys(FocusManager.FORWARD_TRAVERSAL_KEYS);
+
     // For easy access when inherited
     protected Insets contentInsets = new Insets(10,5,0,5);
     protected ArrayList<JButton> buttons = new ArrayList<JButton>();
@@ -147,6 +158,7 @@
             setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
         }
         this.disposeOnClose = disposeOnClose;
+        setFocusTraversalKeys(FocusManager.FORWARD_TRAVERSAL_KEYS, defaultFocusTraversalKeys);
     }
 
     /**
@@ -508,9 +520,8 @@
      * @param togglePref  The preference to save the checkbox state to
      */
     public ExtendedDialog toggleEnable(String togglePref) {
-        if (!modal) {
+        if (!modal)
             throw new IllegalArgumentException();
-        }
         this.toggleable = true;
         this.togglePref = togglePref;
         return this;
Index: org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- org/openstreetmap/josm/gui/MapStatus.java	(revision 5957)
+++ org/openstreetmap/josm/gui/MapStatus.java	(working copy)
@@ -16,6 +16,7 @@
 import java.awt.SystemColor;
 import java.awt.Toolkit;
 import java.awt.event.AWTEventListener;
+import java.awt.event.ActionEvent;
 import java.awt.event.InputEvent;
 import java.awt.event.KeyAdapter;
 import java.awt.event.KeyEvent;
@@ -28,14 +29,19 @@
 import java.util.ConcurrentModificationException;
 import java.util.List;
 
+import javax.swing.AbstractAction;
 import javax.swing.BorderFactory;
+import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
 import javax.swing.JProgressBar;
 import javax.swing.JScrollPane;
 import javax.swing.Popup;
 import javax.swing.PopupFactory;
 import javax.swing.UIManager;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.coor.CoordinateFormat;
@@ -46,9 +52,9 @@
 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor;
 import org.openstreetmap.josm.gui.progress.PleaseWaitProgressMonitor.ProgressMonitorDialog;
 import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.JosmTextField;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
-import org.openstreetmap.josm.gui.widgets.JosmTextField;
 
 /**
  * A component that manages some status information display about the map.
@@ -280,7 +286,9 @@
 
                                     // Set the text label in the bottom status bar
                                     // "if mouse moved only" was added to stop heap growing
-                                    if (!mouseNotMoved) statusBarElementUpdate(ms);
+                                    if (!mouseNotMoved) {
+                                        statusBarElementUpdate(ms);
+                                    }
 
 
                                     // Popup Information
@@ -685,6 +693,30 @@
         this.mv = mapFrame.mapView;
         this.collector = new Collector(mapFrame);
 
+        // Context menu of status bar
+        setComponentPopupMenu(new JPopupMenu() {
+            JCheckBoxMenuItem doNotHide = new JCheckBoxMenuItem(new AbstractAction(tr("Do not hide status bar")) {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
+                    Main.pref.put("statusbar.always-visible", sel);
+                }
+            });
+            {
+                addPopupMenuListener(new PopupMenuListener() {
+                    @Override
+                    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
+                        doNotHide.setSelected(Main.pref.getBoolean("statusbar.always-visible", true));
+                    }
+                    @Override
+                    public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
+                    @Override
+                    public void popupMenuCanceled(PopupMenuEvent e) {}
+                });
+                add(doNotHide);
+            }
+        });
+
         lonText.addMouseListener(Main.main.menu.jumpToAct);
         latText.addMouseListener(Main.main.menu.jumpToAct);
         
@@ -709,6 +741,15 @@
         setLayout(new GridBagLayout());
         setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
 
+        latText.setInheritsPopupMenu(true);
+        lonText.setInheritsPopupMenu(true);
+        headingText.setInheritsPopupMenu(true);
+        angleText.setInheritsPopupMenu(true);
+        distText.setInheritsPopupMenu(true);
+        nameText.setInheritsPopupMenu(true);
+        //helpText.setInheritsPopupMenu(true);
+        //progressBar.setInheritsPopupMenu(true);
+
         add(latText, GBC.std());
         add(lonText, GBC.std().insets(3,0,0,0));
         add(headingText, GBC.std().insets(3,0,0,0));
Index: org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 5957)
+++ org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(working copy)
@@ -29,12 +29,14 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.DefaultListCellRenderer;
 import javax.swing.DefaultListModel;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
+import javax.swing.JCheckBoxMenuItem;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
 import javax.swing.JList;
@@ -50,6 +52,8 @@
 import javax.swing.TransferHandler;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
 import javax.swing.event.TreeSelectionEvent;
 import javax.swing.event.TreeSelectionListener;
 import javax.swing.table.AbstractTableModel;
@@ -65,14 +69,12 @@
 import org.openstreetmap.josm.actions.ParameterizedAction;
 import org.openstreetmap.josm.actions.ParameterizedActionDecorator;
 import org.openstreetmap.josm.gui.tagging.TaggingPreset;
-import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.openstreetmap.josm.tools.Shortcut;
 
 public class ToolbarPreferences implements PreferenceSettingFactory {
 
-
     private static final String EMPTY_TOOLBAR_MARKER = "<!-empty-!>";
 
     public static class ActionDefinition {
@@ -227,10 +229,11 @@
                     String paramName = readTillChar('=', '=');
                     skip('=');
                     String paramValue = readTillChar(',','}');
-                    if ("icon".equals(paramName) && paramValue.length() > 0)
+                    if ("icon".equals(paramName) && paramValue.length() > 0) {
                         result.setIcon(paramValue);
-                    else if("name".equals(paramName) && paramValue.length() > 0)
+                    } else if("name".equals(paramName) && paramValue.length() > 0) {
                         result.setName(paramValue);
+                    }
                     skip(',');
                 }
                 skip('}');
@@ -293,9 +296,10 @@
                     escape(tmp);
                     first = false;
                 }
-                if(!first)
+                if(!first) {
                     result.append('}');
             }
+            }
 
             return result.toString();
         }
@@ -338,9 +342,10 @@
                     default:
                         return null;
                     }
-                } else
+                } else {
                     rowIndex -= 2;
             }
+            }
             ActionParameter<Object> param = getParam(rowIndex);
             switch (columnIndex) {
             case 0:
@@ -367,9 +372,10 @@
                 } else if (rowIndex == 1) {
                      currentAction.setIcon((String)aValue);
                      return;
-                } else
+                } else {
                     rowIndex -= 2;
             }
+            }
             ActionParameter<Object> param = getParam(rowIndex);
             currentAction.getParameters().put(param.getName(), param.readFromString((String)aValue));
         }
@@ -382,46 +388,82 @@
 
     }
 
-    private static class ToolbarPopupMenu extends JPopupMenu {
-        public ToolbarPopupMenu(final ActionDefinition action) {
+    private class ToolbarPopupMenu extends JPopupMenu  {
+        ActionDefinition act;
 
-            if(action != null) {
-                add(tr("Remove from toolbar",action.getDisplayName()))
-                        .addActionListener(new ActionListener() {
-                            @Override public void actionPerformed(ActionEvent e) {
+        private void setActionAndAdapt(ActionDefinition action) {
+            this.act = action;
+            doNotHide.setSelected(Main.pref.getBoolean("toolbar.always-visible", true));
+            remove.setVisible(act!=null);
+            shortcutEdit.setVisible(act!=null);
+        }
+
+        JMenuItem remove = new JMenuItem(new AbstractAction(tr("Remove from toolbar")) {
+            @Override
+            public void actionPerformed(ActionEvent e) {
                                 Collection<String> t = new LinkedList<String>(getToolString());
                                 ActionParser parser = new ActionParser(null);
                                 // get text definition of current action
-                                String res = parser.saveAction(action);
+                String res = parser.saveAction(act);
                                 // remove the button from toolbar preferences
                                 t.remove( res );
                                 Main.pref.putCollection("toolbar", t);
                                 Main.toolbar.refreshToolbarControl();
                             }
                 });
-            }
             
-            add(tr("Configure toolbar")).addActionListener(new ActionListener() {
-                @Override public void actionPerformed(ActionEvent e) {
+        JMenuItem configure = new JMenuItem(new AbstractAction(tr("Configure toolbar")) {
+            @Override
+            public void actionPerformed(ActionEvent e) {
                     final PreferenceDialog p =new PreferenceDialog(Main.parent);
                     p.selectPreferencesTabByName("toolbar");
                     p.setVisible(true);
                 }
             });
 
-            add(tr("Edit shortcut")).addActionListener(new ActionListener() {
-                @Override public void actionPerformed(ActionEvent e) {
+        JMenuItem shortcutEdit = new JMenuItem(new AbstractAction(tr("Edit shortcut")) {
+            @Override
+            public void actionPerformed(ActionEvent e) {
                     final PreferenceDialog p =new PreferenceDialog(Main.parent);
-                    p.getTabbedPane().getShortcutPreference().setDefaultFilter(action.getDisplayName());
+                p.getTabbedPane().getShortcutPreference().setDefaultFilter(act.getDisplayName());
                     p.selectPreferencesTabByName("shortcuts");
                     p.setVisible(true);
-                    // refresh toolbar to accept changes of shortcuts without restart
+                // refresh toolbar to try using changed shortcuts without restart
                     Main.toolbar.refreshToolbarControl(); 
                 }
             });
+
+        JCheckBoxMenuItem doNotHide = new JCheckBoxMenuItem(new AbstractAction(tr("Do not hide toolbar and menu")) {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
+                Main.pref.put("toolbar.always-visible", sel);
+                Main.pref.put("menu.always-visible", sel);
         }
+        });
+        {
+            addPopupMenuListener(new PopupMenuListener() {
+                @Override
+                public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
+                    setActionAndAdapt(buttonActions.get(
+                            ((JPopupMenu)e.getSource()).getInvoker()
+                    ));
     }
+                @Override
+                public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
 
+                @Override
+                public void popupMenuCanceled(PopupMenuEvent e) {}
+            });
+            add(remove);
+            add(configure);
+            add(shortcutEdit);
+            add(doNotHide);
+        }
+    }
+
+    private ToolbarPopupMenu popupMenu = new ToolbarPopupMenu();
+
     /**
      * Key: Registered name (property "toolbar" of action).
      * Value: The action to execute.
@@ -432,6 +474,7 @@
     private DefaultMutableTreeNode rootActionsNode = new DefaultMutableTreeNode(tr("Actions"));
 
     public JToolBar control = new JToolBar();
+    private HashMap<Object, ActionDefinition> buttonActions = new HashMap<Object, ActionDefinition>(30);
 
     @Override
     public PreferenceSetting createPreferenceSetting() {
@@ -825,10 +868,11 @@
                     t.add("|");
                 } else {
                     String res = parser.saveAction(action);
-                    if(res != null)
+                    if(res != null) {
                         t.add(res);
                 }
             }
+            }
             if (t.isEmpty()) {
                 t = Collections.singletonList(EMPTY_TOOLBAR_MARKER);
             }
@@ -841,7 +885,7 @@
 
     public ToolbarPreferences() {
         control.setFloatable(false);
-        control.addMouseListener(new PopupMenuLauncher(new ToolbarPopupMenu(null)));
+        control.setComponentPopupMenu(popupMenu);
     }
 
     private void loadAction(DefaultMutableTreeNode node, MenuElement menu) {
@@ -978,12 +1022,14 @@
      */
     public void refreshToolbarControl() {
         control.removeAll();
+        buttonActions.clear();
 
         for (ActionDefinition action : getDefinedActions()) {
             if (action.isSeparator()) {
                 control.addSeparator();
             } else {
                 final JButton b = addButtonAndShortcut(action);
+                buttonActions.put(b, action);
                 
                 Icon i = action.getDisplayIcon();
                 if (i != null) {
@@ -1000,7 +1046,7 @@
                         }
                     });
                 }
-                b.addMouseListener(new PopupMenuLauncher( new ToolbarPopupMenu(action)));
+                b.setInheritsPopupMenu(true);
             }
         }
         control.setVisible(control.getComponentCount() != 0);
@@ -1013,8 +1059,10 @@
         Shortcut sc = null;
         if (action.getAction() instanceof JosmAction) {
             sc = ((JosmAction) action.getAction()).getShortcut();
-            if (sc.getAssignedKey() == KeyEvent.CHAR_UNDEFINED) sc = null;
+            if (sc.getAssignedKey() == KeyEvent.CHAR_UNDEFINED) {
+                sc = null;
         }
+        }
 
         long paramCode = 0;
         if (action.hasParameters()) {
@@ -1022,12 +1070,18 @@
         }
         
         String tt = action.getDisplayTooltip();
-        if (tt==null) tt="";
+        if (tt==null) {
+            tt="";
+        }
 
         if (sc == null || paramCode != 0) {
             String name = (String) action.getAction().getValue("toolbar");
-            if (name==null) name=action.getDisplayName();
-            if (paramCode!=0) name = name+paramCode;
+            if (name==null) {
+                name=action.getDisplayName();
+            }
+            if (paramCode!=0) {
+                name = name+paramCode;
+            }
             String desc = action.getDisplayName() + ((paramCode==0)?"":action.parameters.toString());
             sc = Shortcut.registerShortcut("toolbar:"+name, tr("Toolbar: {0}", desc),
                 KeyEvent.CHAR_UNDEFINED, Shortcut.NONE);
@@ -1043,7 +1097,9 @@
             }
         }
         
-        if (!tt.isEmpty()) b.setToolTipText(tt);
+        if (!tt.isEmpty()) {
+            b.setToolTipText(tt);
+        }
         return b;
     }
 
Index: org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- org/openstreetmap/josm/gui/MapFrame.java	(revision 5957)
+++ org/openstreetmap/josm/gui/MapFrame.java	(working copy)
@@ -9,6 +9,7 @@
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.GridBagLayout;
+import java.awt.KeyboardFocusManager;
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
@@ -17,6 +18,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -36,6 +38,8 @@
 import javax.swing.KeyStroke;
 import javax.swing.SwingUtilities;
 import javax.swing.border.Border;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
 import javax.swing.plaf.basic.BasicSplitPaneDivider;
 import javax.swing.plaf.basic.BasicSplitPaneUI;
 
@@ -69,9 +73,9 @@
 import org.openstreetmap.josm.gui.dialogs.ValidatorDialog;
 import org.openstreetmap.josm.gui.dialogs.properties.PropertiesDialog;
 import org.openstreetmap.josm.gui.layer.Layer;
-import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.Destroyable;
 import org.openstreetmap.josm.tools.GBC;
+import org.openstreetmap.josm.tools.Shortcut;
 
 /**
  * One Map frame with one dataset behind. This is the container gui class whose
@@ -86,22 +90,34 @@
      */
     public MapMode mapMode;
 
-    private final List<MapMode> mapModes = new ArrayList<MapMode>();
     /**
      * The view control displayed.
      */
     public final MapView mapView;
+
     /**
-     * The toolbar with the action icons. To add new toggle dialog actions, use addToggleDialog
-     * instead of adding directly to this list. To add a new mode use addMapMode.
+     * The toolbar with the action icons. To add new toggle dialog buttons,
+     * use addToggleDialog, to add a new map mode button use addMapMode.
      */
-    private JToolBar toolBarActions = new JToolBar(JToolBar.VERTICAL);
-    private JToolBar toolBarToggle = new JToolBar(JToolBar.VERTICAL);
-    /**
-     * The status line below the map
-     */
-    public MapStatus statusLine;
+    private JComponent sideToolBar = new JToolBar(JToolBar.VERTICAL);
+    private final ButtonGroup toolBarActionsGroup = new ButtonGroup();
+    private final JToolBar toolBarActions = new JToolBar(JToolBar.VERTICAL);
+    private final JToolBar toolBarToggle = new JToolBar(JToolBar.VERTICAL);
 
+    private final List<ToggleDialog> allDialogs = new ArrayList<ToggleDialog>();
+    private final List<MapMode> mapModes = new ArrayList<MapMode>();
+    private final List<IconToggleButton> allDialogButtons = new ArrayList<IconToggleButton>();
+    public final List<IconToggleButton> allMapModeButtons = new ArrayList<IconToggleButton>();
+
+    private final ListAllButtonsAction listAllDialogsAction = new ListAllButtonsAction(allDialogButtons);
+    private final ListAllButtonsAction listAllMapModesAction = new ListAllButtonsAction(allMapModeButtons);
+    private final JButton listAllToggleDialogsButton = new JButton(listAllDialogsAction);
+    private final JButton listAllMapModesButton = new JButton(listAllMapModesAction);
+    {
+        listAllDialogsAction.setButton(listAllToggleDialogsButton);
+        listAllMapModesAction.setButton(listAllMapModesButton);
+    }
+
     // Toggle dialogs
     public ConflictDialog conflictDialog;
     public FilterDialog filterDialog;
@@ -112,38 +128,27 @@
 
     // Map modes
     public final SelectAction mapModeSelect;
+    private final Map<Layer, MapMode> lastMapMode = new HashMap<Layer, MapMode>();
     private final MapMode mapModeDraw;
     private final MapMode mapModeZoom;
 
     /**
-     * The panel list of all toggle dialog icons. To add new toggle dialog actions, use addToggleDialog
-     * instead of adding directly to this list.
+     * The status line below the map
      */
-    private List<ToggleDialog> allDialogs = new ArrayList<ToggleDialog>();
+    public MapStatus statusLine;
+
+    /**
+     * The split pane with the mapview (leftPanel) and toggle dialogs (dialogsPanel).
+     */
+    private final JSplitPane splitPane;
     private final JPanel leftPanel;
     private final DialogsPanel dialogsPanel;
 
-    public final ButtonGroup toolGroup = new ButtonGroup();
-
-    private List<IconToggleButton> allDialogButtons = new ArrayList<IconToggleButton>();
-    private List<IconToggleButton> allMapModeButtons = new ArrayList<IconToggleButton>();
-
-    private final ListAllButtonsAction listAllDialogsAction = new ListAllButtonsAction(allDialogButtons);
-    private final ListAllButtonsAction listAllMapModesAction = new ListAllButtonsAction(allMapModeButtons);
-    private final JButton listAllToggleDialogsButton = new JButton(listAllDialogsAction);
-    private final JButton listAllMapModesButton = new JButton(listAllMapModesAction);
-    {
-        listAllDialogsAction.setButton(listAllToggleDialogsButton);
-        listAllMapModesAction.setButton(listAllMapModesButton);
-    }
-
     /**
      * Default width of the toggle dialog area.
      */
     public static final int DEF_TOGGLE_DLG_WIDTH = 330;
 
-    private final Map<Layer, MapMode> lastMapMode = new HashMap<Layer, MapMode>();
-
     /**
      * Constructs a new {@code MapFrame}.
      * @param contentPane The content pane used to register shortcuts in its
@@ -156,30 +161,16 @@
         setLayout(new BorderLayout());
 
         mapView = new MapView(contentPane, viewportData);
-
         new FileDrop(mapView);
 
+        splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
+
         leftPanel = new JPanel();
         leftPanel.setLayout(new GridBagLayout());
-
         leftPanel.add(mapView, GBC.std().fill());
+        splitPane.setLeftComponent(leftPanel);
 
-        // toolbar
-        toolBarActions.setFloatable(false);
-        addMapMode(new IconToggleButton(mapModeSelect = new SelectAction(this)));
-        addMapMode(new IconToggleButton(new LassoModeAction(), true));
-        addMapMode(new IconToggleButton(mapModeDraw = new DrawAction(this)));
-        addMapMode(new IconToggleButton(mapModeZoom = new ZoomAction(this)));
-        addMapMode(new IconToggleButton(new DeleteAction(this), true));
-        addMapMode(new IconToggleButton(new ParallelWayAction(this), true));
-        addMapMode(new IconToggleButton(new ExtrudeAction(this), true));
-        addMapMode(new IconToggleButton(new ImproveWayAccuracyAction(Main.map), true));
-
-        toolGroup.setSelected(((AbstractButton)toolBarActions.getComponent(0)).getModel(), true);
-
-        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
         dialogsPanel = new DialogsPanel(splitPane);
-        splitPane.setLeftComponent(leftPanel);
         splitPane.setRightComponent(dialogsPanel);
 
         /**
@@ -211,11 +202,22 @@
 
         dialogsPanel.setLayout(new BoxLayout(dialogsPanel, BoxLayout.Y_AXIS));
         dialogsPanel.setPreferredSize(new Dimension(Main.pref.getInteger("toggleDialogs.width",DEF_TOGGLE_DLG_WIDTH), 0));
-
         dialogsPanel.setMinimumSize(new Dimension(24, 0));
         mapView.setMinimumSize(new Dimension(10,0));
 
-        toolBarToggle.setFloatable(false);
+        // toolBarActions, map mode buttons
+        addMapMode(new IconToggleButton(mapModeSelect = new SelectAction(this)));
+        addMapMode(new IconToggleButton(new LassoModeAction(), true));
+        addMapMode(new IconToggleButton(mapModeDraw = new DrawAction(this)));
+        addMapMode(new IconToggleButton(mapModeZoom = new ZoomAction(this)));
+        addMapMode(new IconToggleButton(new DeleteAction(this), true));
+        addMapMode(new IconToggleButton(new ParallelWayAction(this), true));
+        addMapMode(new IconToggleButton(new ExtrudeAction(this), true));
+        addMapMode(new IconToggleButton(new ImproveWayAccuracyAction(Main.map), true));
+        toolBarActionsGroup.setSelected(allMapModeButtons.get(0).getModel(), true);
+        toolBarActions.setFloatable(false);
+
+        // toolBarToggles, toggle dialog buttons
         LayerListDialog.createInstance(this);
         addToggleDialog(LayerListDialog.getInstance());
         addToggleDialog(propertiesDialog = new PropertiesDialog(this));
@@ -229,11 +231,16 @@
         addToggleDialog(filterDialog = new FilterDialog());
         addToggleDialog(new ChangesetDialog(this), true);
         addToggleDialog(new MapPaintDialog());
+        toolBarToggle.setFloatable(false);
 
         // status line below the map
         statusLine = new MapStatus(this);
         MapView.addLayerChangeListener(this);
+        // unregister TAB key if needed
+        if (Shortcut.findShortcut(KeyEvent.VK_TAB, 0) != null) {
+            unregisterTabKey();
     }
+    }
 
     public boolean selectSelectTool(boolean onlyIfModeless) {
         if(onlyIfModeless && !Main.pref.getBoolean("modeless", false))
@@ -257,9 +264,22 @@
     }
 
     /**
+     * Free tabulator key (call if someone else needs it)
+     */
+    public final void unregisterTabKey() {
+        System.out.println("Tab key unregistered");
+        HashSet<KeyStroke> ks = new HashSet<KeyStroke>(1);
+        ks.add(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, KeyEvent.CTRL_DOWN_MASK));
+        KeyboardFocusManager kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
+        kfm.setDefaultFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, ks);
+        splitPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, ks);
+    }
+
+    /**
      * Called as some kind of destructor when the last layer has been removed.
      * Delegates the call to all Destroyables within this component (e.g. MapModes)
      */
+    @Override
     public void destroy() {
         MapView.removeLayerChangeListener(this);
         dialogsPanel.destroy();
@@ -309,7 +329,7 @@
     public IconToggleButton addToggleDialog(final ToggleDialog dlg, boolean isExpert) {
         final IconToggleButton button = new IconToggleButton(dlg.getToggleAction(), isExpert);
         button.setShowHideButtonListener(dlg);
-        addHideContextMenu(button);
+        button.setInheritsPopupMenu(true);
         dlg.setButton(button);
         toolBarToggle.add(button);
         allDialogs.add(dlg);
@@ -324,15 +344,15 @@
 
 
     public void addMapMode(IconToggleButton b) {
-        toolBarActions.add(b);
-        toolGroup.add(b);
-        allMapModeButtons.add(b);
         if (b.getAction() instanceof MapMode) {
             mapModes.add((MapMode) b.getAction());
         } else
             throw new IllegalArgumentException("MapMode action must be subclass of MapMode");
-        addHideContextMenu(b);
+        allMapModeButtons.add(b);
+        toolBarActionsGroup.add(b);
+        toolBarActions.add(b);
         b.applyButtonHiddenPreferences();
+        b.setInheritsPopupMenu(true);
     }
 
     /**
@@ -391,90 +411,127 @@
      */
     public void fillPanel(Container panel) {
         panel.add(this, BorderLayout.CENTER);
-        JToolBar jb = new JToolBar(JToolBar.VERTICAL);
-        jb.setFloatable(false);
+
+        /**
+         * sideToolBar: add map modes icons
+         */
+        if(Main.pref.getBoolean("sidetoolbar.mapmodes.visible", true)) {
         toolBarActions.setAlignmentX(0.5f);
-        jb.add(toolBarActions);
+            toolBarActions.setInheritsPopupMenu(true);
+            sideToolBar.add(toolBarActions);
         listAllMapModesButton.setAlignmentX(0.5f);
         listAllMapModesButton.setBorder(null);
         listAllMapModesButton.setFont(listAllMapModesButton.getFont().deriveFont(Font.PLAIN));
-        jb.add(listAllMapModesButton);
+            listAllMapModesButton.setInheritsPopupMenu(true);
+            sideToolBar.add(listAllMapModesButton);
+        }
 
-        if(Main.pref.getBoolean("sidetoolbar.togglevisible", true)) {
-            jb.addSeparator(new Dimension(0,18));
+        /**
+         * sideToolBar: add toggle dialogs icons
+         */
+        if(Main.pref.getBoolean("sidetoolbar.toggledialogs.visible", true)) {
+            ((JToolBar)sideToolBar).addSeparator(new Dimension(0,18));
             toolBarToggle.setAlignmentX(0.5f);
-            jb.add(toolBarToggle);
+            toolBarToggle.setInheritsPopupMenu(true);
+            sideToolBar.add(toolBarToggle);
             listAllToggleDialogsButton.setAlignmentX(0.5f);
             listAllToggleDialogsButton.setBorder(null);
             listAllToggleDialogsButton.setFont(listAllToggleDialogsButton.getFont().deriveFont(Font.PLAIN));
-            jb.add(listAllToggleDialogsButton);
+            listAllToggleDialogsButton.setInheritsPopupMenu(true);
+            sideToolBar.add(listAllToggleDialogsButton);
         }
 
-        final Component toToggle;
-        if (Main.pref.getBoolean("sidetoolbar.scrollable", true)) {
-            final ScrollViewport svp = new ScrollViewport(jb, ScrollViewport.VERTICAL_DIRECTION);
-            toToggle = svp;
-            panel.add(svp, BorderLayout.WEST);
-            jb.addMouseWheelListener(new MouseWheelListener() {
-
-                public void mouseWheelMoved(MouseWheelEvent e) {
-                    svp.scroll(0, e.getUnitsToScroll() * 5);
+        /**
+         * sideToolBar: add dynamic popup menu
+         */
+        sideToolBar.setComponentPopupMenu(new JPopupMenu() {
+            final int staticMenuEntryCount = 2;
+            JCheckBoxMenuItem doNotHide = new JCheckBoxMenuItem(new AbstractAction(tr("Do not hide toolbar on TAB")) {
+                @Override
+                public void actionPerformed(ActionEvent e) {
+                    boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState();
+                    Main.pref.put("sidetoolbar.always-visible", sel);
                 }
             });
-        } else {
-            toToggle = jb;
-            panel.add(jb, BorderLayout.WEST);
+            {
+                addPopupMenuListener(new PopupMenuListener() {
+                    @Override
+                    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
+                        final Object src = ((JPopupMenu)e.getSource()).getInvoker();
+                        if (src instanceof IconToggleButton) {
+                            insert(new Separator(), 0);
+                            insert(new AbstractAction() {
+                                {
+                                    putValue(NAME, tr("Hide this button"));
+                                    putValue(SHORT_DESCRIPTION, tr("Click the arrow at the bottom to show it again."));
         }
-        toToggle.setVisible(Main.pref.getBoolean("sidetoolbar.visible", true));
+                                @Override
+                                public void actionPerformed(ActionEvent e) {
+                                    ((IconToggleButton)src).setButtonHidden(true);
+                                    validateToolBarsVisibility();
+                                }
+                            }, 0);
+                        }
+                        doNotHide.setSelected(Main.pref.getBoolean("sidetoolbar.always-visible", true));
+                    }
+                    @Override
+                    public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+                        while (getComponentCount() > staticMenuEntryCount) {
+                            remove(0);
+                        }
+                    }
+                    @Override
+                    public void popupMenuCanceled(PopupMenuEvent e) {}
+                });
 
-        jb.addMouseListener(new PopupMenuLauncher(new JPopupMenu() {
-
-            {
                 add(new AbstractAction(tr("Hide edit toolbar")) {
-
                     @Override
                     public void actionPerformed(ActionEvent e) {
                         Main.pref.put("sidetoolbar.visible", false);
                     }
                 });
+                add(doNotHide);
             }
-        }));
+        });
+        ((JToolBar)sideToolBar).setFloatable(false);
 
+        /**
+         * sideToolBar: decide scroll- and visibility
+         */
+        if(Main.pref.getBoolean("sidetoolbar.scrollable", true)) {
+            final ScrollViewport svp = new ScrollViewport(sideToolBar, ScrollViewport.VERTICAL_DIRECTION);
+            svp.addMouseWheelListener(new MouseWheelListener() {
+                @Override
+                public void mouseWheelMoved(MouseWheelEvent e) {
+                    svp.scroll(0, e.getUnitsToScroll() * 5);
+                }
+            });
+            sideToolBar = svp;
+        }
+        sideToolBar.setVisible(Main.pref.getBoolean("sidetoolbar.visible", true));
         sidetoolbarPreferencesChangedListener = new Preferences.PreferenceChangedListener() {
-
             @Override
             public void preferenceChanged(PreferenceChangeEvent e) {
                 if ("sidetoolbar.visible".equals(e.getKey())) {
-                    toToggle.setVisible(Main.pref.getBoolean("sidetoolbar.visible"));
+                    sideToolBar.setVisible(Main.pref.getBoolean("sidetoolbar.visible"));
                 }
             }
         };
         Main.pref.addPreferenceChangeListener(sidetoolbarPreferencesChangedListener);
 
+        /**
+         * sideToolBar: add it to the panel
+         */
+        panel.add(sideToolBar, BorderLayout.WEST);
+
+        /**
+         * statusLine: add to panel
+         */
         if (statusLine != null && Main.pref.getBoolean("statusline.visible", true)) {
             panel.add(statusLine, BorderLayout.SOUTH);
         }
     }
 
-    private void addHideContextMenu(final IconToggleButton b) {
-        //context menu
-        b.addMouseListener(new PopupMenuLauncher(new JPopupMenu() {
-            {
-                add(new AbstractAction() {
-                    {
-                        putValue(NAME, tr("Hide this button"));
-                        putValue(SHORT_DESCRIPTION, tr("Click the arrow at the bottom to show it again."));
-                    }
-                    @Override
-                    public void actionPerformed(ActionEvent e) {
-                        b.setButtonHidden(true);
-                        validateToolBarsVisibility();
-                    }
-                });
-            }
-        }));
-    }
-
     class ListAllButtonsAction extends AbstractAction {
 
         private JButton button;
@@ -543,16 +600,24 @@
         return dialogsPanel.getToggleDialog(type);
     }
 
+    public void setDialogsPanelVisible(boolean visible) {
+        rememberToggleDialogWidth();
+        dialogsPanel.setVisible(visible);
+        splitPane.setDividerLocation(visible?splitPane.getWidth()-Main.pref.getInteger("toggleDialogs.width",DEF_TOGGLE_DLG_WIDTH):0);
+        splitPane.setDividerSize(visible?5:0);
+    }
+
     /**
      * Remember the current width of the (possibly resized) toggle dialog area
      */
     public void rememberToggleDialogWidth() {
-        Main.pref.putInteger("toggleDialogs.width", dialogsPanel.getWidth());
+        if (dialogsPanel.isVisible()) {
+            Main.pref.putInteger("toggleDialogs.width", splitPane.getWidth()-splitPane.getDividerLocation());
     }
+    }
 
     /*
-     * Remove panel from top of MapView by class
-     */
+     * Remove panel from top of MapView by class     */
     public void removeTopPanel(Class<?> type) {
         int n = leftPanel.getComponentCount();
         for (int i=0; i<n; i++) {
@@ -652,7 +717,7 @@
         // After all listeners notice new layer, some buttons will be disabled/enabled
         // and possibly need to be hidden/shown.
         SwingUtilities.invokeLater(new Runnable() {
-            public void run() {
+            @Override public void run() {
                 validateToolBarsVisibility();
             }
         });
