Source:
public Image getImage(Object element) { Image img = null; if (!(element instanceof IResource) && sessionLabelProvider != null) { try { img = sessionLabelProvider.getImage(element); if (img != null && isDanglingRepresentationDescriptor(element)) { DRepresentationDescriptor descRep = getRepresentationDescriptor(element); String prefix = DRepresentationDescriptor.class.getName(); if (descRep != null) { prefix += "_" + descRep.getDescription().getClass().getName(); } String key = MessageFormat.format(Messages.SiriusCommonLabelProvider_eClassDisabled, prefix); Image disabledImage = SiriusEditPlugin.getPlugin().getImageRegistry().get(key); if (disabledImage == null) { ImageDescriptor desc = ImageDescriptor.createFromImage(img); ImageDescriptor disabledDesc = ImageDescriptor.createWithFlags(desc, SWT.IMAGE_DISABLE); SiriusEditPlugin.getPlugin().getImageRegistry().put(key, disabledDesc); disabledImage = SiriusEditPlugin.getPlugin().getImageRegistry().get(key); } img = disabledImage; } } catch (IllegalStateException e) { } catch (NullPointerException e) { } } else if (element instanceof IFile) { IFile file = (IFile) element; if (new IFileQuery(file).isResourceHandledByOpenedSession()) { String fileExtension = file.getFileExtension(); String imgKey = fileExtension + "Decorated"; img = SiriusEditPlugin.getPlugin().getImageRegistry().get(imgKey); if (img == null) { ImageDescriptor imageDescriptor = null; IWorkbenchAdapter wbAdapter = file.getAdapter(IWorkbenchAdapter.class); if (wbAdapter != null) { imageDescriptor = wbAdapter.getImageDescriptor(file); } if (imageDescriptor != null) { ImageDescriptor[] imageDescriptors = new ImageDescriptor[5]; imageDescriptors[IDecoration.TOP_RIGHT] = SiriusCommonLabelProvider.SIRIUS_MODELING_OVERLAY_DESC; img = new DecorationOverlayIcon(imageDescriptor.createImage(), imageDescriptors).createImage(); SiriusEditPlugin.getPlugin().getImageRegistry().put(imgKey, img); } } } } return img; }

Target:
public Image getImage(Object element) { Image img = null; if (!(element instanceof IResource) && sessionLabelProvider != null) { try { img = sessionLabelProvider.getImage(element); DRepresentationDescriptor descRep = getRepresentationDescriptor(element); if (img != null && isDanglingRepresentationDescriptor(descRep)) { StringBuilder sB = new StringBuilder(); if (descRep != null) { sB.append(descRep.getClass().getName()); RepresentationDescription description = descRep.getDescription(); if (description != null) { sB.append('_'); sB.append(description.getClass().getName()); sB.append(DISABLED_REPRESENTATION_SUFFIX); } } String key = sB.toString(); Image disabledImage = SiriusEditPlugin.getPlugin().getImageRegistry().get(key); if (disabledImage == null) { ImageDescriptor desc = ImageDescriptor.createFromImage(img); ImageDescriptor disabledDesc = ImageDescriptor.createWithFlags(desc, SWT.IMAGE_DISABLE); SiriusEditPlugin.getPlugin().getImageRegistry().put(key, disabledDesc); disabledImage = SiriusEditPlugin.getPlugin().getImageRegistry().get(key); } img = disabledImage; } } catch (IllegalStateException e) { } catch (NullPointerException e) { } } else if (element instanceof IFile) { IFile file = (IFile) element; if (new IFileQuery(file).isResourceHandledByOpenedSession()) { String fileExtension = file.getFileExtension(); String imgKey = fileExtension + "Decorated"; img = SiriusEditPlugin.getPlugin().getImageRegistry().get(imgKey); if (img == null) { ImageDescriptor imageDescriptor = null; IWorkbenchAdapter wbAdapter = file.getAdapter(IWorkbenchAdapter.class); if (wbAdapter != null) { imageDescriptor = wbAdapter.getImageDescriptor(file); } if (imageDescriptor != null) { ImageDescriptor[] imageDescriptors = new ImageDescriptor[5]; imageDescriptors[IDecoration.TOP_RIGHT] = SiriusCommonLabelProvider.SIRIUS_MODELING_OVERLAY_DESC; img = new DecorationOverlayIcon(imageDescriptor.createImage(), imageDescriptors).createImage(); SiriusEditPlugin.getPlugin().getImageRegistry().put(imgKey, img); } } } } return img; }