Undo/Redo key bindings [message #777040] |
Mon, 09 January 2012 12:54  |
Eclipse User |
|
|
|
Hi guys,
I have implemented a GEF based editor. My problem is with Undo and Redo actions keybindings.
The code in my editor
protected void createActions() {
ActionRegistry registry = getActionRegistry();
IAction action;
action = new UndoAction(this);
registry.registerAction(action);
getStackActions().add(action.getId());
action = new RedoAction(this);
registry.registerAction(action);
getStackActions().add(action.getId());
...
}
and in my ActionBarContributor
@Override
protected void buildActions() {
addRetargetAction(new UndoRetargetAction();
addRetargetAction(new RedoRetargetAction());
}
@Override
public void contributeToMenu(IMenuManager menubar) {
super.contributeToMenu(menubar);
IMenuManager editMenu = menubar.findMenuUsingPath("edit");
if (editMenu != null) {
editMenu.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, getAction(ActionFactory.UNDO.getId()));
editMenu.insertBefore(IWorkbenchActionConstants.MB_ADDITIONS, getAction(ActionFactory.REDO.getId()));
}
}
Undo/Redo works fine except there is no key bindings for them. My code is same as in Logic example and when I run it, keybindigs work there.
Any ideas?
[Updated on: Mon, 09 January 2012 13:01] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.64584 seconds