| Undo/Redo with 3.4 Commands [message #480056] |
Thu, 13 August 2009 11:32  |
Rob Messages: 27 Registered: July 2009 |
Junior Member |
|
|
Hi all,
I used to have an old 3.2 RCP app. I had created my own type of editor,
which used the workbench operation history like so:
operationHistory =
editor.getEditorSite().getWorkbenchWindow().getWorkbench().g etOperationSupport().getOperationHistory();
In the apps ApplicationActionBarAdvisor, I used the undo and redo actions
like so:
undoAction = ActionFactory.UNDO.create(window);
register(undoAction);
Now, when we upgraded to 3.4 and the new menu/command/handler mechanism,
i'm adding the commands to the menu bar as follows (note I dont have
handlers for them)
CommandContributionItemParameter param = new
CommandContributionItemParameter(window, "undo",
"org.eclipse.ui.edit.undo", SWT.NONE);
CommandContributionItem undo = new CommandContributionItem(param);
Unfortunatley, the undo/redo commands don't work anymore. They aren't
updated when my editor operation history changes. Is there anything more I
need to do, to link the commands to the workbench operation history? Do
they not have default handlers to track the operation history?
I've googled my ass off over this, but i'm still not getting anywhere. Any
help would be greatly appreciated!
Thanks.
|
|
|