FileDocCategorySizeDatePackage
ImageLoader.javaAPI DocAndroid 1.5 API2131Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.ddms

ImageLoader

public class ImageLoader extends Object implements com.android.ddmuilib.IImageLoader
Implementation of the IImageLoader interface for the eclipse plugin.

Fields Summary
private URL
mBaseUrl
Constructors Summary
public ImageLoader(org.eclipse.core.runtime.Plugin plugin)

        mBaseUrl = plugin.getBundle().getEntry("/"); // $NON-NLS-1$
    
Methods Summary
public org.eclipse.jface.resource.ImageDescriptorloadDescriptor(java.lang.String filename)
default method. only need a filename. the 2 interface methods call this one.

param
filename the filename of the image to load. The filename is searched for under /icons.
return

        try {
            URL newUrl = new URL(mBaseUrl, "/icons/" + filename); // $NON-NLS-1$
            return ImageDescriptor.createFromURL(newUrl);
        } catch (MalformedURLException e) {
            // we'll just return null;
        }
        return null;
    
public org.eclipse.jface.resource.ImageDescriptorloadDescriptor(java.lang.String filename, org.eclipse.swt.widgets.Display display)

        return loadDescriptor(filename);
    
public org.eclipse.swt.graphics.ImageloadImage(java.lang.String filename, org.eclipse.swt.widgets.Display display)

        ImageDescriptor descriptor = loadDescriptor(filename);
        if (descriptor !=null) {
            return descriptor.createImage();
        }
        return null;