Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Undo/Redo key bindings
Undo/Redo key bindings [message #777040] Mon, 09 January 2012 12:54 Go to previous message
Jan Krakora is currently offline Jan Krakora
Messages: 402
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 13:01]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic:Visual Designer - GEF + EMF + JEM - opensourced at eclipse labs
Next Topic:GEF functionality within other editor window
Goto Forum:
  


Current Time: Thu May 23 05:24:11 EDT 2013

Powered by FUDForum. Page generated in 0.04681 seconds