Index: src/org/openstreetmap/josm/actions/DialogsToggleAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/DialogsToggleAction.java	(revision 0)
+++ src/org/openstreetmap/josm/actions/DialogsToggleAction.java	(working copy)
@@ -0,0 +1,83 @@
+// 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.gui.MainMenu;
+import org.openstreetmap.josm.gui.preferences.ToolbarPreferences;
+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.toolbar.control.setVisible(selected || Main.pref.getBoolean("toolbar.always-visible", true));
+            Main.main.menu.setVisible(selected || Main.pref.getBoolean("menu.always-visible", true));
+        }
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+        toggleSelectedState();
+    }
+}
Index: src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/mapmode/DrawAction.java	(revision 5955)
+++ src/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: src/org/openstreetmap/josm/gui/MainMenu.java
===================================================================
--- src/org/openstreetmap/josm/gui/MainMenu.java	(revision 5955)
+++ src/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: src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- src/org/openstreetmap/josm/gui/MapFrame.java	(revision 5955)
+++ src/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;
@@ -72,6 +74,7 @@
 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
@@ -120,6 +123,7 @@
      * instead of adding directly to this list.
      */
     private List<ToggleDialog> allDialogs = new ArrayList<ToggleDialog>();
+    private final JSplitPane splitPane;
     private final JPanel leftPanel;
     private final DialogsPanel dialogsPanel;
 
@@ -177,7 +181,7 @@
 
         toolGroup.setSelected(((AbstractButton)toolBarActions.getComponent(0)).getModel(), true);
 
-        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
+        splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
         dialogsPanel = new DialogsPanel(splitPane);
         splitPane.setLeftComponent(leftPanel);
         splitPane.setRightComponent(dialogsPanel);
@@ -233,6 +237,10 @@
         // 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) {
@@ -255,11 +263,24 @@
 
         return selectMapMode(mapModeZoom);
     }
+    
+    /**
+     * 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();
@@ -416,7 +437,7 @@
             toToggle = svp;
             panel.add(svp, BorderLayout.WEST);
             jb.addMouseWheelListener(new MouseWheelListener() {
-
+                @Override
                 public void mouseWheelMoved(MouseWheelEvent e) {
                     svp.scroll(0, e.getUnitsToScroll() * 5);
                 }
@@ -543,16 +564,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 +681,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();
             }
         });
Index: src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 5955)
+++ src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(working copy)
@@ -17,6 +17,7 @@
 import java.awt.event.ActionListener;
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
+import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.io.IOException;
@@ -28,6 +29,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import javax.swing.AbstractAction;
 
 import javax.swing.Action;
 import javax.swing.DefaultListCellRenderer;
@@ -35,6 +37,7 @@
 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;
@@ -64,6 +67,7 @@
 import org.openstreetmap.josm.actions.JosmAction;
 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;
@@ -72,7 +76,6 @@
 
 public class ToolbarPreferences implements PreferenceSettingFactory {
 
-
     private static final String EMPTY_TOOLBAR_MARKER = "<!-empty-!>";
 
     public static class ActionDefinition {
@@ -382,45 +385,76 @@
 
     }
 
-    private static class ToolbarPopupMenu extends JPopupMenu {
-        public ToolbarPopupMenu(final ActionDefinition action) {
+    private class ToolbarPopupMenu extends JPopupMenu  {
+        ActionDefinition act;
+        
+        public 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(act);
+                // remove the button from toolbar preferences
+                t.remove(res);
+                Main.pref.putCollection("toolbar", t);
+                Main.toolbar.refreshToolbarControl();
+            };
+        });
 
-            if(action != null) {
-                add(tr("Remove from toolbar",action.getDisplayName()))
-                        .addActionListener(new ActionListener() {
-                            @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);
-                                // remove the button from toolbar preferences
-                                t.remove( res );
-                                Main.pref.putCollection("toolbar", t);
-                                Main.toolbar.refreshToolbarControl();
-                            }
-                });
+        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);
             }
+        });
+        
+        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(act.getDisplayName());
+                p.selectPreferencesTabByName("shortcuts");
+                p.setVisible(true);
+                // refresh toolbar to try using changed shortcuts without restart
+                Main.toolbar.refreshToolbarControl();
+            }
+        });
             
-            add(tr("Configure toolbar")).addActionListener(new ActionListener() {
-                @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) {
-                    final PreferenceDialog p =new PreferenceDialog(Main.parent);
-                    p.getTabbedPane().getShortcutPreference().setDefaultFilter(action.getDisplayName());
-                    p.selectPreferencesTabByName("shortcuts");
-                    p.setVisible(true);
-                    // refresh toolbar to accept changes of 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);
+            }
+        });
+        {
+            add(remove);
+            add(configure);
+            add(shortcutEdit);
+            add(doNotHide);
         }
-    }
+    };
+    
+    
+    private ToolbarPopupMenu popupMenu = new ToolbarPopupMenu();
+    private PopupMenuLauncher menuLauncher = new PopupMenuLauncher(popupMenu) {
+        @Override
+        public void launch(MouseEvent evt) {
+            popupMenu.setActionAndAdapt(buttonActions.get(evt.getSource()));
+            super.launch(evt); //To change body of generated methods, choose Tools | Templates.
+        }
+    };
 
     /**
      * Key: Registered name (property "toolbar" of action).
@@ -432,7 +466,8 @@
     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() {
         return new Settings(rootActionsNode);
@@ -841,7 +876,7 @@
 
     public ToolbarPreferences() {
         control.setFloatable(false);
-        control.addMouseListener(new PopupMenuLauncher(new ToolbarPopupMenu(null)));
+        control.addMouseListener(menuLauncher);
     }
 
     private void loadAction(DefaultMutableTreeNode node, MenuElement menu) {
@@ -978,12 +1013,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 +1037,7 @@
                         }
                     });
                 }
-                b.addMouseListener(new PopupMenuLauncher( new ToolbarPopupMenu(action)));
+                b.addMouseListener(menuLauncher);
             }
         }
         control.setVisible(control.getComponentCount() != 0);
Index: src/org/openstreetmap/josm/tools/Shortcut.java
===================================================================
--- src/org/openstreetmap/josm/tools/Shortcut.java	(revision 5955)
+++ src/org/openstreetmap/josm/tools/Shortcut.java	(working copy)
@@ -244,8 +244,10 @@
     // and here our modifier groups
     private static Map<Integer, Integer> groups= new HashMap<Integer, Integer>();
 
-    // check if something collides with an existing shortcut
-    private static Shortcut findShortcut(int requestedKey, int modifier) {
+    /* 
+     * Check if something collides with an existing shortcut and return Shortcut object
+     */
+    public static Shortcut findShortcut(int requestedKey, int modifier) {
         if (modifier == getGroupModifier(NONE))
             return null;
         for (Shortcut sc : shortcuts.values()) {
@@ -268,7 +270,7 @@
         }
         return l;
     }
-
+    
     public static final int NONE = 5000;
     public static final int MNEMONIC = 5001;
     public static final int RESERVED = 5002;
