use of org.eclipse.jface.viewers.DecorationOverlayIcon in project dsl-devkit by dsldevkit.
the class PreferenceRule method getImage.
/**
* {@inheritDoc}
*/
@Override
public Image getImage() {
if (isOptional()) {
// No decoration
return getUndecoratedImage();
} else {
final ImageDescriptor[] descriptors = new ImageDescriptor[ValidPreferenceConstants.DECORATION_QUADRANTS_COUNT];
descriptors[IDecoration.BOTTOM_RIGHT] = ValidPreferenceConstants.LOCK_OVERLAY_IMAGE_DESCRIPTOR;
// Overlay custom image over base image
return getImageManager().createImage(new DecorationOverlayIcon(getUndecoratedImage(), descriptors));
}
}
use of org.eclipse.jface.viewers.DecorationOverlayIcon in project tdq-studio-se by Talend.
the class PatternLabelProvider method getImage.
@Override
public Image getImage(Object element) {
if (element instanceof IFolder) {
return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
}
if (element instanceof IFile) {
Pattern findPattern = PatternResourceFileHelper.getInstance().findPattern((IFile) element);
boolean validStatus = TaggedValueHelper.getValidStatus(findPattern);
ImageDescriptor imageDescriptor = ImageLib.getImageDescriptor(ImageLib.PATTERN_REG);
if (!validStatus) {
ImageDescriptor warnImg = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_WARN_TSK);
DecorationOverlayIcon icon = new DecorationOverlayIcon(imageDescriptor.createImage(), warnImg, IDecoration.BOTTOM_RIGHT);
imageDescriptor = icon;
}
return imageDescriptor.createImage();
}
return null;
}
use of org.eclipse.jface.viewers.DecorationOverlayIcon in project tdq-studio-se by Talend.
the class DQRuleLabelProvider method getImage.
@Override
public Image getImage(Object element) {
if (element instanceof IFolder) {
return ImageLib.getImage(ImageLib.FOLDERNODE_IMAGE);
}
if (element instanceof IFile && FactoriesUtil.DQRULE.equals(((IFile) element).getFileExtension())) {
IFile file = (IFile) element;
ModelElement me = DQRuleResourceFileHelper.getInstance().getModelElement(file);
// add support for match rule
ModelElement modelElement = DQRuleResourceFileHelper.getInstance().getModelElement(file);
ModelElement rule = DQRuleResourceFileHelper.getInstance().doSwitch(modelElement);
if (rule != null && rule instanceof MatchRuleDefinition) {
ImageDescriptor imageDescriptor = ImageLib.getImageDescriptor(ImageLib.MATCH_RULE_ICON);
return imageDescriptor.createImage();
}
// ~
ImageDescriptor imageDescriptor = ImageLib.getImageDescriptor(ImageLib.DQ_RULE);
if (rule != null && rule instanceof WhereRule) {
boolean validStatus = TaggedValueHelper.getValidStatus(rule);
if (!validStatus) {
ImageDescriptor warnImg = PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_WARN_TSK);
DecorationOverlayIcon icon = new DecorationOverlayIcon(imageDescriptor.createImage(), warnImg, IDecoration.BOTTOM_RIGHT);
imageDescriptor = icon;
}
}
return imageDescriptor.createImage();
}
return null;
}
use of org.eclipse.jface.viewers.DecorationOverlayIcon in project abstools by abstools.
the class ABSEditor method updateEditorIcon.
/**
* Throws a {@link SWTException} if the display is disposed
* @param editorres the resource of the editor input
*/
private void updateEditorIcon(IResource editorres) {
try {
int sev = editorres.findMaxProblemSeverity(MARKER_TYPE, true, IResource.DEPTH_INFINITE);
if (sev == IMarker.SEVERITY_INFO) {
setTitleImage(getEditorInput().getImageDescriptor().createImage());
return;
}
ISharedImages simages = PlatformUI.getWorkbench().getSharedImages();
ImageDescriptor overlayIcon = null;
switch(sev) {
case IMarker.SEVERITY_WARNING:
overlayIcon = simages.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING);
break;
case IMarker.SEVERITY_ERROR:
overlayIcon = simages.getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR);
break;
}
Image resourceImage = getEditorInput().getImageDescriptor().createImage();
final DecorationOverlayIcon icon = new DecorationOverlayIcon(resourceImage, overlayIcon, IDecoration.BOTTOM_LEFT);
setTitleImage(icon.createImage());
} catch (CoreException e) {
standardExceptionHandling(e);
}
}
use of org.eclipse.jface.viewers.DecorationOverlayIcon in project hale by halestudio.
the class InstanceValidationStatusAction method createImageDescriptors.
/**
* Creates needed {@link ImageDescriptor}s.
*/
private void createImageDescriptors() {
// load images
noReportDescriptor = InstanceValidationUIPlugin.getImageDescriptor("icons/instance_validation_disabled.gif");
Image noReportBaseImage = InstanceValidationUIPlugin.getDefault().getImageRegistry().get(InstanceValidationUIPlugin.IMG_INSTANCE_VALIDATION);
reportOkDescriptor = new DecorationOverlayIcon(noReportBaseImage, InstanceValidationUIPlugin.getImageDescriptor("icons/signed_yes_ovr.gif"), IDecoration.BOTTOM_LEFT);
reportWarningsDescriptor = new DecorationOverlayIcon(noReportBaseImage, PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEC_FIELD_WARNING), IDecoration.BOTTOM_LEFT);
reportErrorsDescriptor = new DecorationOverlayIcon(noReportBaseImage, PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEC_FIELD_ERROR), IDecoration.BOTTOM_LEFT);
}
Aggregations