Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » KeyBinding with BindingContext not executed
KeyBinding with BindingContext not executed [message #1707558] Mon, 07 September 2015 11:11 Go to next message
Pascal Heinrich is currently offline Pascal HeinrichFriend
Messages: 9
Registered: April 2015
Junior Member
Hi,

I have a working eclipse e4 application. Now I tried to add some keybindings. Therefore I created a BindingTable and added some KeyBindings (M1+Z).

I have connected this BindingTable with my BindingContext and added my BindingContext to my Main Trimmed Window.

Also I have created a Command, a Handler and the corresponding Handler class.

Now executing my program and pressing CTRL + Z does not do anything.

I have no idea what I have done wrong Sad

Re: KeyBinding with BindingContext not executed [message #1711194 is a reply to message #1707558] Wed, 14 October 2015 05:30 Go to previous messageGo to next message
Yan Zhang is currently offline Yan ZhangFriend
Messages: 4
Registered: November 2014
Junior Member
please follow this link, try to add tag to your custom keybindings.
Re: KeyBinding with BindingContext not executed [message #1711195 is a reply to message #1711194] Wed, 14 October 2015 05:32 Go to previous messageGo to next message
Yan Zhang is currently offline Yan ZhangFriend
Messages: 4
Registered: November 2014
Junior Member
I recently updated one of my E4 applications from Juno to Kepler (V4.3) release. Beside a few things (e.g. adding the HandlerProcessingAddOn to e4xmi configuration) I suddenly lost my customized key bindings. Unfortunately, there was not even a slight hint anywhere in the net why this happened. Most of the web sites were just referring to the afore mentioned add-on. But this didn't bring back the missing key bindings.

So the only solution was to debug the bootstrap of RCP/E4 and find out where the key bindings disappeared. I noticed very early that my Binding Table was read but didn't contain the correct key bindings. Although, an earlier breakpoint revealed that they have been read correctly. However, somehow they were removed and replaced by other ones.

Debugging in Eclipse/E4 is quite exhausting escpecially when you try to trace a problem in the bootstrap mechanism. But finally I saw an extension point (a "processor" to be precise) as root cause. This extension just threw away my key bindings. It eventually turned out to be the org.eclipse.ui.workbench plugin which I required in my application. This plugin defines a BindingToModelProcessor that simply throws away all key bindings within the org.eclipse.ui.contexts.dialogAndWindow Binding Context except those tagged with type:user.

That's the solution. Simple as that. I added the tag to all my key bindings and they were not removed and working again. So be aware when adding org.eclipse.ui.workbench as a dependency plugin to your E4 application.
Re: KeyBinding with BindingContext not executed [message #1711201 is a reply to message #1711195] Wed, 14 October 2015 06:40 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
So the real problem is that you are using org.eclipse.ui plugins for a full Eclipse 4 application. But org.eclipse.ui is Eclipse 3.x API and you should not use it for a full E4 application, because it can cause such issues.
Re: KeyBinding with BindingContext not executed [message #1751591 is a reply to message #1711201] Wed, 11 January 2017 17:25 Go to previous messageGo to next message
Piero Campalani is currently offline Piero CampalaniFriend
Messages: 114
Registered: January 2015
Senior Member

I had the same problem and had to add the type:user tag to all my bindings to make them work.

Using E4 Neon... is that foreseen?
Thanks. !
Re: KeyBinding with BindingContext not executed [message #1772938 is a reply to message #1751591] Tue, 19 September 2017 06:54 Go to previous message
Erik  Lundström is currently offline Erik LundströmFriend
Messages: 22
Registered: July 2009
Junior Member
I am about to bring key bindings alive in my E4 application (which is undergoing migration from E3). Since I anticipate that I will have dependencies to plugins who, in turn, depend on org.eclipse.ui.workbench, the processor that throw away key bindings (unless tagged with type:user) will be in place.
My question: wouldn't defining a BindingContext with completely another ID, say "myapp.contexts.window", solve the problem? Maybe I am missing something?
Previous Topic:[L10N] User defined message files
Next Topic:Button next to Tab in PartStack
Goto Forum:
  


Current Time: Thu Mar 28 10:16:02 GMT 2024

Powered by FUDForum. Page generated in 0.03267 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top