Index: trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 5054)
+++ trunk/src/org/openstreetmap/josm/tools/ImageProvider.java	(revision 5055)
@@ -98,4 +98,6 @@
     protected int maxHeight = -1;
     protected boolean optional;
+    protected boolean suppressWarnings;
+    protected Collection<ClassLoader> additionalClassLoaders;
 
     private static SVGUniverse svgUniverse;
@@ -220,32 +222,25 @@
 
     /**
+     * Suppresses warning on the command line in case the image cannot be found.
+     *
+     * In combination with setOptional(true);
+     */
+    public ImageProvider setSuppressWarning(boolean suppressWarnings) {
+        this.suppressWarnings = suppressWarnings;
+        return this;
+    }
+
+    /**
+     * Add a collection of additional class loaders to search image for.
+     */
+    public ImageProvider setAdditionalClassLoaders(Collection<ClassLoader> additionalClassLoaders) {
+        this.additionalClassLoaders = additionalClassLoaders;
+        return this;
+    }
+
+    /**
      * Execute the image request.
      */
     public ImageIcon get() {
-        return get(true);
-    }
-
-    /**
-     * Execute the image request.
-     * @param warn If the requested image has been set as optional and is not found, prints an error message on System.err.
-     */
-    public ImageIcon get(boolean warn) {
-        return get(warn, null);
-    }
-
-    /**
-     * Execute the image request.
-     * @param additionalClassLoaders A collection of additional class loaders to search image for.
-     */
-    public ImageIcon get(Collection<ClassLoader> additionalClassLoaders) {
-        return get(true, additionalClassLoaders);
-    }
-
-    /**
-     * Execute the image request.
-     * @param warn If the requested image has been set as optional and is not found, prints an error message on System.err.
-     * @param additionalClassLoaders A collection of additional class loaders to search image for.
-     */
-    public ImageIcon get(boolean warn, Collection<ClassLoader> additionalClassLoaders) {
         ImageResource ir = getIfAvailableImpl(additionalClassLoaders);
         if (ir == null) {
@@ -254,5 +249,5 @@
                 throw new RuntimeException(tr("Fatal: failed to locate image ''{0}''. This is a serious configuration problem. JOSM will stop working.", name + ext));
             } else {
-                if (warn) {
+                if (!suppressWarnings) {
                     System.err.println(tr("Failed to locate image ''{0}''", name));
                 }
