问题:
Binding(CTRL+S,
ParameterizedCommand(Command(org.eclipse.ui.file.save,Save,
Save the current contents,
Category(org.eclipse.ui.category.file,File,null,true),
org.eclipse.ui.internal.handlers.SaveHandler@fbd1fc,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
Binding(CTRL+S,
ParameterizedCommand(Command(cn.com.bankit.ide.bsp.navigator.command.shield,屏蔽 F2,
,
Category(org.eclipse.core.commands.categories.autogenerated,Uncategorized,Commands that were either auto-generated or have no category,true),
,
,,true),null),
org.eclipse.ui.defaultAcceleratorConfiguration,
org.eclipse.ui.contexts.window,,,system)
如何屏蔽掉Eclipse插件本身的快捷键,使自定义的快捷键功能有效。
1. 屏蔽所有快捷键 (这个方法显然是杀鸡取卵)
((IBindingService)PlatformUI.getWorkbench().getAdapter(IBindingService.class)).setKeyFilterEnabled(false);
PS.:这个能屏蔽所有的Binding 包括自定义的,这显然不合适。
2. 采用默认的ContextID:org.eclipse.ui.contexts.window。 这里有一个缺点,输入快捷键时,同时出现两个快捷键。
在plugin.xml中实现:
<extension
point="org.eclipse.ui.bindings">
<key
commandId="org.xxx.SaveConfigHandler"
contextId="org.eclipse.ui.contexts.window"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="CTRL+S">
</key>
</extension>
3. 屏蔽eclipse的快捷键,使自己的快捷键生效。(这就是所谓的走别人的路,让别人无路可走)
指定自定义ContextID,只有在该ContextID下快捷键才有效。
在plugin.xml中实现扩展点org.eclipse.ui.bindings
<extension
point="org.eclipse.ui.bindings">
<key
commandId="org.xxxx.SaveConfigHandler"
contextId="cn.com.xxx.Context"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="F2">
</key>
</extension>
同时扩展:
<extension
point="org.eclipse.ui.contexts">
<context
id="cn.com.xxx.Context"
name="MY Context"
parentId="org.eclipse.ui.contexts.window">
</context>
</extension>
(以 CommonNavigatorView的F2为例,editor也是一样的道理。
重写起init方法如下:
public void init(IViewSite site, IMemento memento) throws PartInitException
{
super.init(site, memento);
....
....
IContextService contextService = (IContextService) getSite()
.getService(IContextService.class);
contextService.activateContext("cn.com.xxx.Context");
}
分享到:
相关推荐
SVN怎么解决文件冲突conflict
Hierarchical Graph Models for Conflict Resolution 冲突消解的层次图模型
A generalized conflict-free address scheme for arbitrary 2k-point memory-based FFT processors
A climate of conflict.doc
SVN解决冲突(合并别人的修改) 详细讲解了svn冲突合并的方法 非常适合初学者学习
它包含了简单的解释就可以使工作场所中的人付诸实践的好主意,这些人不仅要管理通常发生的冲突,而且要预防冲突。
摘要:VC/C++源码,系统相关,多线程 解决多线程存取访问冲突的一个VC++实例,称之为Access Conflict,如图演示的功能,可看到线程整齐输出,已解决了冲突问题,如何实现呢?请下载源码一看究竟。
Git冲突解决程序Sublime Text插件可帮助您解决这种讨厌的合并冲突。指令Git冲突解决程序附带五个命令: Find Next Conflict , Keep Ours , Keep Theirs , Keep Common Ancestor和Show Conflict Files 。 尽管其中...
svn 解决冲突 confict svn 解决冲突 confict svn 解决冲突 confict
Extension: Fix a conflict with Xamarin that could prevent debugging your Unity game. Extension: Fix a conflict with ReSharper where controls in the settings of Visual Studio would not be displayed. ...
A unified conflict prevention framework for feature-based 3D collaborative designing environment
conflict:冲突
Unofficial version Rx library for Delphi 2005/2006/2007/2009/2010/XE/XE2/XE3 DISCLAIMER: * This software is provided "as is" and is without warranty of any kind. The author(s) of this software does...
语言:English 在您的配置文件中显示Vega冲突的机队和基地战统计数据 在您的配置文件中显示Vega冲突的机队和基地战统计数据
基于图的冲突感知的负载均衡算法,郑安根,廖建新,本文针对基于认证的数据库复制协议事务回滚率比较高的问题提出了一个基于图的冲突感知的负载均衡算法。全局上,该算法首先将系统
git-resolve-conflict <strategy> <filename> 使用给定的策略(-我们,-他们的,-联盟)仅解决一个文件中的合并冲突 git resolve-conflict --ours package.jsongit resolve-conflict --theirs package.jsongit ...
A simulation model based on temporal–spatial conflict and congestion for pedestrian–vehicle mixed evacuation has been investigated. Assuming certain spatial behaviors of individuals during emergency...
Subversion树冲突解决程序当开发人员移动/重命名/删除文件或文件夹时,另一个开发人员也已经移动/重命名/删除或修改了文件或文件夹,就会发生树冲突。 有许多不同的情况可能导致树冲突,并且所有这些情况都需要不同...
Martin, "The Clean Coder: A Code of Conduct for Professional Programmers" Prentice Hall | 2011 | ISBN: 0137081073 | 256 pages | PDF | 6 MB Programmers who endure and succeed amidst swirling ...
git图形化的代码冲突处理工具