Community
Participate
Working Groups
From EC .. Hi, I'm using Eclipse build 0.125. According to the docs, subclasses of AbstractPluginUI can override initializeImageRegistry() to fill the registry with ImageDescriptors of frequently used images. Problems --------------- 1. initializeImageRegistry() is marked 'final' and cannot be override. 2. ImageRegistry does not provide methods for getting the ImageDescriptor, only methods for getting the Image itself. -Sharon NOTES: David Springgay wrote: > Hi Sharon, > I have logged a problem report with your comments. > 1GJUE5V: ITPUI:WIN98 - EC: AbstractUIPlugin API Problems > In the meantime, I suggest you override the createImageRegistry method in > AbstractUIPlugin. Is there any particular reason why you need an image > descriptor rather than an image? Is there some class in JFace which > requires descriptors? > Dave Response .. Hi David, org.eclipse.jface.action.Action.setXXXImage() takes only ImageDescriptor. -Sharon DS (9/12/01 11:06:27 AM) It is quite ironic that our own WorkbenchImages class hides this defficiency by storing a map of descriptor to images, so we failed to notice it. It is only because of the global image cache in ActionContributionItem that we don't create more than one image. Forum Response .. Sharon, <blush> You are right. The API on ImageRegistry does not reflect the API for Action. In the workbench we have a map from image name to descriptor. This makes it easier for us to get the descriptors which have been added to the registry and use them to initialize an action. If the same descriptor is used in more than one action there is still only one copy of the image: the ActionContributionItem has a global image cache itself. Only 1 copy of the image is allocated, even if it is used in more than one action. I have annotated the PR. </blush> Dave
Defer
Reopen for investigation
The method on AbtractUIPlugin in not final in release 2.0 There is still no API to get the descriptor from the ImageRegistry.
Added new method to get descriptor is available