Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Select command handler based on where it's triggered from?
Select command handler based on where it's triggered from? [message #337039] Wed, 22 July 2009 20:07 Go to previous message
Eric Jain is currently offline Eric Jain
Messages: 266
Registered: July 2009
Senior Member
Can I assign a different handler to a command, depending on where it was
triggered from (e.g. from a specific toolbar icon vs from a menu item)?

I know how to override handlers when specific parts are in focus:

<handler class="test.FooHandler" commandId="testCommand">
<activeWhen>
<with variable="activePartId">
<equals value="testView"/>
</with>
</activeWhen>
</handler>

...but this approach has some limitations (for example I'd like to
override the org.eclipse.ui.newWizard command when a specific view is in
focus, but the default handler should be used when the command is
triggered via the top-level menu, even if the view is still active).
 
Read Message
Read Message
Previous Topic:Best way to listen to context activation/deactivation
Next Topic:How to Add menu contribution when an specific editor is active - using org.eclipse.ui.menus
Goto Forum:
  


Current Time: Thu May 23 09:58:12 EDT 2013

Powered by FUDForum. Page generated in 0.01632 seconds