use of org.eclipse.jface.viewers.DecorationOverlayIcon in project xtext-xtend by eclipse.
the class XtendEditorErrorTickUpdater method updateEditorImage.
@Override
protected void updateEditorImage(XtextEditor xtextEditor) {
if (xtextEditor != null && !xtextEditor.isEditable()) {
Severity severity = getSeverity(xtextEditor);
if (severity != null && severity != Severity.INFO) {
ImageDescriptor descriptor = severity == Severity.ERROR ? XtextPluginImages.DESC_OVR_ERROR : XtextPluginImages.DESC_OVR_WARNING;
// TODO replace with new constructor that takes an ImageDescription when on Oxygen+
DecorationOverlayIcon decorationOverlayIcon = new DecorationOverlayIcon(pluginImageHelper.getImage(images.forReadonly()), descriptor, IDecoration.BOTTOM_LEFT);
scheduleUpdateEditor(decorationOverlayIcon);
} else {
scheduleUpdateEditor(images.forReadonly());
}
} else {
super.updateEditorImage(xtextEditor);
}
}
use of org.eclipse.jface.viewers.DecorationOverlayIcon in project archi by archimatetool.
the class ImageFactory method getOverlayImage.
/**
* Return a composite image with overlay image
*
* @param underlay The underlay image
* @param overlayName Name of the overlay image
* @param quadrant the quadrant (one of {@link IDecoration}
* ({@link IDecoration#TOP_LEFT}, {@link IDecoration#TOP_RIGHT},
* {@link IDecoration#BOTTOM_LEFT}, {@link IDecoration#BOTTOM_RIGHT}
* or {@link IDecoration#UNDERLAY})
* @return The image
*/
public Image getOverlayImage(Image underlay, String overlayName, int quadrant) {
String key = underlay.hashCode() + overlayName + quadrant;
Image newImage = getImage(key);
if (newImage == null) {
ImageDescriptor overlayDescripter = getImageDescriptor(overlayName);
if (overlayDescripter != null) {
newImage = new DecorationOverlayIcon(underlay, overlayDescripter, quadrant).createImage();
if (newImage != null) {
ImageRegistry registry = fPlugin.getImageRegistry();
registry.put(key, newImage);
}
}
}
return newImage != null ? newImage : underlay;
}
use of org.eclipse.jface.viewers.DecorationOverlayIcon in project bndtools by bndtools.
the class ExtendedFormEditor method setOverlayTitleImage.
public void setOverlayTitleImage(ImageDescriptor overlay) {
if (overlay == null) {
overlaidTitleImage = null;
firePropertyChange(PROP_TITLE);
if (overlaidTitleImageDescriptor != null)
JFaceResources.getResources().destroyImage(overlaidTitleImageDescriptor);
overlaidTitleImageDescriptor = null;
} else {
DecorationOverlayIcon newOverlaidDesc = new DecorationOverlayIcon(titleImage, overlay, IDecoration.BOTTOM_LEFT);
overlaidTitleImage = JFaceResources.getResources().createImage(newOverlaidDesc);
firePropertyChange(PROP_TITLE);
if (overlaidTitleImageDescriptor != null)
JFaceResources.getResources().destroyImage(overlaidTitleImageDescriptor);
overlaidTitleImageDescriptor = newOverlaidDesc;
}
}
Aggregations