Community
Participate
Working Groups
PluginImageHelper allows Images from the Plugin itself only. thus you may have to copy and paste images if you have multiple DSLs using the same metamodel or working with inheritance.
Reminds me of bug 313072 which I still would like to have. A patch is most welcome.
I cannot provide a patch but we have following code as Workaround public class ClasspathAwareImageHelper extends PluginImageHelper { @Override public Image getImage(String imageName) { String imgname = imageName == null ? getDefaultImage() : imageName; if (imgname != null) { Image result = null; String name = getPathSuffix() + imgname; URL imgUrl = getPlugin().getBundle().getResource(name); // use class loader (in Helios SR1 the class loader // is not used) if (imgUrl != null) { ImageDescriptor id = null; result = getPlugin().getImageRegistry().get(imgUrl.toExternalForm()); if (result == null) { id = ImageDescriptor.createFromURL(imgUrl); if (id != null) { result = id.createImage(); getPlugin().getImageRegistry().put(imgUrl.toExternalForm(), result); } } return result; } String notFound = getNotFound(); if (!imgname.equals(notFound)) { return getImage(notFound); } } return null; } }
I have just analyzed the PluginImageHelper class and noticed that it has been extended to be able to load images from other plugins. See also PR https://github.com/eclipse/xtext-eclipse/commit/d8b6369587cc05f2b15fae3fce258a1d34073f48 @Christian Dietrich: Have this change solved the problem described here?
i dont know since i have no longer access to the codebase the problem was reported to
Yes, the changed addressed the issue