Contributing a custom delete handler to the project explorer context menu [message #1723969] |
Fri, 19 February 2016 05:33  |
Eclipse User |
|
|
|
In an Eclipse plugin I have a custom org.eclipse.ui.navigator.navigatorContent
extension. I am trying to provide a custom Delete handler. Previously I was
using the org.eclipse.ui.popupMenus extension point and with a
objectContribution/action, but that does not support key bindings due to
https://bugs.eclipse.org/bugs/show_bug.cgi?id=32979]
I've tried a couple of approaches:
1. Defining a handler for the delete command
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="org.eclipse.ui.edit.delete"
class="org.apache.sling.ide.eclipse.ui.actions.JcrNodeDeleteHandler">
<activeWhen>
<adapt type="org.apache.sling.ide.eclipse.ui.nav.model.JcrNode"/>
</activeWhen>
</handler>
</extension>
2. Registering a custom delete action in my ActionProvider
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId() ,
new SelectionProviderAction(treeViewer, "Delete") { /* code */ };
None of them seem to have the desired effect - the delete command is not shown
in the context menu.
How can I provide a custom implementation of the delete command for my
custom navigator that also reacts to keybindings?
Thanks,
Robert
|
|
|
|
Powered by
FUDForum. Page generated in 0.02988 seconds