CommonNavigator 视图:某些热键不起作用

发布于 2024-09-10 06:27:17 字数 361 浏览 4 评论 0原文

我有一个 RCP 应用程序,它重用“org.eclipse.ui.navigator.CommonNavigator”来为我们提供项目视图。它工作得很好,除了一件事:一些热键(Ctrl+C、Ctrl+V、Delete)只是不执行任何操作,而其他热键(如 F2 或 F5)则工作得很好。我认为这可能与以下事实有关:那些不起作用的键也会在编辑器的上下文中执行某些操作。

我使用 Helios 作为目标平台并在 Windows XP 上工作。

有什么想法吗?

替代文本 http://www.panschk.de/pe.jpg

I have a RCP application that reuses "org.eclipse.ui.navigator.CommonNavigator" to give us a project view. It works well, except for one thing: Some hotkeys (Ctrl+C, Ctrl+V, Delete) just don't do anything, while others like F2 or F5 work just fine. I assume it might have to do with the fact that those keys that do not work also do something in the context of the editor(s).

I use Helios as the target plattform and work on windows XP.

Any ideas?

alt text http://www.panschk.de/pe.jpg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想你只要分分秒秒 2024-09-17 06:27:17

问题的解决方法是注册相应的操作/命令。当它们没有注册时,热键将不起作用,因为没有注册的命令可以指向。

所以解决方案非常愚蠢和简单:

ActionBarAdvisor:

protected void makeActions(final IWorkbenchWindow window) {
[...]
        copyAction =ActionFactory.COPY.create(window);
        register(copyAction);
        pasteAction = ActionFactory.PASTE.create(window);
        register(pasteAction);
        deleteAction = ActionFactory.DELETE.create(window);
        register(deleteAction);
}

The fix for the problem was to register the corresponding Actions/Commands. When they are not registered, the Hotkeys will not work, because there is no registered command to point to.

So the solution was pretty stupid and simple:

ActionBarAdvisor:

protected void makeActions(final IWorkbenchWindow window) {
[...]
        copyAction =ActionFactory.COPY.create(window);
        register(copyAction);
        pasteAction = ActionFactory.PASTE.create(window);
        register(pasteAction);
        deleteAction = ActionFactory.DELETE.create(window);
        register(deleteAction);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文