Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 4585)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java	(revision 4586)
@@ -100,4 +100,8 @@
     }
 
+    void selectPreferencesTabByName(String name) {
+        tpPreferences.selectTabByName(name);
+    }
+
     class CancelAction extends AbstractAction {
         public CancelAction() {
Index: trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 4585)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java	(revision 4586)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
+import java.awt.Component;
 import java.awt.Font;
 import java.awt.GridBagLayout;
@@ -11,7 +12,9 @@
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 
 import javax.swing.BorderFactory;
@@ -52,4 +55,6 @@
     }
 
+    // all created tabs
+    private final Map<String,Component> tabs = new HashMap<String,Component>();
     private final static Collection<PreferenceSettingFactory> settingsFactory = new LinkedList<PreferenceSettingFactory>();
     private final List<PreferenceSetting> settings = new ArrayList<PreferenceSetting>();
@@ -115,7 +120,13 @@
             tab = sp;
         }
+        tabs.put(icon,tab);
         addTab(null, ImageProvider.get("preferences", icon), tab);
         setToolTipTextAt(getTabCount()-1, "<html>"+desc+"</html>");
         return p;
+    }
+    
+    public void selectTabByName(String name) {
+        Component c = tabs.get(name);
+        if (c!=null) setSelectedComponent(c);
     }
 
Index: trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 4585)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 4586)
@@ -27,5 +27,4 @@
 import java.util.Map;
 
-import javax.swing.AbstractAction;
 import javax.swing.Action;
 import javax.swing.DefaultListCellRenderer;
@@ -63,4 +62,5 @@
 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;
@@ -365,4 +365,32 @@
         }
 
+    }
+
+    private static class ToolbarPopupMenu extends JPopupMenu {
+        public ToolbarPopupMenu(final ActionDefinition action) {
+            
+            add(tr("Remove from toolbar",action.getDisplayName()))
+                    .addActionListener(new ActionListener() {
+                        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();                
+                        }
+            });
+            
+            add(tr("Configure toolbar")).addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    final PreferenceDialog p =new PreferenceDialog(Main.parent);
+                    p.selectPreferencesTabByName("toolbar");
+                    p.setVisible(true);
+                }
+            });
+            
+        }
     }
 
@@ -921,4 +949,5 @@
                 if (i != null)
                     b.setIcon(i);
+                b.addMouseListener(new PopupMenuLauncher( new ToolbarPopupMenu(action)));
             }
         }
