private static SwtUniversalImage getUniversalImageInternal( Display display, ClassLoader classLoader, String filename ) { SwtUniversalImage result = loadFromClassLoader( display, classLoader, filename ); if ( result == null ) { result = loadFromClassLoader( display, classLoader, "/" + filename ); if ( result == null ) { result = loadFromClassLoader( display, classLoader, "ui/images/" + filename ); if ( result == null ) { result = getImageAsResourceInternal( display, filename ); } } } return result; }
/** * Load image from several sources. */ public static SwtUniversalImage getImageAsResource( Display display, String location ) { SwtUniversalImage result = null; if ( result == null && SvgSupport.isSvgEnabled() ) { result = getImageAsResourceInternal( display, SvgSupport.toSvgName( location ) ); } if ( result == null ) { result = getImageAsResourceInternal( display, SvgSupport.toPngName( location ) ); } if ( result == null && !location.equals( NO_IMAGE ) ) { log.logError( "Unable to load image [" + location + "]" ); result = getImageAsResource( display, NO_IMAGE ); } if ( result == null ) { log.logError( "Unable to load image [" + location + "]" ); result = getMissingImage( display ); } return result; }