开发者

CommonNavigator View: Some Hotkeys don't work

开发者 https://www.devze.com 2023-01-07 18:24 出处:网络
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 do开发者_运

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 do开发者_运维问答n'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


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);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号