Undo Command doesn't unset model attributes [message #1768480] |
Wed, 19 July 2017 06:42  |
Eclipse User |
|
|
|
Hi All,
I have problem with Undo Command in Graphiti.
First of all, i have implemented default features (add, move, resize, etc..) and custom features of Graphiti.
The features when executed will update/set the attributes of the underlying models link to pictogram elements. My diagram editor then will detect changes via INotifyChangedListener and execute my custom update feature (which extends AbstractUpdateFeature) to update the shapes in the editor.
But, when i invoke the undo (ctrl+z), it only undo the changes made in the shapes/pictogram elements and not the changes in the model.
1. Is my way in handling/updating shapes correct?
2. If so, why does the undo (ctrl+z) doesn't work on my models?
Thanks,
Ken
[Updated on: Wed, 26 July 2017 02:40] by Moderator
|
|
|
|
|
|
|
|
Re: Undo Command doesn't unset model attributes [message #1771146 is a reply to message #1771111] |
Tue, 22 August 2017 09:04  |
Eclipse User |
|
|
|
Ken,
this looks as if your EMF resource implementation (com.mymodel.mkm.myproject.resource.MyResourceImpl) tries to modify the resource (set last update) before saving. The save operation is triggered by the Graphiti editor within a runnable and not inside any EMF transaction:
at com.mymodel.mkm.mymodel.domain.impl.BaseKeyClassImpl.setLastUpdate(BaseKeyClassImpl.java:253)
at com.mymodel.mkm.myproject.resource.MyResourceImpl.save(MyResourceImpl.java:333)
You will need to trigger that change to the model within an EMF transaction, that should fix the exception.
Michael
|
|
|
Powered by
FUDForum. Page generated in 0.03719 seconds