Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create an Eclipse plugin with customizable key bindings

I tried to create an Eclipse plugin with commands with customizable 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+Return works perfectly, but it does not appear in the preferences. What is missing to make it appear in the preferences, so that the user can customize the key binding?

like image 538
Jazz Avatar asked Jul 28 '10 13:07

Jazz


1 Answers

Try Adding categoryId to your command 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>
like image 119
zvikico Avatar answered Oct 06 '22 22:10

zvikico