Java Code Examples for org.eclipse.swt.graphics.Image#equals()

The following examples show how to use org.eclipse.swt.graphics.Image#equals() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
private String getAccessibleMessageFor(Image image) {
	if (image.equals(getErrorImage())) {
		return JFaceResources.getString("error");//$NON-NLS-1$
	}

	if (image.equals(getWarningImage())) {
		return JFaceResources.getString("warning");//$NON-NLS-1$
	}

	if (image.equals(getInfoImage())) {
		return JFaceResources.getString("info");//$NON-NLS-1$
	}

	if (image.equals(getQuestionImage())) {
		return JFaceResources.getString("question"); //$NON-NLS-1$
	}

	return null;
}
 
Example 2
private String getAccessibleMessageFor(Image image) {
	if (image.equals(getErrorImage())) {
		return JFaceResources.getString("error");//$NON-NLS-1$
	}

	if (image.equals(getWarningImage())) {
		return JFaceResources.getString("warning");//$NON-NLS-1$
	}

	if (image.equals(getInfoImage())) {
		return JFaceResources.getString("info");//$NON-NLS-1$
	}

	if (image.equals(getQuestionImage())) {
		return JFaceResources.getString("question"); //$NON-NLS-1$
	}

	return null;
}
 
Example 3
/**
 * Dispose the image if it was created locally to avoid a leak. Do not
 * dispose the images in the registry.
 * 
 * @param image
 */
protected void disposeImage(Image image) {
    if (image == null) {
        return;
    }
    
    if (image.equals(DiagramUIPropertiesImages
        .get(DiagramUIPropertiesImages.IMG_FILL_COLOR))
        || image.equals(DiagramUIPropertiesImages
            .get(DiagramUIPropertiesImages.IMG_LINE_COLOR))
        || image.equals(DiagramUIPropertiesImages
            .get(DiagramUIPropertiesImages.IMG_FONT_COLOR))) {
        return;
    }

    if (! image.isDisposed()) {
        image.dispose();
    }
}
 
Example 4
/**
 * Update an image related to a control.
 * @param img Image to update.
 * @param ctrlIndex Index of the control related to the image.
 */
private void updateControlImage(Image img, int ctrlIndex) {
    Image previousImg = _images.put(ctrlIndex, img);
    if (previousImg != null && !previousImg.equals(img)) {
        previousImg.dispose();
    }
}
 
Example 5
@Override
public boolean equals(Object obj) {
	if (super.equals(obj)) {
		return true;
	}
	if (obj instanceof UISWTGraphic) {
		Image img2 = ((UISWTGraphic) obj).getImage();
		if (img2 == null) {
			return img == null;
		}
		return img2.equals(img);
	}
	return false;
}
 
Example 6
private void disposeImage(Image image) {
	if (image == null) {
		return;
	}

	if (image.equals(DiagramUIPropertiesImages
			.get(DiagramUIPropertiesImages.IMG_LINE_COLOR))) {
		return;
	}

	if (!image.isDisposed()) {
		image.dispose();
	}
}