Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to set the IAction disable on popup menu
How to set the IAction disable on popup menu [message #186359] Tue, 05 July 2005 11:15 Go to next message
zhang wei is currently offline zhang weiFriend
Messages: 84
Registered: July 2009
Member
Hi all,

In my editor, I use GEF TreeViewer, I need to add a popup menu on the tree
viewer.
I use treeViewer.setContextMenu(menuProvider) method add a popup menu on
it.

In my popup menu there are some actions(IAction) add on it,
I want to set them disable when I selection some tree items.
But by use IAction.setEnabled(false) to set them disable, I got failed.

Where is wrong? Has any way to set the IAction disable on popup menu?

THX
Re: How to set the IAction disable on popup menu [message #186380 is a reply to message #186359] Tue, 05 July 2005 12:32 Go to previous messageGo to next message
Andreas Holtz is currently offline Andreas HoltzFriend
Messages: 53
Registered: July 2009
Member
wei zhang schrieb am 05.07.2005 13:15:
> Hi all,
>
> In my editor, I use GEF TreeViewer, I need to add a popup menu on the
> tree viewer.
> I use treeViewer.setContextMenu(menuProvider) method add a popup menu on
> it.
>
> In my popup menu there are some actions(IAction) add on it, I want to
> set them disable when I selection some tree items.
> But by use IAction.setEnabled(false) to set them disable, I got failed.
>
> Where is wrong? Has any way to set the IAction disable on popup menu?
>
> THX
>

If they are self implemented actions overwrite calculateEnabled().
Re: How to set the IAction disable on popup menu [message #186595 is a reply to message #186380] Wed, 06 July 2005 01:35 Go to previous message
zhang wei is currently offline zhang weiFriend
Messages: 84
Registered: July 2009
Member
Ah, I got it.

Thanks a lot
Previous Topic:Why private?
Next Topic:getAdapter and IPropertySheetPage Problems
Goto Forum:
  


Current Time: Thu Mar 28 13:24:32 GMT 2024

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

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

Back to the top