Bug 2804 - [Contributions] EC: AbstractUIPlugin API Problems (1GJUE5V)
Summary: [Contributions] EC: AbstractUIPlugin API Problems (1GJUE5V)
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 98
: P3 enhancement (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Simon Arsenault CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:43 EDT by Unknown User CLA
Modified: 2005-01-18 16:44 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown User CLA 2001-10-10 22:43:52 EDT
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
Comment 1 Kevin Haaland CLA 2002-05-30 20:28:15 EDT
Defer
Comment 2 Randy Giffen CLA 2002-08-08 15:47:39 EDT
Reopen for investigation
Comment 3 Simon Arsenault CLA 2002-09-03 16:24:20 EDT
The method on AbtractUIPlugin in not final in release 2.0

There is still no API to get the descriptor from the ImageRegistry.
Comment 4 Simon Arsenault CLA 2003-02-11 11:41:39 EST
Added new method to get descriptor is available