Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to add undo/redo to my action from a context menu
How to add undo/redo to my action from a context menu [message #206797] Fri, 06 January 2006 16:50 Go to next message
Eclipse UserFriend
Originally posted by: ngocdannytn.sbcglobal.net

Hi everyone.

Please show me how I can add undo/redo function to my actions which are
executed from a context menu.

Thanks.
Dan
Re: How to add undo/redo to my action from a context menu [message #206924 is a reply to message #206797] Mon, 09 January 2006 09:38 Go to previous message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

Hi Danny,

do not mix up actions and commands.
Undo and redo is implemented in a command (extending AbstractCommand).
Commands can be triggered in your action (extending SelectionAction) by
calling execute(myCommand);

Perhaps you are talking of the undo/redo action: add them to your context
menu with:

IAction action;

action = getActionRegistry().getAction(ActionFactory.UNDO.getId());
manager.appendToGroup(GEFActionConstants.GROUP_UNDO, action);

action = getActionRegistry().getAction(ActionFactory.REDO.getId());
manager.appendToGroup(GEFActionConstants.GROUP_UNDO, action);

hth, Ingo





"Danny Nguyen" <ngocdannytn@sbcglobal.net> wrote in message
news:dpm783$2f5$1@utils.eclipse.org...
> Hi everyone.
>
> Please show me how I can add undo/redo function to my actions which are
> executed from a context menu.
>
> Thanks.
> Dan
>
>
Previous Topic:about omondo eclipseuml
Next Topic:Displaying two Outline-Views
Goto Forum:
  


Current Time: Fri Apr 26 21:41:10 GMT 2024

Powered by FUDForum. Page generated in 0.05470 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top