Community
Participate
Working Groups
DefaultLabelProvider currently supports icon paths relative to icons in the current plugin. It would be helpful to facilitate use of icons in other plugins by recognising a first character in the icon name as an absolute indicator. Thus the following override could be incorporated in the String case. @Override protected Image convertToImage(Object imageDescription) { if (imageDescription instanceof String) { String imagePath = (String)imageDescription; if (imagePath.startsWith("/")) { int index = imagePath.indexOf('/', 1); if (index > 1) { String bundlePath = imagePath.substring(1, index); Bundle bundle = Platform.getBundle(bundlePath); if (bundle != null) { String imageFile = imagePath.substring(index+1); Path path = new Path(imageFile); URL imgUrl = FileLocator.find(bundle, path, null); if (imgUrl != null) { return super.convertToImage(ImageDescriptor.createFromURL(imgUrl)); } } } } } return super.convertToImage(imageDescription); }
Removed target milestone M3.
Please bind a custom IImageHelper that does that for you.
see also bug 404741 which was fixed in 2.14 It allows image paths of the shape 'platform:/plugin/...'