Issues with Undo/Redo on custom AbstractTransactinnalCommand [message #503290] |
Fri, 11 December 2009 12:01  |
Eclipse User |
|
|
|
Hi all,
I'm trying to implement Undo/redo on my GMF diagram.
I have several custom AbstractTransactionnalCommand that can be well composed together.
I have an extended CreateCommand for creation from the palette and I have a strange behavior with it...
It works separately but with some compostion of undo/redo with my others AbstractTransactionnalCommand it doesn't work fine : it remove the wrong editpart, or a part of a wrong editPart...
I override doUndo and doRedo in my extended CreateCommand. I tried several ways :
- calling super throw me an exception
- do nothing... the undo/redo is done and I really don't know why, who is responsible to do it??? but there is also my issue
- implment with the way I want but same issue
How can it be possible that there is a undo "working" although I do nothing in doUndo...
How can it be possible that it removed the wrong EditPart and only a part of an EditPart?
If you have any hints I will be really thankful.
Aurelien Pupier
|
|
|
|
Re: Issues with Undo/Redo on custom AbstractTransactinnalCommand [message #503712 is a reply to message #503290] |
Tue, 15 December 2009 02:52  |
Eclipse User |
|
|
|
Maybe a first step...
So We saw that my custom CreateCommand is encapsulated into a CompositeCommand
In javadoc CompositeCommand :
Quote: | An undoable command that is composed of child {@link IUndoableOperation}s
* that are not known to modify EMF model resources, but can contain
* model-affecting children.
|
So if I understand correctly :
I need to use command inside my custom CreateCommand in order to follow correctly the API, am I right?
DO I need to implement all my AbstractTransactionnalCommand using Command inside?
After that I encounter another issue, a clascastException.
In fact, inside the refreshBounds method of my EditPart 1 which is used to represent MyElement1, resolveSemanticElement() return an EObject of type MyElement2....
And MyElement2 is the container for MyELement1.
So If you any idea why this is happenning...
Thanks by advance
Aurelien Pupier
[Updated on: Tue, 15 December 2009 08:06] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.07541 seconds