Java Code Examples for org.eclipse.jface.viewers.DecorationOverlayIcon#createImage()

The following examples show how to use org.eclipse.jface.viewers.DecorationOverlayIcon#createImage() . 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
Source File: JSIndexViewLabelProvider.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public Image decorateImage(Image image, Object element)
{
	Image result = null;

	if (image != null && element instanceof PropertyElement)
	{
		PropertyElement property = (PropertyElement) element;

		if (property.isClassProperty())
		{
			DecorationOverlayIcon decorator = new DecorationOverlayIcon(image, STATIC_OVERLAY,
					IDecoration.TOP_RIGHT);

			result = decorator.createImage();
		}
	}

	return result;
}
 
Example 2
Source File: AbapGitStagingLabelProvider.java    From ADT_Frontend with MIT License 5 votes vote down vote up
/**
 * Method to overlay an image with another
 */
private Image decorateImage(Image baseImage, String overlayImagePath) {
	Bundle bundle = Platform.getBundle(AbapGitUIPlugin.PLUGIN_ID);
	URL fullPathString = BundleUtility.find(bundle, overlayImagePath);
	DecorationOverlayIcon doi = new DecorationOverlayIcon(//
			baseImage, ImageDescriptor.createFromURL(fullPathString), IDecoration.BOTTOM_RIGHT);
	return doi.createImage();
}
 
Example 3
Source File: JSModelFormatter.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
private Image addOverlay(Image base, ImageDescriptor overlay, int location, String key)
{
	ImageRegistry reg = getImageRegistry();
	Image cached = reg.get(key);
	if (cached != null)
	{
		return cached;
	}

	DecorationOverlayIcon decorator = new DecorationOverlayIcon(base, overlay, location);
	Image result = decorator.createImage();
	reg.put(key, result);
	return result;
}
 
Example 4
Source File: ImageManager.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private static Image get(String filename, String overlay) {
	if (filename == null || overlay == null)
		return null;
	String id = filename + "-" + overlay;
	Image withOverlay = registry.get(id);
	if (withOverlay != null && !withOverlay.isDisposed())
		return withOverlay;
	DecorationOverlayIcon withIcon = new DecorationOverlayIcon(
			get(filename), descriptor(overlay), IDecoration.BOTTOM_RIGHT);
	withOverlay = withIcon.createImage();
	registry.put(id, withOverlay);
	return withOverlay;
}
 
Example 5
Source File: CamelDesignerPlugin.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
private static Image getOptionalOverlayIcon(Image base) {
    DecorationOverlayIcon decorationOverlayIcon = new DecorationOverlayIcon(base,
        createImageDescriptor(OPTIONAL_OVERLAY_ICON), IDecoration.TOP_LEFT);
    return decorationOverlayIcon.createImage();
}