Skip to main content



      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 07: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 08:30 Go to previous messageGo to next message
Eclipse UserFriend
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 08: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: Sun Jul 06 09:15:11 EDT 2025

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

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

Back to the top