Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse rcp keybindings don't work

Tags:

eclipse-rcp

e4

I am trying to make eclipse keybindings work. I tried to make the rename command work. I looked at some tutorials and experimented. I enabled command and key binding trace in console (http://eclipsesource.com/blogs/2009/07/08/tip-tracing-keybindings-in-rcp/).

I have created a custom command:

com.mycompany.myproduct.command.rename

This is what I got so far:

1) I tried to follow this tutorial,http://www.vogella.com/tutorials/EclipseCommandsKeybindings/article.html, but I came to the conclusion that this is for e3. This is because you need to add commands plugin that recognize only old e3 handlers. No xmi is involved

2) I tried to use xmi binding contexts. I had my command registered in the top level commands tree and connected to a handler in the top level handlers tree. In the binding tables section I have a bindingTable that works in Dialog and Windows context. I added a key binding. The sequence is "F2" and it is connected to my custom command.

When I hit F2 I get the following message in trace:

COMMANDS >>> execute >>> starting: id=org.eclipse.ui.edit.rename; event=ExecutionEvent(Command(org.eclipse.ui.edit.rename,Rename,
        Rename the selected item,
        Category(org.eclipse.ui.category.file,File,null,true),
        org.eclipse.ui.internal.MakeHandlersGo@1285594,
        ,,true),{},Event {type=1 Tree {} time=1480412218 data=null x=0 y=0 width=0 height=0 detail=0},org.eclipse.e4.ui.workbench.modeling.ExpressionContext@177fc1a)

In short the default eclipse IDE rename command is fired (my key binding does nothing), and nothing happens on my application.

However, if I change the sequece to "M1+1" and hit ctrl + 1, a little pop up comes up that lets me choose between "quick fix" (eclipse IDE command) and my rename. If I choose rename the handler fires.

Now, how do I disable eclipse IDE default keybindings. The instructions of the tutorial in step 1 definitely don't do it.

Thanks!

like image 842
whomaniac Avatar asked May 13 '15 15:05

whomaniac


1 Answers

You can try to force E4 to read your key binding as an user one, adding the "type:user" tag to the KeyBinding itself :

enter image description here

like image 158
Arcadien Avatar answered Dec 28 '22 10:12

Arcadien