Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Undoable command
Undoable command [message #1781878] Wed, 14 February 2018 08:46 Go to next message
Jim 20100 is currently offline Jim 20100Friend
Messages: 69
Registered: June 2016

How can we prevent a Set or Remove Command to be undoable?

Re: Undoable command [message #1781947 is a reply to message #1781878] Wed, 14 February 2018 23:00 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1199
Registered: July 2009
Location: Canada
Senior Member


You could, in your editing domain or item-provider, wrap a SetCommand or a RemoveCommand in a CommandWrapper subclass that overrides canUndo to return false. Note that this will effectively invalidate all commands that were previously executed on the stack, so that the stack is effectively flushed and starts over.

Re: Undoable command [message #1782023 is a reply to message #1781947] Fri, 16 February 2018 06:29 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30700
Registered: July 2009
Senior Member
Or, more fine-grained, each item provider acts as a factory for creating the commands, so you can specialize the creation of any specific command for any specific object type.
Previous Topic:access cached value from ecore model
Next Topic:Refresh widget contents in Form Page when resource is changed
Goto Forum:

Current Time: Mon Dec 16 13:16:32 GMT 2019

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

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

Back to the top