Changeset 5027 in josm


Ignore:
Timestamp:
2012-02-28T01:29:11+01:00 (12 years ago)
Author:
Don-vip
Message:

Allow to load an optional icon without warning on System.err

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r4961 r5027  
    214214     */
    215215    public ImageIcon get() {
     216        return get(true);
     217    }
     218   
     219    /**
     220     * Execute the image request.
     221     */
     222    public ImageIcon get(boolean warn) {
    216223        ImageResource ir = getIfAvailableImpl();
    217224        if (ir == null) {
     
    220227                throw new RuntimeException(tr("Fatal: failed to locate image ''{0}''. This is a serious configuration problem. JOSM will stop working.", name + ext));
    221228            } else {
    222                 System.out.println(tr("Failed to locate image ''{0}''", name));
     229                if (warn) {
     230                    System.out.println(tr("Failed to locate image ''{0}''", name));
     231                }
    223232                return null;
    224233            }
Note: See TracChangeset for help on using the changeset viewer.