Index: /trunk/src/org/openstreetmap/josm/gui/MapFrame.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 10850)
+++ /trunk/src/org/openstreetmap/josm/gui/MapFrame.java	(revision 10851)
@@ -33,4 +33,5 @@
 import javax.swing.JPopupMenu;
 import javax.swing.JSplitPane;
+import javax.swing.JToggleButton;
 import javax.swing.JToolBar;
 import javax.swing.KeyStroke;
@@ -381,4 +382,19 @@
     }
 
+    /**
+     * Call this to remove existing toggle dialog from the left button-list
+     * @param dlg The toggle dialog. It must be already in the list.
+     * @since 10851
+     */
+    public void removeToggleDialog(final ToggleDialog dlg) {
+        final JToggleButton button = dlg.getButton();
+        if (button != null) {
+            allDialogButtons.remove(button);
+            toolBarToggle.remove(button);
+        }
+        dialogsPanel.remove(dlg);
+        allDialogs.remove(dlg);
+    }
+
     public void addMapMode(IconToggleButton b) {
         if (b.getAction() instanceof MapMode) {
