Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Contributing a custom delete handler to the project explorer context menu
Contributing a custom delete handler to the project explorer context menu [message #1723969] Fri, 19 February 2016 10:33 Go to next message
Robert Munteanu is currently offline Robert MunteanuFriend
Messages: 30
Registered: July 2009
Member
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
Re: Contributing a custom delete handler to the project explorer context menu [message #1724334 is a reply to message #1723969] Tue, 23 February 2016 08:47 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
On 19-Feb-16 11:33, Robert Munteanu wrote:
> actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId() ,
> new SelectionProviderAction(treeViewer, "Delete") { /* co

I think this doesn't affect popups, but only menu (Edit->Delete). Did
you check there?

Felix
Previous Topic:Change color of IOConsoleOutputStream
Next Topic:Hiding a org.eclipse.ui.navigator.navigatorContent extension
Goto Forum:
  


Current Time: Tue Mar 19 11:08:53 GMT 2024

Powered by FUDForum. Page generated in 0.02316 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top