Hello,
I Have two drawers (SWT expandBars) in my custom outline view. I need to provide delete actions in both the drawers and link them to the eclipse delete key binding. The two drawers present different information and so that delete actions have to be separate actions.
Drawer 1: the delete action sits in the actionbar
ActionRegistry registry = this.editor.getActionRegistry();
IActionBars bars = pageSite.getActionBars();
bars.setGlobalActionHandler(ActionFactory.CUT.getId(), registry.getAction(CustomCutAction.ACTION_ID));
bars.setGlobalActionHandler(ActionFactory.COPY.getId(), registry.getAction(CustomCopyAction.ACTION_ID));
bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), registry.getAction(CustomPasteAction.ACTION_ID));
bars.setGlobalActionHandler(ActionFactory.DELETE.getId(), registry.getAction(CustomDeleteAction.ACTION_ID));
Drawer 2
IPageSite pageSite = this.getSite();
IHandlerService handlerService = (IHandlerService) pageSite.getService(IHandlerService.class);
RemoveItemAction deleteAction = new RemoveItemAction(pageSite.getPage(), tree);
handlerService.activateHandler(ActionFactory.DELETE.getId(), new ActionHandler(deleteAction));
The problem is that the CustomDeleteAction runs in both drawers when I press the delete key. I guess the reason is that I am not allowed to over write the binding? Does anybody have an idea as to how I can resolve this issue.
Thank you very much !!