Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Issues with Undo/Redo on custom AbstractTransactinnalCommand
Issues with Undo/Redo on custom AbstractTransactinnalCommand [message #503290] Fri, 11 December 2009 17:01 Go to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

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


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Issues with Undo/Redo on custom AbstractTransactinnalCommand [message #503488 is a reply to message #503290] Mon, 14 December 2009 08:24 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

It seems that my custom CreateCommand is encapsulated in a composite command which contains a SemanticCreateCommand (in addition of my custom CreateCommand)

I suspect that the interaction between the two command is problematic but I don't know exactly why...

Any hints are welcome Smile


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Issues with Undo/Redo on custom AbstractTransactinnalCommand [message #503712 is a reply to message #503290] Tue, 15 December 2009 07:52 Go to previous message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

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


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team

[Updated on: Tue, 15 December 2009 13:06]

Report message to a moderator

Previous Topic:SVG
Next Topic:[SVG ScaleableImage] setClip
Goto Forum:
  


Current Time: Mon Apr 19 13:43:33 GMT 2021

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

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

Back to the top