Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » enable/disable actions in menu
enable/disable actions in menu [message #459709] Wed, 06 December 2006 11:14 Go to next message
Eclipse UserFriend
Originally posted by: mail.timoschmitt.de

Hi,


how can I control the state of menu actions?
I hava a action registered in plugin.xml(under action.sets).
The action implements the

public void selectionChanged(IAction pAction, ISelection pSelection)

method from IActionDelegate!

The selectionChanged will only be called if you change e.g from editor to
view, etc.
I want to refresh the state whenever the selection in a tableviewer of a
view changes.
How can I do this?
Thanks.

Schmitti
Re: enable/disable actions in menu [message #459714 is a reply to message #459709] Wed, 06 December 2006 13:54 Go to previous message
Eclipse UserFriend
Hi Schmitti,
you have to register the tableviewer as a selection provider in your view
site. This can be done in your createPartControl method with the following
instruction: getSite().setSelectionProvider(<your tableviewer>). For more
information read the following article:
http://www.eclipse.org/articles/Article-WorkbenchSelections/ article.html

Ingo

"Schmitti" <mail@timoschmitt.de> schrieb im Newsbeitrag
news:f633060e7d4aee440636cb449514ba01$1@www.eclipse.org...
> Hi,
>
>
> how can I control the state of menu actions?
> I hava a action registered in plugin.xml(under action.sets).
> The action implements the
> public void selectionChanged(IAction pAction, ISelection pSelection)
>
> method from IActionDelegate!
>
> The selectionChanged will only be called if you change e.g from editor to
> view, etc.
> I want to refresh the state whenever the selection in a tableviewer of a
> view changes.
> How can I do this?
> Thanks.
>
> Schmitti
>
Previous Topic:plugin name format
Next Topic:A Simple Question
Goto Forum:
  


Current Time: Wed Mar 19 09:01:41 EDT 2025

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

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

Back to the top