Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to remove the icon which has been set for UI Element associated with command?(Set and remove the icon for UI Element associated with command dynamically.)
How to remove the icon which has been set for UI Element associated with command? [message #661804] Sun, 27 March 2011 22:31 Go to next message
Eclipse UserFriend
I want to to remove the icon which has been set for UI Element associated with command.

I tried:-
In the method updateElement (UIElement element, Map parameters)
element.setIcon(null);
It didn't worked (it only sets the icon based on image descriptor). Dummy fix would be re-setting the invisible icon which is not recommended.

We have situation that based on some event icon has to be set and on another event icon has to be removed. Is there a way to remove the icon which has been set for UI Element associated with command ?

Help would be much appreciated.

Thanks,
Santosh
Re: How to remove the icon which has been set for UI Element associated with command? [message #661831 is a reply to message #661804] Mon, 28 March 2011 03:13 Go to previous messageGo to next message
Eclipse UserFriend
On 28/03/11 8:01 AM, Santosh wrote:
> I want to to remove the icon which has been set for UI Element
> associated with command.
>
> I tried:-
> In the method updateElement (UIElement element, Map parameters)
> element.setIcon(null);
> It didn't worked (it only sets the icon based on image descriptor).

CommandContributionItem does sets null to the menu/tool item when null
is passed. If you have a snippet to reproduce the behaviour, please open
a bug: http://bit.ly/NewBugInPlatformUI

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: How to remove the icon which has been set for UI Element associated with command? [message #661845 is a reply to message #661831] Mon, 28 March 2011 04:49 Go to previous message
Eclipse UserFriend
Hi Prakash,

I tried setting null in setIcon method. However, on passing null parameter the entire command is becoming invisible (command will be removed from the toolbar).

I just want to remove the icon from the command and text should be retained and command should work as it used to.

[Updated on: Mon, 28 March 2011 05:27] by Moderator

Previous Topic:Enable/disable selection of TreeViewer
Next Topic:running multiple configurations of an rcp
Goto Forum:
  


Current Time: Sat Sep 27 05:46:18 EDT 2025

Powered by FUDForum. Page generated in 0.04954 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top