Create an Eclipse Plugin with Custom Key Bindings

I tried to create an Eclipse plugin with commands with custom key bindings. I tried with this plugin.xml:

<plugin>
   <extension
         point="org.eclipse.ui.commands">
      <command
            description="Do something"
            id="com.myplugin.myCommand"
            name="My command">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.bindings">
      <key
            commandId="com.myplugin.myCommand"
            contextId="org.python.pydev.ui.editor.scope"
            schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
            sequence="Ctrl+Return">
      </key>
   </extension>
</plugin>

The default binding Ctrl+Returnworks fine, but it does not appear in the settings. What is missing to make it appear in the settings so that the user can configure the key binding?

+5
source share
1 answer

Try adding categoryIdto your team definition.

   <extension
     point="org.eclipse.ui.commands">
  <category
        id="com.myplugin.myCategory"
        name="My Category" 
        description="My Category">
  </category>
  <command
        description="Do something"
        id="com.myplugin.myCommand"
        categoryId="com.myplugin.myCategory"
        name="My command">
  </command>
+11
source

All Articles