In my E4 app, I'd like to bind a command to the M1+W shortcut, which should translate to Ctrl-W on Windows.
I have created a Binding Context with the ID "org.eclipse.ui.contexts.window", and a KeyBinding that links the shortcut and the command. The KeyBinding has the ID "org.eclipse.ui.file.close".
Unfortunately, when I launch my app and do a Ctrl-W, I see a little popup at the lower left of the screen with two possible actions. One is "Close", which is the default command, and the other is the command that I have bound to the shortcut.
Is there a way to do that from the e4xmi file, or should I do it programmatically? If I have to do it programmatically, where is the best place to do it? In an Addon? Or in a PostContruct of a class that I declare as "lifeCycleURI" in the product?
Also, shouldn't the binding framework manage the presence of multiple bindings with the same ID? I would have expected that if I set a binding up with that ID, it would take precedance over the existing default binding.
"shouldn't the binding framework manage the presence of multiple bindings with the same ID?", that's exactly what it's doing...the little dialog you see it the KeyBindingManager asking you to choose from two different bindings both of which have declared themselves 'active'...