如何在自定义文本编辑器中捕获 CTRL+CLICK
我通过在 Eclipse 插件中子类化 TextEditor 获得了一个自定义编辑器。我正在尝试在自定义编辑器中实现 CTRL+CLICK 操作(如 java 编辑器中的“open statements”)。但我不知道如何捕获CTRL+CLICK。我尝试在其构造函数或initialzeEditor() 中将KeyListener 添加到编辑器的sourceViewer 中,但这不起作用。有谁知道如何做到这一点?
感谢。
I got a custom editor by subclassing TextEditor in Eclipse plugin. I am trying to implement a CTRL+CLICK action(like 'open declaration' in java editor) in my custom editor. But I cannot figure out how to capture CTRL+CLICK. I tried to add a KeyListener to the editor's sourceViewer in its constructor or initialzeEditor(), which didn't work. Has anyone have an idea how to do this?
Thank.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看
如果你需要详细的例子,那么看看plugin.xml的org.eclipse.jdt.ui。 (您可以从 CVS 或 Eclipse Classic SDK 安装中获取 org.eclipse.jdt.ui 的源代码)
Take a look at
If you need detailed examples, then take a look at plugin.xml of org.eclipse.jdt.ui. (You can get the source for org.eclipse.jdt.ui either from CVS or from Eclipse Classic SDK install)