|
|
Re: Key Binding Conflict Question [message #330501 is a reply to message #330449] |
Wed, 30 July 2008 14:50 |
Mike Bernat Messages: 12 Registered: July 2009 |
Junior Member |
|
|
Hi Paul,
Thanks for this suggestion. I ended up using a single
command/handler/binding, and used the dynamic contribution mechanism to
set different strings in the menu based on the state of the selection. The
handler also used this state to route to the desired behavior.
Mike
Paul Webster wrote:
> The keybindings themselves are static in nature (i.e. they are not
> enabled/disabled by command state, but simply do nothing if the command
> is disabled).
> Depending on what you want to accomplish, one possibility is to create a
> context using org.eclipse.ui.contexts that is a sub context of an
> appropriate context (like org.eclipse.ui.window). When your context is
> active, that keybinding defined in that context will override a
> keybinding defined in the org.eclipse.ui.window context.
> Then you would just say "Command A is the common case, CTRL+5 A in
> window, Command B is the other case, CTRL+5 A in my.context"
> Then when appropriate, you would use the IContextService to activate
> my.context.
> PW
|
|
|
Powered by
FUDForum. Page generated in 0.02526 seconds