Bug 443816 - SiriusCommonContentProvider should be refreshed in post-commit instead of using SessionListener notifications
Summary: SiriusCommonContentProvider should be refreshed in post-commit instead of usi...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2014-09-11 08:16 EDT by Alex Lagarde CLA
Modified: 2014-11-05 07:42 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Lagarde CLA 2014-09-11 08:16:12 EDT
Currently, the SiriusCommonContentProvider uses SessionListener notifications (REPRESENTATION_CHANGE, SEMANTIC_CHANGE) to refresh itself. In addition of not being performant as we do not know exactly what has changed and hence what must be refreshed, this brakes the EMFT transactional model (as we may be notified during a command execution before all precommit listeners have been called).

A beginning of patch:
https://git.eclipse.org/r/#/c/33094/
Comment 1 Maxime Porhel CLA 2014-11-05 07:42:03 EST
See also org.eclipse.sirius.ui.tools.internal.views.common.navigator.SiriusCommonContentProvider.RefreshViewerTriggerScope.isSemanticChange(Resource) which always return false (corrected in Alex's patch set).


We should also analyse if we really have to trigger the refresh/update for semantic changes from the SiriusCommonContentProvider whereas  org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.notifyChanged(Notification) seems to already refresh the semantic elements. 

Reproduction test case: 
 . Place breakpoints in the previously mentioned code area
 . Open an EcoreTools class diagram
 . Add/Rename/Delete some elements and check the refresh/update of the viewer
 . Add/Rename/Delete representation and check the view refresh
 . Enable/Disable some viewpoint and check the view refresh


Additional Note: If several views with our content provider are refreshed, we have one postcommitlistner per viewer, we might use only one shared post commit listener per sesison.