禁用 Eclipse PDE 中的快捷键
我在 Eclipse 的 PDE 环境中遇到了一个问题。 RSE 透视图将快捷键配置为 CTRL+SHIFT+A。当用户在我们的自定义视角中工作时,我试图禁用此快捷键。我认为我可以通过如下配置plugin.xml 来完成:
<extension point="org.eclipse.ui.bindings">
<key
commandId="my.package.Disable"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="CTRL+SHIFT+A">
</key>
</extension>
<extension point="org.eclipse.ui.commands">
<command
defaultHandler="my.package.handlers.DisableHandler"
id="my.package.Disable"
name="Disable">
</command>
</extension>
根据记录,my.package.handlers.DisableHandler 类包含一个空实现。这会导致 Eclipse 在输入此快捷方式时不执行任何操作。此配置的问题在于,该快捷方式在 RSE 视角中也被阻止。这当然不是我们想要的。有没有一种好方法可以禁用某个视角的快捷键,或者是否始终为整个工作区定义快捷键?
I'm struggling with a problem in the PDE environment of Eclipse. The RSE perspective configures a key shortcut as CTRL+SHIFT+A. I'm trying to disable this key shortcut when a user is working in our custom perspective. I thought I could accomplish by configuring the plugin.xml as follows:
<extension point="org.eclipse.ui.bindings">
<key
commandId="my.package.Disable"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="CTRL+SHIFT+A">
</key>
</extension>
<extension point="org.eclipse.ui.commands">
<command
defaultHandler="my.package.handlers.DisableHandler"
id="my.package.Disable"
name="Disable">
</command>
</extension>
For the record, the my.package.handlers.DisableHandler class contains an empty implementation. This causes Eclipse to do nothing when this shortcut is entered. The problem with this config is that the shortcut is also blocked in the RSE perspective. This is of course not something we want. Is there a nice way to disable a key shortcut for a certain perspective or are shortcuts always defined for the entire workspace?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您不使用它,可以将其删除。
查看 http://code.google.com/p/jbaris-eclipse-plugins/source/browse/trunk/QuickSearchPlugin/src/ar/com/fluxit/quick_search/startup/StartupImpl.java
If you dont use it, you can remove it.
Look at http://code.google.com/p/jbaris-eclipse-plugins/source/browse/trunk/QuickSearchPlugin/src/ar/com/fluxit/quick_search/startup/StartupImpl.java