| Summary: | [CSS] Diagram refresh undo/redo problems | ||
|---|---|---|---|
| Product: | [Modeling] Papyrus | Reporter: | Christian Damus <give.a.damus> |
| Component: | Diagram | Assignee: | Christian Damus <give.a.damus> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | cletavernier, papyrus-bugs |
| Version: | 1.1.0 | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://youtu.be/bv2Gozopha0 | ||
| See Also: |
https://git.eclipse.org/r/43341 https://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=f584936c1eb00c25c8d082b768a09de8e6fd8622 https://git.eclipse.org/c/papyrus/org.eclipse.papyrus.git/commit/?id=076626232757a6cc017b64d4d9d9d3cbe31906a1 |
||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 433206 | ||
|
Description
Christian Damus
New Gerrit change created: https://git.eclipse.org/r/43341 I have uploaded a video (referenced in the URL field) demonstrating the consequence of non-transactional CSS-triggered refresh of diagrams when CSS determines the activation of CanonicalEditPolicy:
http://youtu.be/bv2Gozopha0
I've referenced a commit (f584936) on the committers/cdamus/433206-diagram-sync branch that fixes the problem of undo of semantic-model changes breaking diagrams that had been synchronized by canonical edit-policies that subsequently became disabled by non-transactional changes such as CSS refreshes. This implements a new "semi-active" state in the PapyrusCanonicalEditPolicy, in which it is not active as far as GMF is concerned, in particularly not creating and deleting child views as necessary to keep in synch with the semantic model. However, in this semi-active state, it will delete any views that it had previously created by canonical refresh when the corresponding model elements are deleted/invalidated. This requires that it track the views that were created by canonical refresh while the policy is active. As this fix is specific to canonical edit-policy, and probably would only ever be an issue at all in that context, I think it's not appropriate to merge it to master until the rest of the bug 433206 feature is merged. What would happen if the undo operations (As shown in the video) occurred after the diagram has been closed? The EditPolicy would certainly be completely removed, and would be unable to clean anything up? Unless it can remain semi-active even after it has been disabled/removed from its edit part, due to the listeners on the Notation Model? (In reply to Camille Letavernier from comment #4) > What would happen if the undo operations (As shown in the video) occurred > after the diagram has been closed? The EditPolicy would certainly be > completely removed, and would be unable to clean anything up? Thanks, you have reminded me why my initial implementation of the canonically-created map was stored statically: because edit-policies come and go as diagrams are opened and closed, but the identity of notation views persists as long as the Papyrus editor is open. I broke that when (in the interests of performance) I changed the map to be stored per edit policy instance. Silly me! A brief video demonstrating the fix, including closing and re-opening the diagram:
http://youtu.be/XNyl6hlcs08
Fixed by commit 0766262. |