Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » view action enablement without selection provider
icon5.gif  view action enablement without selection provider [message #487823] Thu, 24 September 2009 14:10 Go to next message
Torsten Beuck is currently offline Torsten BeuckFriend
Messages: 38
Registered: July 2009
Member
Hi,

it is really easy to enable or disable view action in the views toolbar and/or menu based on the current selection of a view.

But if a view is not a selection provider because it doesn't show something like a table or tree but only a form or something like that I have problems to enable/disable view actions defined in the plugin.xml. Rolling Eyes

Therefore I'm desperately searching for any advice how to do view action enablement for a view that does not register any ISelectionProvider.

Many thanks in advance for your answers.

- Torsten
Re: view action enablement without selection provider [message #487906 is a reply to message #487823] Thu, 24 September 2009 18:29 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If your view doesn't register an ISelectionProvider then the only way you can enable an action is if you create it yourself so you can update the action enabled state.

For commands/handlers you can use <with variable="activePart"> to get your IViewPart and then write a PropertyTester to return true/false as appropriate. The IEvaluationService needs to be notified when the property changes.

PW


icon7.gif  Re: view action enablement without selection provider [message #487966 is a reply to message #487906] Fri, 25 September 2009 06:22 Go to previous message
Torsten Beuck is currently offline Torsten BeuckFriend
Messages: 38
Registered: July 2009
Member
Hi Paul,

thanks for your answer. I had already suspected that the view actions may not be created through the plugin.xml or that I better should use commands, but I didn't find any example for this.

Thus the confirmation of an expert is really valuable for me.

- Torsten
Previous Topic:[commands] Dynamic enablement observation
Next Topic:Update on ControlContribution
Goto Forum:
  


Current Time: Fri Apr 26 05:16:19 GMT 2024

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

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

Back to the top