Index: src/org/openstreetmap/josm/actions/search/SearchAction.java
===================================================================
--- src/org/openstreetmap/josm/actions/search/SearchAction.java	(revision 4581)
+++ src/org/openstreetmap/josm/actions/search/SearchAction.java	(working copy)
@@ -2,6 +2,7 @@
 package org.openstreetmap.josm.actions.search;
 
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
+import org.openstreetmap.josm.gui.preferences.ToolbarPreferences.ActionParser;
 import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.openstreetmap.josm.tools.I18n.trc;
 
@@ -35,6 +36,7 @@
 import org.openstreetmap.josm.data.osm.Filter;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.preferences.ToolbarPreferences;
 import org.openstreetmap.josm.gui.widgets.HistoryComboBox;
 import org.openstreetmap.josm.tools.GBC;
 import org.openstreetmap.josm.tools.Property;
@@ -185,6 +187,7 @@
         JCheckBox allElements = new JCheckBox(tr("all objects"), initialValues.allElements);
         allElements.setToolTipText(tr("Also include incomplete and deleted objects in search."));
         final JCheckBox regexSearch   = new JCheckBox(tr("regular expression"), initialValues.regexSearch);
+        final JCheckBox addOnToolbar  = new JCheckBox(tr("Add toolbar button"), false); 
 
         JPanel top = new JPanel(new GridBagLayout());
         top.add(label, GBC.std().insets(0, 0, 5, 0));
@@ -199,6 +202,7 @@
         {
             left.add(allElements, GBC.eol());
             left.add(regexSearch, GBC.eol());
+            left.add(addOnToolbar, GBC.eol()); 
         }
 
         JPanel right = new JPanel();
@@ -292,6 +296,23 @@
         initialValues.caseSensitive = caseSensitive.isSelected();
         initialValues.allElements = allElements.isSelected();
         initialValues.regexSearch = regexSearch.isSelected();
+        
+        if (addOnToolbar.isSelected()) {
+            ToolbarPreferences.ActionDefinition aDef = 
+                    new ToolbarPreferences.ActionDefinition(Main.main.menu.search);
+            aDef.getParameters().put("searchExpression", initialValues);
+            // parametrized action definition is now composed
+            ActionParser actionParser = new ToolbarPreferences.ActionParser(null);
+            String res = actionParser.saveAction(aDef);
+            
+            Collection<String> t = new LinkedList<String>(Main.pref.getCollection("toolbar"));
+            if (t!=null) {
+                // add custom search button to toolbar preferences
+                if (!t.contains(res)) t.add(res);
+                Main.pref.putCollection("toolbar", t);
+                Main.toolbar.refreshToolbarControl();
+            }
+        }
         return initialValues;
     }
 
