[457839] Introduces model update strategies for content merge viewers70/41570/3
commit2211cf6ab664d9c3f63fcf0773cc11e73f082ff4
authorPhilip Langer <planger@eclipsesource.com>
Tue, 10 Feb 2015 17:06:37 +0000 (10 18:06 +0100)
committerAxel RICHARD <axel.richard@obeo.fr>
Fri, 27 Feb 2015 16:23:00 +0000 (27 11:23 -0500)
treede3788446dd58603f8d44330a1014a8096004a43
parent1fad8b5123c35dcead82f5b0452403c0d7f14d7b
[457839] Introduces model update strategies for content merge viewers

Content merge viewers may enable users to actually perform model
updates. Currently, the EMFCompareTextMergeViewer has that functionality
to update EAttribute values. This update functionality is tightly bound
to the diff type though (AttributeChange in this case). Diff extensions
may re-use these content merge viewers for other change types, as it is
the case with OpaqueElementBodyChanges right now. However, as
EMFCompareTextMergeViewer expects attribute changes only, the model
update is not working for such extensions.

To enable model updates for other change types, we introduced
IModelUpdateStrategies and adapted EMFCompareTextMergeViewer to perform
the actual update using a specific model update strategy only without
assuming a specific diff type; model update strategies therefore
encapsulate the knowledge on how to perform the actual model update.
Accessors may now implement IModelUpdateStrategyProviders and provide
such a specific strategy to the content merge viewers they have
selected.

Bug: 457839
Change-Id: I9a2893bc5dac14e333816eae199f1c27ce6840c6
Signed-off-by: Philip Langer <planger@eclipsesource.com>
plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewer.java
plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/text/EMFCompareTextMergeViewerContentProvider.java
plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/CompareInputAdapter.java
plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/contentmergeviewer/IModelUpdateStrategy.java [new file with mode: 0644]
plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/contentmergeviewer/IModelUpdateStrategyProvider.java [new file with mode: 0644]
plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/contentmergeviewer/SingleValuedAttributeModelUpdateStrategy.java [new file with mode: 0644]
plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/contentmergeviewer/accessor/factory/impl/StringAttributeChangeAccessorFactory.java