Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 1802)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 1814)
@@ -29,5 +29,7 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
 import org.openstreetmap.josm.io.MirroredInputStream;
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 /**
@@ -95,9 +97,9 @@
                 {
                     MirroredInputStream is = new MirroredInputStream(name,
-                    new File(Main.pref.getPreferencesDir(), "images").toString());
+                            new File(Main.pref.getPreferencesDir(), "images").toString());
                     if(is != null)
                     {
-                      img = Toolkit.getDefaultToolkit().createImage(is.getFile().toURI().toURL());
-                      cache.put(name, img);
+                        img = Toolkit.getDefaultToolkit().createImage(is.getFile().toURI().toURL());
+                        cache.put(name, img);
                     }
                 }
@@ -107,14 +109,16 @@
             return img == null ? null : new ImageIcon(img);
         }
-        if (subdir == null)
+        if (subdir == null) {
             subdir = "";
-        else if (!subdir.equals(""))
+        } else if (!subdir.equals("")) {
             subdir += "/";
+        }
         String ext = name.indexOf('.') != -1 ? "" : ".png";
         String full_name = subdir+name+ext;
         String cache_name = full_name;
         /* cache separately */
-        if(dirs != null && dirs.size() > 0)
+        if(dirs != null && dirs.size() > 0) {
             cache_name = "id:"+id+":"+full_name;
+        }
 
         Image img = cache.get(cache_name);
@@ -198,6 +202,7 @@
     public static Cursor getCursor(String name, String overlay) {
         ImageIcon img = get("cursor",name);
-        if (overlay != null)
+        if (overlay != null) {
             img = overlay(img, "cursor/modifier/"+overlay, OverlayPosition.SOUTHEAST);
+        }
         Cursor c = Toolkit.getDefaultToolkit().createCustomCursor(img.getImage(),
                 name.equals("crosshair") ? new Point(10,10) : new Point(3,2), "Cursor");
@@ -251,8 +256,8 @@
     }
 
-/* from: http://www.jidesoft.com/blog/2008/02/29/rotate-an-icon-in-java/
-* License: "feel free to use"
-*/
-final static double DEGREE_90 = 90.0 * Math.PI / 180.0;
+    /* from: http://www.jidesoft.com/blog/2008/02/29/rotate-an-icon-in-java/
+     * License: "feel free to use"
+     */
+    final static double DEGREE_90 = 90.0 * Math.PI / 180.0;
 
     /**
@@ -315,3 +320,14 @@
         return new ImageIcon(image);
     }
+
+    /**
+     * Replies the icon for an OSM primitive type
+     * @param type the type
+     * @return the icon
+     */
+    public static ImageIcon get(OsmPrimitiveType type) throws IllegalArgumentException {
+        if (type == null)
+            throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "type"));
+        return get("data",type.getAPIName());
+    }
 }
