Handling changes outside of editor [message #482784] |
Thu, 27 August 2009 19:41  |
Eclipse User |
|
|
|
Hello,
I have a general question regarding GMF support for responding to external
changes to the diagram elements.
What I have is a tree editor, soon to be a view explorer (of the domain
model). The problem that I have is that if I delete the domain elements
outside of the diagram, the listeners pick the deletion up and remove the
graphic. This is fine, with one exception. The exception is that undoing
the delete does not restore the graphical layout. The reason being that
the graphical deletes handled in the handleNotification methods of the
edit parts are not within the transaction. Therefore they are restored by
another listener which does not know what the previous layout values were,
i.e, the x and y positions. This causes them to use their default layout
determined by the layout provider.
This seems odd to me that this situation is not supported, therefore I
decided I'd post the question and see if maybe I was doing something
wrong. If it is not supported by default in GMF and cannot be enabled
easily can you suggest some ways that it could be supported? I have
created a resource set listener to call ViewUtil.destroy() but it seems to
interfere with the DiagramEventBroker and cause unwanted results.
Thanks,
Travis London
|
|
|
Re: Handling changes outside of editor [message #482857 is a reply to message #482784] |
Fri, 28 August 2009 06:38  |
Eclipse User |
|
|
|
Hello Travis,
If you need to make undo for diagram element deletion working then you need
to delete both domain and diagram element inside the same command using EMF
model instance loaded by GMF editor (using EditingDmoain shared across diagram
editor and your view).
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.05086 seconds