So I thought I'll make a post as personal reference and maybe it helps some other developer.
This is what I did in ApplicationActionBarAdvisor.makeActions().
IBindingService bindingService = (IBindingService) window.getService(IBindingService.class);
bindingService.addBindingManagerListener(new IBindingManagerListener() {
@Override
public void bindingManagerChanged(BindingManagerEvent event) {
BindingManager manager = event.getManager();
for (Binding binding : manager.getBindings()) {
ParameterizedCommand command = binding.getParameterizedCommand();
if (command != null && ActionFactory.SAVE.getCommandId().equals(command.getId())) {
manager.removeBinding(binding);
}
}
}
});
IWorkbenchAction saveDocumentAction = ActionFactory.SAVE.create(window);
saveDocumentAction.setId("saveDocument");
saveDocumentAction.setActionDefinitionId(SAVE_DOCUMENT_COMMAND);
register(saveDocumentAction);
2 comments:
Another possible way is to define your own scheme. This is described here: http://www.vogella.de/articles/EclipseCommands/article.html
Thx for the article... helped me in solving a similar problem
Post a Comment