Bug 239648 - [Commands] Need to record creation of decorating views.
Summary: [Commands] Need to record creation of decorating views.
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: 2.1   Edit
Hardware: All All
: P3 normal
Target Milestone: 2.1.1   Edit
Assignee: Alex Boyko CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-04 12:52 EDT by Alex Boyko CLA
Modified: 2010-07-19 12:27 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Boyko CLA 2008-07-04 12:52:50 EDT
BasicNodeViewFactory uses Unprotected Transaction for creating views.
Usually it can get away with it but sometimes it causes problems.
When View#setElement() is called in Unprotected Transaction then a change object does not get created for this operation.
Now after Undo the reference set by setElement call would not get cleaned and cross reference adapters will still this (dead) View as referencing the semantic element.
Now if you try to delete the sem element it would not work, because some Advice will search for all Views referencing the sem element and find our dead one and try to delete it and fail because it is already dead.
The Delete operation for semantic element will fail. The element becomes "undeletetable".
Comment 1 Alex Boyko CLA 2008-07-07 11:36:29 EDT
Committed the fix for 2.1.1.
Now we record the setting of semantic element reference for decorating views.
Comment 2 Artem Tikhomirov CLA 2008-12-02 07:16:43 EST
I'm looking into the change made to BasicNodeViewFactory, and kind of stuck trying to understand the reason to wrap node.setElement() into a separate operation. The comment there states the reason is to record #setElement() with a change recorder. However, once Node is added into a Diagram (ViewUtil.insertChildView()), it gets TransactionalChangeRecorder installed and #setElement() change *is* recorded (provided there's outer transactional operation) and then the change is undone correctly (View.unsetElement()). Besides, the previous fix for the same problem (bug #186637, which actually moved #setElement() invocation *after* ViewUtil.insertChildView()) suggests my perspective makes sense. Could you please explain this to me?
Comment 3 Alex Boyko CLA 2008-12-02 11:35:15 EST
Suppose, you need to create a view and you already have an outer write transaction that's recordable. So the view is created attached to the parent and semantic element is set, all these things are recorded. Then you decorate the view install styles, set various structural features and attach extra views to the created one such as compartments, labels etc. So these decorating views may have a semantic element different from the parent view (the one that's being decorated with compartments, labels, etc.). Suppose a view is decorated with a compartment view that has a different semantic element. Decoration of a view runs in s silent not recordable transaction for some optimization reasons. However, we should record the setting of the semantic element for decorating view, such that this reference can be unset on undo.
Hope this helps.
Comment 4 Eclipse Webmaster CLA 2010-07-19 12:27:43 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug