【问题标题】:Create an Eclipse plugin with customizable key bindings使用可自定义的键绑定创建 Eclipse 插件
【发布时间】:2010-07-28 13:26:49
【问题描述】:

我尝试创建一个带有可自定义键绑定的命令的 Eclipse 插件。 我试过这个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>

默认绑定 Ctrl+Return 可以完美运行,但不会出现在首选项中。缺少什么让它出现在首选项中,以便用户可以自定义键绑定?

【问题讨论】:

    标签: eclipse eclipse-plugin


    【解决方案1】:

    尝试将categoryId 添加到您的命令定义中。

       <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>
    

    【讨论】:

      猜你喜欢
      • 2014-05-12
      • 1970-01-01
      • 2021-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多