Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » trouble with keybinding in fragment
trouble with keybinding in fragment [message #732154] Tue, 04 October 2011 05:03 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 18
Registered: September 2011
Junior Member
I'm trying to contribute a keybinding from a model fragment. All the other fragments in the plugin appear to work correctly, including commands, handlers and handledmenuitems. But the keybindings aren't working.

I've got an app with only one BindingContext, and one BindingTable in that context. In my model fragment I'm contributing to the bindings feature of the app's "BindingTable. I can invoke the bound command via a contributed HandledMenuItem but not via the KeyBinding.

Keybinding in the main plugin works ok.

Any suggestions what could be going wrong or how to go about debugging keybindings?
Re: trouble with keybinding in fragment [message #732198 is a reply to message #732154] Tue, 04 October 2011 07:59 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5469
Registered: July 2009
Senior Member
Hi,

So does the contribution end up in the merged model, is it connected to
a command? You can simply check this by adding the live model editor to
your launch config:
* org.eclipse.e4.tools.emf.liveeditor
* org.eclipse.e4.tools.emf.ui
* org.eclipse.e4.tools.emf.ui.script.js
* Hit "Add Require Plugins"

When you launched your app you can bring up the live view of the model
using ALT+SHIFT+F9 which is the same editor you used to create your
initial model but has some additional runtime features (e.g. execution
of JavaScript, Object-Tree inspection, SWT-Tree inspection)


Tom

Am 04.10.11 07:03, schrieb grillo321:
> I'm trying to contribute a keybinding from a model fragment. All the
> other fragments in the plugin appear to work correctly, including
> commands, handlers and handledmenuitems. But the keybindings aren't
> working.
> I've got an app with only one BindingContext, and one BindingTable in
> that context. In my model fragment I'm contributing to the bindings
> feature of the app's "BindingTable. I can invoke the bound command via
> a contributed HandledMenuItem but not via the KeyBinding.
>
> Keybinding in the main plugin works ok.
>
> Any suggestions what could be going wrong or how to go about debugging
> keybindings?
>
Re: trouble with keybinding in fragment [message #733395 is a reply to message #732198] Tue, 04 October 2011 16:26 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 18
Registered: September 2011
Junior Member
Thanks for the response Tom. I tried as you suggested and the results were interesting.

The ALT+SHIFT+F9 binding didn't work, so I added a command for e4.tooling.livemodel and added it to a menuitem, all in the main app. Once I do this the keybinding for ALT+SHIFT+F9 works, as well as the menu item.

When I bring up the view of the model, I see the binding for ALT+SHIFT+F9 as well as my problem keybindings, all in the binding table of my app.

Why is it that I needed to add the command and menu item to get the keybinding to work?

The keybinding I was trying to use was 'w'. For some reason, I tried replacing that with 'W' and suddenly it works. It responds to both w and SHIFT+w. Apparently lowercase letters are never valid as keybindings. Might be nice if the keybinding editor only allowed uppercase.


Re: trouble with keybinding in fragment [message #733436 is a reply to message #733395] Tue, 04 October 2011 16:54 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5469
Registered: July 2009
Senior Member
Do you have all needed addons?

Tom

Am 04.10.11 18:26, schrieb grillo321:
> Thanks for the response Tom. I tried as you suggested and the results
> were interesting.
>
> The ALT+SHIFT+F9 binding didn't work, so I added a command for
> e4.tooling.livemodel and added it to a menuitem, all in the main app.
> Once I do this the keybinding for ALT+SHIFT+F9 works, as well as the
> menu item.
>
> When I bring up the view of the model, I see the binding for
> ALT+SHIFT+F9 as well as my problem keybindings, all in the binding table
> of my app.
>
> Why is it that I needed to add the command and menu item to get the
> keybinding to work?
>
> The keybinding I was trying to use was 'w'. For some reason, I tried
> replacing that with 'W' and suddenly it works. It responds to both w
> and SHIFT+w. Apparently lowercase letters are never valid as
> keybindings. Might be nice if the keybinding editor only allowed
> uppercase.
>
>
>
Re: trouble with keybinding in fragment [message #733437 is a reply to message #733395] Tue, 04 October 2011 16:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5469
Registered: July 2009
Senior Member
Am 04.10.11 18:26, schrieb grillo321:
> Thanks for the response Tom. I tried as you suggested and the results
> were interesting.
>
> The ALT+SHIFT+F9 binding didn't work, so I added a command for
> e4.tooling.livemodel and added it to a menuitem, all in the main app.
> Once I do this the keybinding for ALT+SHIFT+F9 works, as well as the
> menu item.
>
> When I bring up the view of the model, I see the binding for
> ALT+SHIFT+F9 as well as my problem keybindings, all in the binding table
> of my app.
>

Strange do you have the BindingContext assigned to your Window-Element?

Tom
Re: trouble with keybinding in fragment [message #733462 is a reply to message #733436] Tue, 04 October 2011 19:32 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 18
Registered: September 2011
Junior Member
Tom Schindl wrote on Tue, 04 October 2011 12:54
Do you have all needed addons?


Which ones would that be? Here's what I've got:


<addons xmi:id="_QipQdOU9EeCKxc9XMr5sLg" elementId="org.eclipse.e4.core.commands.service" contributionURI="platform:/plugin/org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/>
<addons xmi:id="_QipQdeU9EeCKxc9XMr5sLg" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="platform:/plugin/org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/>
<addons xmi:id="_QipQduU9EeCKxc9XMr5sLg" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="platform:/plugin/org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/>
<addons xmi:id="_QipQd-U9EeCKxc9XMr5sLg" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/>
<addons xmi:id="_QipQeOU9EeCKxc9XMr5sLg" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/>
<addons xmi:id="_QipQeeU9EeCKxc9XMr5sLg" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
Re: trouble with keybinding in fragment [message #733464 is a reply to message #733437] Tue, 04 October 2011 19:36 Go to previous messageGo to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 18
Registered: September 2011
Junior Member
Tom Schindl wrote on Tue, 04 October 2011 12:58
Am 04.10.11 18:26, schrieb grillo321:

Strange do you have the BindingContext assigned to your Window-Element?

Tom


Looks that way. I've only got the one rootContext, and it's set on my TrimmedWindow.
Re: trouble with keybinding in fragment [message #1140215 is a reply to message #732154] Wed, 16 October 2013 07:52 Go to previous message
Ralph Schuster is currently offline Ralph SchusterFriend
Messages: 8
Registered: September 2012
Junior Member
Looks like it is connected to this problem:
http://www.eclipse.org/forums/index.php/t/550175/

I also discovered it a few days ago (same problem, Live Editor could not be started anymore with key binding due to org.eclipse.ui.workbench plugin). Solution is currently to tag all key bindings with type:user which of course is not possible for key bindings defined by the live editor.
Previous Topic:RCP Issue - Maximize is not working in view part in eclipse 4.3 kelper
Next Topic:How to get IProgressService
Goto Forum:
  


Current Time: Thu Nov 27 22:18:47 GMT 2014

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

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