Index: trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 1359)
+++ trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java	(revision 1360)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.gui.tagging;
 
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 import static org.openstreetmap.josm.tools.I18n.trn;
@@ -14,4 +15,5 @@
 import java.io.Reader;
 import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
@@ -39,4 +41,7 @@
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.OsmUtils;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.osm.Relation;
 import org.openstreetmap.josm.io.MirroredInputStream;
 import org.openstreetmap.josm.gui.QuadStateCheckBox;
@@ -412,5 +417,5 @@
      * The types as preparsed collection.
      */
-    public Collection<Class<?>> types;
+    public List<String> types;
     public List<Item> data = new LinkedList<Item>();
     private static HashMap<String,String> lastValue = new HashMap<String,String>();
@@ -462,15 +467,11 @@
      * Called from the XML parser to set the types this preset affects
      */
+    private static Collection<String> allowedtypes = Arrays.asList(new String[]
+    {marktr("way"), marktr("node"), marktr("relation"), marktr("closedway")});
     public void setType(String types) throws SAXException {
-        try {
-            for (String type : types.split(",")) {
-                type = Character.toUpperCase(type.charAt(0))+type.substring(1);
-                if (this.types == null)
-                    this.types = new LinkedList<Class<?>>();
-                this.types.add(Class.forName("org.openstreetmap.josm.data.osm."+type));
-            }
-        } catch (ClassNotFoundException e) {
-            e.printStackTrace();
-            throw new SAXException(tr("Unknown type"));
+        this.types = Arrays.asList(types.split(","));
+        for (String type : this.types) {
+            if(!allowedtypes.contains(type))
+                throw new SAXException(tr("Unknown type: {0}", type));
         }
     }
@@ -563,4 +564,15 @@
         JPanel p = new JPanel(new GridBagLayout());
         LinkedList<Item> l = new LinkedList<Item>();
+        if(types != null)
+        {
+            JPanel pp = new JPanel();
+            for(String t : types)
+            {
+                JLabel la = new JLabel(ImageProvider.get("Mf_" + t));
+                la.setToolTipText(tr("Elements of type {0} are supported.", tr(t)));
+                pp.add(la);
+            }
+            p.add(pp, GBC.eol());
+        }
 
         for (Item i : data)
@@ -577,5 +589,5 @@
 
     public void actionPerformed(ActionEvent e) {
-        Collection<OsmPrimitive> sel = Main.ds.getSelected();
+        Collection<OsmPrimitive> sel = createSelection(Main.ds.getSelected());
         JPanel p = createPanel(sel);
         if (p == null)
@@ -593,5 +605,9 @@
                 }
             };
-            optionPane.createDialog(Main.parent, trn("Change {0} object", "Change {0} objects", sel.size(), sel.size())).setVisible(true);
+            String title = trn("Change {0} object", "Change {0} objects", sel.size(), sel.size());
+            if(sel.size() == 0)
+                title = tr("Nothing selected!");
+
+            optionPane.createDialog(Main.parent, title).setVisible(true);
             Object answerObj = optionPane.getValue();
             if (answerObj == null || answerObj == JOptionPane.UNINITIALIZED_VALUE ||
@@ -599,6 +615,6 @@
                 answer = JOptionPane.CANCEL_OPTION;
         }
-        if (answer == JOptionPane.OK_OPTION) {
-            Command cmd = createCommand(Main.ds.getSelected());
+        if (sel.size() != 0 && answer == JOptionPane.OK_OPTION) {
+            Command cmd = createCommand(sel);
             if (cmd != null)
                 Main.main.undoRedo.add(cmd);
@@ -607,12 +623,31 @@
     }
 
-    private Command createCommand(Collection<OsmPrimitive> participants) {
+    private Collection<OsmPrimitive> createSelection(Collection<OsmPrimitive> participants) {
         Collection<OsmPrimitive> sel = new LinkedList<OsmPrimitive>();
         for (OsmPrimitive osm : participants)
-            if (types == null || types.contains(osm.getClass()))
-                sel.add(osm);
-        if (sel.isEmpty())
-            return null;
-
+        {
+            if (types != null)
+            {
+                if(osm instanceof Relation)
+                {
+                    if(!types.contains("relation")) continue;
+                }
+                else if(osm instanceof Node)
+                {
+                    if(!types.contains("node")) continue;
+                }
+                else if(osm instanceof Way)
+                {
+                    if(!types.contains("way") &&
+                    !(types.contains("closedway") && ((Way)osm).isClosed()))
+                        continue;
+                }
+            }
+            sel.add(osm);
+        }
+        return sel;
+    }
+
+    private Command createCommand(Collection<OsmPrimitive> sel) {
         List<Command> cmds = new LinkedList<Command>();
         for (Item i : data)
