[EMFStore] Atomic Undo/Redo [message #1578911] |
Thu, 22 January 2015 12:43  |
Eclipse User |
|
|
|
I have an EMF-based plugin that uses the capabilities of EMFStore. My problem is that the operations I perform can be completely undone only in several steps. For example, creating a child object using CreateChildCommand results in two operations (Copied from Commit dialog):
- Created child
- Added Child as child in Parent
That's why to perform the undo I have to actually call the undo operation twice (Using UIUndoLastOperationController).
I found a solution using the ProjectSpace.beginCompositeOperation() method, but is looks too "internal".
Here:
www.eclipse.org/forums/index.php/t/540419/
I read that starting from version 1.1 there should be a some kind of a command stack per project. In this case I could just call the undo/redo on command stack.
Also I noticed that the remove command generates one operation but with "nested operations", so undo works here. Can this be applied also for other types of operations?
Yuriy
|
|
|
|
|
Re: [EMFStore] Atomic Undo/Redo [message #1601018 is a reply to message #1597479] |
Wed, 04 February 2015 12:10  |
Eclipse User |
|
|
|
Hi Yuriy,
you are welcome!
Maybe you want to open a bugzilla for having an extension point for
this, I think it is a good idea.
Cheers,
Maximilian
Am 02.02.2015 um 11:16 schrieb Yuriy Flyud:
> Hi Maximilian,
> Thank you for this quick and life-saving answer!
>
> I managed to do this with the following line:
> ExtensionRegistry.INSTANCE.set(ESOperationModifier.ID, new
> AutoOperationWrapper());
>
> I will declare this in plugin activator for now, but it would be great
> to set the operation modifier through extension point some day.
--
Maximilian Kögel
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Powered by
FUDForum. Page generated in 0.03920 seconds