0
votes

So here's the thing

I created a Eclipse plug-in(A plug-in with a view) And now I just want to create a key binding to open the view For example, some of the original views in Eclipse like "Problem" view can be opened and showed with the key combination of "Alt + Shift + Q" So how should I create a key binding like "Ctrl + Space" to show my own view plug-in just like the original views?

I know this has something to do with the extension points, commands, actions and handlers but I'm still learning and can't figure this out.

It would be much appreciated if someone could give me some tips on how to do this

1

1 Answers

0
votes

You use the org.eclipse.ui.bindings extension point to set up key bindings.

For opening a view you can use the existing open view command org.eclipse.ui.views.showView, so you just need something like:

<extension point="org.eclipse.ui.bindings">
 <key
       commandId="org.eclipse.ui.views.showView"
       schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
       sequence="M2+M3+Q C">
    <parameter
          id="org.eclipse.ui.views.showView.viewId"
          value="org.eclipse.ui.console.ConsoleView">
    </parameter>
 </key>
</extension>

This example is the standard binding for the Console view. You will need to use a different sequence and specify your view id in the value.