|How do I get different togglestates of a command between views [message #893562]
||Wed, 04 July 2012 14:52
| Alexander Haag
Registered: July 2009
I have an RCP application (using indigo) with multiple navigation views (some of them also multi-instance). Those views all need to have a common command, lets call it 'alphasort'.
This command should be a toggle command and should appear in the toolbars & menus of all the views. Most of the time there are at least two views visible (parallel to each other for Drag&Drop).
The command has a default handler doing the same on every view (setting special sorter). What I want to have is that there is a toggle-state for this command for every view, not a single togglestate for the command.
Right now i have a single togglestate so that toggling in one view will toggle the command in the other views too. I read this behaviour as designed behaviour (see 'https://bugs.eclipse.org/bugs/show_bug.cgi?id=221980#c5').
I defined the command using the article of Prakash ('http://blog.eclipse-tips.com/2009/03/commands-part-6-toggle-radio-menu.html'), see plugin.xml-snippet below.
There was a similar question like mine asked by 'Jay in August 25, 2011 5:57 AM', any replies on that?
- Is there a way to get a togglestate for each view?
- Would it help to create view-dependend handler (using activeWhen-definition) and let the handler manage the togglestate or do i have to define the command multiple times (one for each view)?
- I did not see any way to add the toggle-state to the handler-definition in plugin.xml (this was my first idea getting what i want).
snippet of plugin.xml
If you need any more information, please ask!
Thanks for any help
[Updated on: Wed, 04 July 2012 15:27]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02169 seconds