Index: /trunk/src/org/openstreetmap/josm/actions/AdaptableAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AdaptableAction.java	(revision 4032)
+++ /trunk/src/org/openstreetmap/josm/actions/AdaptableAction.java	(revision 4032)
@@ -0,0 +1,8 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.actions;
+
+import javax.swing.Action;
+
+/* allow us to tell the toolbar that name and icon may be changed */
+public interface AdaptableAction extends Action {
+}
Index: /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 4031)
+++ /trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java	(revision 4032)
@@ -11,5 +11,5 @@
 import org.openstreetmap.josm.gui.layer.ImageryLayer;
 
-public class AddImageryLayerAction extends JosmAction {
+public class AddImageryLayerAction extends JosmAction implements AdaptableAction {
 
     private final ImageryInfo info;
Index: /trunk/src/org/openstreetmap/josm/actions/ParameterizedAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/ParameterizedAction.java	(revision 4031)
+++ /trunk/src/org/openstreetmap/josm/actions/ParameterizedAction.java	(revision 4032)
@@ -8,5 +8,5 @@
 import javax.swing.Action;
 
-public interface ParameterizedAction extends Action {
+public interface ParameterizedAction extends AdaptableAction {
 
     List<ActionParameter<?>> getActionParameters();
Index: /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 4031)
+++ /trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java	(revision 4032)
@@ -27,8 +27,10 @@
 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.JComponent;
@@ -57,4 +59,5 @@
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.ActionParameter;
+import org.openstreetmap.josm.actions.AdaptableAction;
 import org.openstreetmap.josm.actions.ParameterizedAction;
 import org.openstreetmap.josm.actions.ParameterizedActionDecorator;
@@ -70,4 +73,6 @@
     public static class ActionDefinition {
         private final Action action;
+        private String name = "";
+        private String icon = "";
         private final Map<String, Object> parameters = new HashMap<String, Object>();
 
@@ -89,4 +94,25 @@
         public Action getAction() {
             return action;
+        }
+
+        public String getName() {
+            return name;
+        }
+
+        public void setName(String name) {
+            this.name = name;
+            action.putValue(AbstractAction.SHORT_DESCRIPTION, Main.platform.makeTooltip(name, null));
+            action.putValue(AbstractAction.NAME, name);
+        }
+
+        public String getIcon() {
+            return icon;
+        }
+
+        public void setIcon(String icon) {
+            this.icon = icon;
+            ImageIcon ico = ImageProvider.getIfAvailable("", icon);
+            if(ico != null)
+                action.putValue(AbstractAction.SMALL_ICON, ico);
         }
 
@@ -135,5 +161,5 @@
             this.s = actionName.toCharArray();
 
-            String name = readTillChar('(', '(');
+            String name = readTillChar('(', '{');
             Action action = actions.get(name);
 
@@ -152,5 +178,5 @@
                 }
 
-                do {
+                while (index < s.length && s[index] != ')') {
                     String paramName = readTillChar('=', '=');
                     skip('=');
@@ -163,5 +189,21 @@
                     }
                     skip(',');
-                } while (index < s.length && s[index] != ')');
+                }
+                skip(')');
+            }
+            if (action instanceof AdaptableAction) {
+                skip('{');
+
+                while (index < s.length && s[index] != '}') {
+                    String paramName = readTillChar('=', '=');
+                    skip('=');
+                    String paramValue = readTillChar(',','}');
+                    if ("icon".equals(paramName) && paramValue.length() > 0)
+                        result.setIcon(paramValue);
+                    else if("name".equals(paramName) && paramValue.length() > 0)
+                        result.setName(paramValue);
+                    skip(',');
+                }
+                skip('}');
             }
 
@@ -172,5 +214,5 @@
             for (int i=0; i<s.length(); i++) {
                 char ch = s.charAt(i);
-                if (ch == '\\' || ch == '(' || ch == ',' || ch == ')' || ch == '=') {
+                if (ch == '\\' || ch == '(' || ch == '{' || ch == ',' || ch == ')' || ch == '}' || ch == '=') {
                     result.append('\\');
                     result.append(ch);
@@ -204,4 +246,23 @@
                 }
             }
+            if (action.getAction() instanceof AdaptableAction) {
+                boolean first = true;
+                String tmp = action.getName();
+                if(tmp.length() != 0) {
+                    result.append(first ? "{" : ",");
+                    result.append("name=");
+                    escape(tmp);
+                    first = false;
+                }
+                tmp = action.getIcon();
+                if(tmp.length() != 0) {
+                    result.append(first ? "{" : ",");
+                    result.append("icon=");
+                    escape(tmp);
+                    first = false;
+                }
+                if(!first)
+                    result.append('}');
+            }
 
             return result.toString();
@@ -221,5 +282,6 @@
                 return 0;
             ParameterizedAction pa = (ParameterizedAction)currentAction.getAction();
-            return pa.getActionParameters().size();
+            return pa.getActionParameters().size()
+            + ((currentAction.getAction() instanceof ParameterizedAction) ? 2 : 0);
         }
 
@@ -231,4 +293,18 @@
 
         public Object getValueAt(int rowIndex, int columnIndex) {
+            if(currentAction.getAction() instanceof ParameterizedAction)
+            {
+                if (rowIndex < 2) {
+                    switch (columnIndex) {
+                    case 0:
+                        return rowIndex == 0 ? tr("Tooltip") : tr("Icon");
+                    case 1:
+                        return rowIndex == 0 ? currentAction.getName() : currentAction.getIcon();
+                    default:
+                        return null;
+                    }
+                } else
+                    rowIndex -= 2;
+            }
             ActionParameter<Object> param = getParam(rowIndex);
             switch (columnIndex) {
@@ -249,4 +325,15 @@
         @Override
         public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+            if(currentAction.getAction() instanceof ParameterizedAction)
+            {
+                if (rowIndex == 0) {
+                     currentAction.setName((String)aValue);
+                     return;
+                } else if (rowIndex == 1) {
+                     currentAction.setIcon((String)aValue);
+                     return;
+                } else
+                    rowIndex -= 2;
+            }
             ActionParameter<Object> param = getParam(rowIndex);
             currentAction.getParameters().put(param.getName(), param.readFromString((String)aValue));
