Bug 144126 - [Contributions] Dynamically set menu icons at runtime
Summary: [Contributions] Dynamically set menu icons at runtime
Status: CLOSED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 3.3   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted, needinfo
Depends on:
Blocks:
 
Reported: 2006-05-28 11:44 EDT by Mark Phippard CLA
Modified: 2009-08-30 02:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Phippard CLA 2006-05-28 11:44:35 EDT
We have had a lot of requests for our Subclipse plugin to be able to let the user choose the icons that the plugin uses for menu items and possibly view icons.  There are some decent reasons for this request:

1) At least a third of our users use the CVS plugin a lot and they would like our menus to be very similar to the CVS plugin (which doesn't use icons a lot).  So our menu icons for this set would mostly be 16 x 16 transparent GIF's.

2) At least a third of our users are Subversion users that also use the TortoiseSVN client.  Our icons come from that client, so these users want our icons to stay as they are so that the UI is consistent with TortoiseSVN.

3) The final third of our users want icons for every action, but are not crazy about the ones we provide.  So they would just like a different set of icons to choose from.

I have not been able to figure out any way in Eclipse to do this.  The icons seem to only come from the plugin.xml with no facility to dynamically change them at runtime based on some user preference.

If I am wrong, I'd like to be pointed in a direction that says how to do this.  If I am not wrong, then please consider this for a future enhancement.
Comment 1 Mark Phippard CLA 2006-06-27 09:18:19 EDT
Any comments on this issue?  I am mainly just looking for confirmation that I am correct that it is not currently possible to dynamically set the icon for menu items.
Comment 2 Paul Webster CLA 2006-06-27 09:29:55 EDT
So you are correct, at the moment there is no easy way to replace icons (unless you actually happen to get the workbench IAction and update the image descriptor).  The IActions aren't easily available, except in the IActionDelegate code (i.e. IWorkbenchWindowActionDelegate, IEditorActionDelegate, etc).

As 3.3 progresses eclipse will start using the ICommandImageService, so I think this should be an enhancement considered for 3.3.

PW
Comment 3 Paul Webster CLA 2006-09-28 11:01:42 EDT
There are currently no plans to work on this feature.

PW
Comment 4 Mark Phippard CLA 2006-10-03 16:19:06 EDT
Closing.  We figured out a way to do this in Eclipse 3.2 via the IAction interface.

See this file as an example:

http://subclipse.tigris.org/svn/subclipse/trunk/subclipse/ui/src/org/tigris/subversion/subclipse/ui/actions/ReplaceableIconAction.java

Username = guest

Our actions extend this class and our plugin class that initializes image descriptors initializes different ones based on the preferences.
Comment 5 Denis Roy CLA 2009-08-30 02:09:16 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.