Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to disable actions in an context menu?
How to disable actions in an context menu? [message #451481] Wed, 21 June 2006 11:27 Go to next message
Eclipse UserFriend
Originally posted by: dordepozega.amdosoft.com

Hi!

I would like to know how to disable lets say an
erase action on an selection where this action shouldnt
be possible. In short how to turn an action in an context
menu to gray.

Regards
Re: How to disable actions in an context menu? [message #451484 is a reply to message #451481] Wed, 21 June 2006 12:30 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Dorde Pozega wrote:
> Hi!
>
> I would like to know how to disable lets say an
> erase action on an selection where this action shouldnt
> be possible. In short how to turn an action in an context
> menu to gray.

You can update the IAction on selection change within your action delegate.

Or, depending on the extension, you can add an <enabledment/> element to
each action. Check out the extension point description that you are
using (I assume it's org.eclipse.ui.popupMenus)

Later,
PW


Re: How to disable actions in an context menu? [message #451485 is a reply to message #451481] Wed, 21 June 2006 12:59 Go to previous message
Eclipse UserFriend
Originally posted by: dordepozega.amdosoft.com

I solved it .... the Action class has a method called setEnabled(boolean) ,
set as false and voila it disabled.
I tryed to solve this some time ago and really readed the hole API for
Action and didnt seen this method.
Thank you for the fast answer.

Regards.

"Dorde Pozega" <dordepozega@amdosoft.com> wrote in message
news:e7bafk$lqq$1@utils.eclipse.org...
> Hi!
>
> I would like to know how to disable lets say an
> erase action on an selection where this action shouldnt
> be possible. In short how to turn an action in an context
> menu to gray.
>
> Regards
>
Previous Topic:How to show a splash image by launching RCP in the console?
Next Topic:IAction Text in CoolBar
Goto Forum:
  


Current Time: Thu Mar 28 12:29:39 GMT 2024

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

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

Back to the top