FileDocCategorySizeDatePackage
ErrorImageComposite.javaAPI DocAndroid 1.5 API1669Wed May 06 22:41:10 BST 2009com.android.ide.eclipse.editors.ui

ErrorImageComposite

public class ErrorImageComposite extends org.eclipse.jface.resource.CompositeImageDescriptor
ImageDescriptor that adds a error marker. Based on {@link DecorationOverlayIcon} only available in Eclipse 3.3

Fields Summary
private org.eclipse.swt.graphics.Image
mBaseImage
private org.eclipse.jface.resource.ImageDescriptor
mErrorImageDescriptor
private org.eclipse.swt.graphics.Point
mSize
Constructors Summary
public ErrorImageComposite(org.eclipse.swt.graphics.Image baseImage)

        mBaseImage = baseImage;
        mErrorImageDescriptor = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(
                ISharedImages.IMG_OBJS_ERROR_TSK);
        mSize = new Point(baseImage.getBounds().width, baseImage.getBounds().height);
    
Methods Summary
protected voiddrawCompositeImage(int width, int height)

        ImageData baseData = mBaseImage.getImageData();
        drawImage(baseData, 0, 0);

        ImageData overlayData = mErrorImageDescriptor.getImageData();
        if (overlayData.width == baseData.width && baseData.height == baseData.height) {
            overlayData = overlayData.scaledTo(14, 14);
            drawImage(overlayData, -3, mSize.y - overlayData.height + 3);
        } else {
            drawImage(overlayData, 0, mSize.y - overlayData.height);
        }
    
protected org.eclipse.swt.graphics.PointgetSize()

        return mSize;