|Re: Toggle visibility of toolbar contribution via toggle command [message #503173 is a reply to message #503142]
||Fri, 11 December 2009 04:02
| Philipp Kursawe
Registered: July 2009
On 12/11/2009 6:56 AM, Prakash G.R. wrote:|
> On 09/12/09 2:22 PM, Philipp Kursawe wrote:
>> I have successfully created a toggle command in one of my menus that has
>> a little checkbox using the methods described here:
>> http://blog.eclipse-tips.com/2009/03/commands-part-6-toggle- radio-menu.html
>> Now in my toggle handler I need access to the contribution I want to
>> toggle. Which service does give me access to contributions for
>> "menuExtension" extensions? The contribution in question is a little
>> Label (as a WorkbenchWindowControlContribution). I want it to show/hide
>> depending on the toggle state of the command.
> HandlerUtil.toggleCommandState(command) should help you in changing the
> state of the command. You can do it for the label's command from the
> other toggle command's handler. ICommandService has methods to get the
> command & to refresh the UI contributions.
Thanks for your reply!
The problem is, the label control has no command associated with it.
class=" rapi4j.ui.powerstatus.internal.PowerStatusControlContributio n "
You can see the toggle command. It would need to show/hide the
"rapi4j.ui.powerstatus.Icon" menu contribution. I thought about
introducing a new variable in the visibleWhen enablement but don't know
which variable. Maybe have a property tester, that checks for toggle
states and make itself a listener for preference changes on toggle
preferences to send a re-eval request to the menu manager?
btw: Here is another bug for you to fix, that occured after you
introduced the new proxy WB contributions:
Thanks for fixing... I wonder how the "Heap Status" survived those
changes? It still shows up in the correct size, but maybe its not
contributed via plugin.xml as a menuContribution.
Powered by FUDForum
. Page generated in 0.01836 seconds