Bug 150667 - change DiagramModificationListeners to be adapters rather than ResourceSetListeners
Summary: change DiagramModificationListeners to be adapters rather than ResourceSetLis...
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 major
Target Milestone: 1.0.1   Edit
Assignee: Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-07-14 11:53 EDT by Christian Vogt CLA
Modified: 2010-07-19 12:30 EDT (History)
0 users

See Also:


Attachments
patch for FileDiagramModificationListener and DiagramModificationListener (11.94 KB, patch)
2006-07-14 12:00 EDT, Christian Vogt CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Vogt CLA 2006-07-14 11:53:43 EDT
Change DiagramModificationListener's to be adapters on the ResourceSet that attach to all its Resources, rather than ResourceSetListeners.

The scenario that I'm running into is as follows:
I have a diagram editor open with a view to a model element. Modifying the model element results in refactoring of the diagram. This happens with a CompositeTransactionalCommand where one of its children is performing the refactoring. Upon executing this command, when the refactoring is performed, the FileSynchronizer creates an async runnable that unloads the diagram resource. Once the command commits, the FileDiagramModificationListener receives notifications and computes the timestamp and sets the diagram document content.

The FileDiagramModificationListener should have computed the timestamp and content before the FileSynchronizer did its thing. Then the diagram resource wouldn't have been unloaded unnecessarily.

The problem I found is that because notifcations are only fired when the transaction commits, the FileSynchronizer does its thing before the DiagramModifcationListeners. By making the DiagramModificationListeners adapters, notifications will be processed immediately.
Comment 1 Christian Vogt CLA 2006-07-14 12:00:54 EDT
Created attachment 46301 [details]
patch for FileDiagramModificationListener and DiagramModificationListener

This patch changes the FileDiagramModificationListener and DiagramModificationListener to be adapters on the ResourceSet and its Resources.
Comment 2 Anthony Hunter CLA 2006-08-17 10:46:19 EDT
Committed the fix to R1_0_maintenance.

Please send a detailed delivery note to our team.
Comment 3 Eclipse Webmaster CLA 2010-07-19 12:30:16 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime Diagram was the original product and component for this bug