Undo/Redo key bindings [message #777040] |
Mon, 09 January 2012 17:54 |
Jan Krakora Messages: 477 Registered: December 2009 Location: Prague |
Senior Member |
|
|
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 18:01] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02748 seconds