Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Goubet2013-03-11 13:35:26 +0000
committerLaurent Goubet2013-03-11 13:35:26 +0000
commitb16dbfeee9e3536364b330376114929c0a845108 (patch)
treeb616f6bf29986da463d3ca5335b3359f55d4fe09
parent76b776ffab77c332a2acb21831ccaf42fecb4a57 (diff)
parent7a2a815d196be073960b6160b7c6b1b8c5f4669e (diff)
downloadorg.eclipse.emf.compare-logical_experimentation.tar.gz
org.eclipse.emf.compare-logical_experimentation.tar.xz
org.eclipse.emf.compare-logical_experimentation.zip
Merge branch 'master' into logical_experimentationlogical_experimentation
-rw-r--r--org.eclipse.emf.compare-parent/pom.xml61
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target4
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava12-sdk.target41
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava13-sdk.target41
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava14-sdk.target41
-rw-r--r--org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-sdk.target38
-rw-r--r--packaging/org.eclipse.emf.compare-feature/sourceTemplateFeature/feature.properties (renamed from plugins/org.eclipse.emf.compare.diagram.ide.papyrus/plugin.properties)23
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml77
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml9
-rw-r--r--packaging/org.eclipse.emf.compare.diagram.papyrus-feature/feature.xml89
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.ide.ui-feature/sourceTemplateFeature/feature.properties (renamed from plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/plugin.properties)23
-rw-r--r--packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml2
-rw-r--r--packaging/org.eclipse.emf.compare.rcp.ui-feature/sourceTemplateFeature/feature.properties (renamed from plugins/org.eclipse.emf.compare.diagram.ide/plugin.properties)23
-rw-r--r--packaging/org.eclipse.emf.compare.uml2-feature/feature.xml2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/edgechanges/EdgechangesTest.java5
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/hide/HideTest.java2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/merge/ExtensionMergeTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/nodechanges/NodechangesTest.java5
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/show/ShowTest.java2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/suite/AllTests.java4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/build.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/icons/full/obj16/LabelChange.gifbin129 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/plugin.xml4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/DiagramDiffItemProvider.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramDiffItemProvider.java)24
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/EdgeChangeItemProvider.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/EdgeChangeItemProvider.java)16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ExtensionsEditPlugin.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramEditPlugin.java)12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ExtensionsItemProviderAdapterFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramCompareItemProviderAdapterFactory.java)50
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/HideItemProvider.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/HideItemProvider.java)16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/NodeChangeItemProvider.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/NodeChangeItemProvider.java)16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ShowItemProvider.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/ShowItemProvider.java)16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/LabelChangeItemProvider.java200
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/ExtensionsItemProviderAdapterFactorySpec.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/DiagramCompareAdapterFactorySpec.java)17
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/ForwardingDiagramDiffItemProvider.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/ForwardingDiagramDiffItemProvider.java)9
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/LabelChangeItemProviderSpec.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/LabelChangeItemProviderSpec.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/NodeChangeItemProviderSpec.java (renamed from plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/NodeChangeItemProviderSpec.java)8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java17
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/suite/AllTests.java4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.checkstyle13
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.classpath7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.project40
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.resources.prefs2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.runtime.prefs2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.core.prefs375
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.ui.prefs61
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.pde.api.tools.prefs178
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/META-INF/MANIFEST.MF16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/build.properties17
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/plugin.xml13
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/pom.xml24
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsIDECompare.java53
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsViewLabelProvider.java38
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.classpath7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.project28
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/META-INF/MANIFEST.MF26
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/build.properties8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/plugin.xml51
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/pom.xml24
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/AbstractUMLViewLabelProvider.java150
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/Activator.java49
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ActivityViewLabelProvider.java81
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ClazzViewLabelProvider.java83
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CommunicationViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ComponentViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CompositeViewLabelProvider.java105
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/DeploymentViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/PackageViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ProfileViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/SequenceViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/StateMachineViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/UseCaseViewLabelProvider.java37
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/META-INF/MANIFEST.MF5
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.ini14
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.properties26
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/build.properties21
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.xml16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/internal/DiagramContentMergeViewerCreator.java (renamed from plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/DiagramContentMergeViewerCreator.java)2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/internal/EcoreToolsIDEUICompare.java (renamed from plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/EcoreToolsIDEUICompare.java)2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.ini14
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.properties26
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/build.properties12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.xml16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/DiContentDescriptor.java (renamed from plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/DiContentDescriptor.java)2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/DiagramContentMergeViewerCreator.java (renamed from plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/DiagramContentMergeViewerCreator.java)2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/PapyrusIDEUICompare.java (renamed from plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/PapyrusIDEUICompare.java)2
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF20
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/build.properties21
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml29
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractEditPartMergeViewer.java80
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractGraphicalMergeViewer.java90
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/GMFCompareUIPlugin.java120
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/AbstractDifferenceDecorator.java227
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DeleteGhostImageFigure.java44
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffDecorationEditPolicy.java33
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffEdgeDecorator.java154
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffLabelDecorator.java149
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffNodeDecorator.java158
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/DiffDecoratorProvider.java188
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/SelectedDiffAdapter.java72
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/AbstractGraphicalMergeViewer.java88
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java103
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/EMFCompareDiagramIDEUIMessages.java (renamed from plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/EMFCompareDiagramIDEUIMessages.java)4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEDiffAccessorImpl.java7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEMatchAccessorImpl.java111
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramDiffAccessor.java22
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramNodeAccessor.java59
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEDiffAccessorFactory.java31
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEMatchAccessorFactory.java27
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/DiagramCompareContentMergeViewer.java634
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java2278
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java439
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/diagram_ide_ui_messages.properties (renamed from plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/diagram_ide_ui_messages.properties)4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/preferences/DiagramComparePreferencesPage.java16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/mergeviewer/EditingDomainUtils.java199
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/structuremergeviewer/filters/GMFRefinedElementsFilter.java74
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/.classpath7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/.project34
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.pde.api.tools.prefs97
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/META-INF/MANIFEST.MF18
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/about.html106
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/build.properties11
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/plugin.xml14
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/pom.xml24
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/schema/viewLabelProvider.exsd109
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/GMFCompareIDEPlugin.java90
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffIDEExtensionPostProcessor.java187
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/AbstractDiffExtensionFactory.java301
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/DiffExtensionFactoryRegistry.java53
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/IDiffExtensionFactory.java72
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderIDEExtensionDescriptor.java83
-rw-r--r--plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderRegistryListener.java111
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF15
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/about.ini14
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/about.properties26
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/build.properties12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/model/diagramCompare.ecore (renamed from plugins/org.eclipse.emf.compare.diagram/model/diagramdiff.ecore)7
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/model/diagramCompare.genmodel20
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/model/diagramdiff.genmodel25
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/plugin.xml20
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/LabelChange.java111
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramDiffImpl.java249
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/LabelChangeImpl.java298
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/DiagramDiff.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramDiff.java)31
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/EdgeChange.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/EdgeChange.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/ExtensionsFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramCompareFactory.java)23
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/ExtensionsPackage.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramComparePackage.java)339
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/Hide.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/Hide.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/NodeChange.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/NodeChange.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/Show.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/Show.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/DiagramDiffImpl.java228
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/EdgeChangeImpl.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/EdgeChangeImpl.java)10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ExtensionsFactoryImpl.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramCompareFactoryImpl.java)49
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ExtensionsPackageImpl.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramComparePackageImpl.java)162
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/HideImpl.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/HideImpl.java)10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/NodeChangeImpl.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/NodeChangeImpl.java)10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ShowImpl.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/ShowImpl.java)10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/util/ExtensionsAdapterFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/util/DiagramCompareAdapterFactory.java)60
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/util/ExtensionsSwitch.java (renamed from plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/util/DiagramCompareSwitch.java)89
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/DiffExtensionFactoryRegistry.java64
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/GMFLabelUtil.java406
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramConfiguration.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramComparisonConfiguration.java)4
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramConstants.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/DiagramCompareConstants.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPlugin.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/DiagramDiffEnginePlugin.java)10
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java)39
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramUIMessages.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/DiagramCompareUIMessages.java)8
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/diagramcompareuimessages.properties (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/diagramcompareuimessages.properties)0
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramExtensionFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/AbstractDiffExtensionFactory.java)12
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/DiagramExtensionFactoryRegistry.java64
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/IDiagramExtensionFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/IDiffExtensionFactory.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/EdgeChangeFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/EdgeChangeFactory.java)30
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/HideFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/HideFactory.java)18
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/NodeChangeFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/NodeChangeFactory.java)34
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/ShowFactory.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/ShowFactory.java)16
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/merge/CompareDiagramMerger.java (renamed from plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/merge/DiagramDiffMerger.java)6
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/AbstractLabelProvider.java64
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/IViewLabelProvider.java49
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionDescriptor.java72
-rw-r--r--plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionRegistry.java93
-rw-r--r--plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/confinoutchg_ov.pngbin0 -> 311 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inadd_ov.gifbin194 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inchg_ov.gifbin191 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/indel_ov.gifbin190 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inoutchg_ov.gifbin299 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outadd_ov.gifbin190 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outchg_ov.gifbin194 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outdel_ov.gifbin188 -> 0 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.edit/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.edit/plugin.xml61
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemDescriptionProvider.java30
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemStyledLabelProvider.java15
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java398
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/CompareItemProviderAdapterFactorySpec.java9
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java34
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ConflictItemProviderSpec.java162
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java148
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java26
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java227
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java117
-rw-r--r--plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java67
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/about.ini14
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/about.properties26
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/build.properties10
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/plugin.xml8
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java8
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java32
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/DynamicObject.java4
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java13
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java344
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerLabelProvider.java36
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/provider/MatchNode.java138
-rw-r--r--plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF12
-rw-r--r--plugins/org.eclipse.emf.compare.ide/plugin.xml8
-rw-r--r--plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java4
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF9
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/about.ini14
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/about.properties26
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/build.properties10
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml33
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java8
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java4
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/CompareColorImpl.java560
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/MergeViewerInfoViewer.java2
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/TableMergeViewer.java3
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterAction.java3
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterActionMenu.java2
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/GroupActionMenu.java2
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/AbstractDifferenceFilter.java (renamed from plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/AddedElementsFilter.java)65
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/ChangedElementsFilter.java114
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java123
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IDifferenceFilter.java17
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IdenticalElementsFilter.java62
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MovedElementsFilter.java115
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoConflictsFilter.java71
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoDeleteConflictsFilter.java83
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/RemovedElementsFilter.java115
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java34
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/SubDiffElementsFilter.java64
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultDifferenceGroup.java31
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultGroupProvider.java2
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DifferenceGroup.java10
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/KindGroupProvider.java8
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/MetamodelGroupProvider.java159
-rw-r--r--plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/ThreeWayComparisonGroupProvider.java10
-rw-r--r--plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/AbstractTestCompareItemProviderAdapter.java248
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestMatchItemProviderSpec.java290
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestReferenceChangeItemProviderSpec.java590
-rw-r--r--plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java11
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.edit/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide.ui/src/org/eclipse/emf/compare/uml2/ide/ui/structuremergeviewer/filters/UMLRefinedElementsFilter.java97
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.ide/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF4
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/about.ini14
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/about.properties26
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/build.properties10
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/plugin.properties2
-rw-r--r--plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java9
-rw-r--r--plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.compare/about.mappings6
-rw-r--r--plugins/org.eclipse.emf.compare/about.properties1
-rw-r--r--plugins/org.eclipse.emf.compare/build.properties2
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java4
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java17
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/MatchSpec.java2
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java4
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ByTypeIndex.java4
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java4
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/URIDistance.java6
-rw-r--r--plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java7
297 files changed, 6517 insertions, 11348 deletions
diff --git a/org.eclipse.emf.compare-parent/pom.xml b/org.eclipse.emf.compare-parent/pom.xml
index ddf39ee1f..0e12c653d 100644
--- a/org.eclipse.emf.compare-parent/pom.xml
+++ b/org.eclipse.emf.compare-parent/pom.xml
@@ -11,36 +11,42 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <prerequisites>
- <maven>3.0</maven>
- </prerequisites>
+ <prerequisites>
+ <maven>3.0</maven>
+ </prerequisites>
- <groupId>org.eclipse.emf.compare</groupId>
- <artifactId>emf.compare-parent</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <packaging>pom</packaging>
+ <groupId>org.eclipse.emf.compare</groupId>
+ <artifactId>emf.compare-parent</artifactId>
+ <version>2.1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
- <licenses>
- <license>
- <name>Eclipse Public License v1.0</name>
- <comments>
- All rights reserved.
+ <licenses>
+ <license>
+ <name>Eclipse Public License v1.0</name>
+ <comments>
+ All rights reserved.
- This program and the accompanying materials are made
- available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.htm
- </comments>
- </license>
- </licenses>
-
- <properties>
- <tycho-version>0.16.0</tycho-version>
- <tycho-extras-version>0.16.0</tycho-extras-version>
- </properties>
+ This program and the accompanying materials are made
+ available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.htm
+ </comments>
+ </license>
+ </licenses>
+ <properties>
+ <tycho-version>0.17.0-SNAPSHOT</tycho-version>
+ <tycho-extras-version>0.17.0-SNAPSHOT</tycho-extras-version>
+ </properties>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>tycho-snapshots</id>
+ <url>https://oss.sonatype.org/content/groups/public/</url>
+ </pluginRepository>
+ </pluginRepositories>
<modules>
<!-- Update Site -->
@@ -86,19 +92,16 @@
<module>../packaging/org.eclipse.emf.compare.diagram.gmf-feature</module>
<module>../plugins/org.eclipse.emf.compare.diagram</module>
<module>../plugins/org.eclipse.emf.compare.diagram.edit</module>
- <module>../plugins/org.eclipse.emf.compare.diagram.ide</module>
<module>../plugins/org.eclipse.emf.compare.diagram.ide.ui</module>
<!-- Ecore Tools -->
<module>../packaging/org.eclipse.emf.compare.diagram.ecoretools-feature</module>
- <module>../plugins/org.eclipse.emf.compare.diagram.ide.ecoretools</module>
<module>../plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools</module>
<module>../plugins/org.eclipse.emf.compare.diagram.ecoretools.tests</module>
<module>../plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests</module>
<!-- Papyrus -->
<module>../packaging/org.eclipse.emf.compare.diagram.papyrus-feature</module>
- <module>../plugins/org.eclipse.emf.compare.diagram.ide.papyrus</module>
<module>../plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus</module>
</modules>
@@ -280,7 +283,7 @@
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>emf.compare-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
- <classifier>targetPlatforms/kepler-m4-sdk</classifier>
+ <classifier>targetPlatforms/kepler-m5-sdk</classifier>
</artifact>
</target>
</configuration>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target
index d0a53a314..259b51076 100644
--- a/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/juno-4.2-sdk.target
@@ -4,8 +4,8 @@
<target name="EMF Compare based on Juno with 4.2 Platform" sequenceNumber="57">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
-<unit id="com.google.guava" version="10.0.1.v201203051515"/>
-<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20120526062928/repository/"/>
+<unit id="com.google.guava" version="11.0.2.v201303041551"/>
+<repository location="http://build.eclipse.org/orbit/committers/orbit-I/20130305082625/I20130305082625/repository/"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.emf.emfstore.fuzzy.feature.feature.group" version="0.9.3.M5"/>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava12-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava12-sdk.target
new file mode 100644
index 000000000..38d3a8dd0
--- /dev/null
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava12-sdk.target
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?><target name="EMF Compare based on Kepler SDK" sequenceNumber="0">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.sdk.feature.group" version="2.9.0.v20130204-1146"/>
+<unit id="org.eclipse.emf.ecoretools.sdk.feature.group" version="1.2.0.201301291331"/>
+<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.7.0.201212181759"/>
+<unit id="org.eclipse.gmf.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.uml2.sdk.feature.group" version="4.1.0.v20130204-1402"/>
+<unit id="org.eclipse.jdt.feature.group" version="3.9.0.v20121210-132935-8-8uFyYFNOfwKNWSo-XLNBDV3834"/>
+<unit id="org.eclipse.papyrus.sdk.feature.feature.group" version="0.10.0.v201302061523"/>
+<unit id="org.eclipse.xtext.sdk.feature.group" version="2.4.0.v201302051002"/>
+<repository location="http://download.eclipse.org/releases/kepler"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.egit.feature.group" version="2.3.1.201302201838-r"/>
+<repository location="http://download.eclipse.org/egit/updates"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.apache.commons.logging" version="1.1.1.v201101211721"/>
+<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20120526062928/repository/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="com.google.guava" version="12.0.1"/>
+<repository location="http://mbarbero.github.com/guava-p2/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.emfstore.modelmutator.feature.feature.group" version="0.9.3.M5"/>
+<unit id="org.eclipse.emf.emfstore.fuzzy.feature.feature.group" version="0.9.3.M5"/>
+<repository location="http://download.eclipse.org/emf-store/milestones/archive/0.9.3.M5"/>
+</location>
+</locations>
+</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava13-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava13-sdk.target
new file mode 100644
index 000000000..d617dc471
--- /dev/null
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava13-sdk.target
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?><target name="EMF Compare based on Kepler SDK" sequenceNumber="0">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.sdk.feature.group" version="2.9.0.v20130204-1146"/>
+<unit id="org.eclipse.emf.ecoretools.sdk.feature.group" version="1.2.0.201301291331"/>
+<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.7.0.201212181759"/>
+<unit id="org.eclipse.gmf.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.uml2.sdk.feature.group" version="4.1.0.v20130204-1402"/>
+<unit id="org.eclipse.jdt.feature.group" version="3.9.0.v20121210-132935-8-8uFyYFNOfwKNWSo-XLNBDV3834"/>
+<unit id="org.eclipse.papyrus.sdk.feature.feature.group" version="0.10.0.v201302061523"/>
+<unit id="org.eclipse.xtext.sdk.feature.group" version="2.4.0.v201302051002"/>
+<repository location="http://download.eclipse.org/releases/kepler"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.egit.feature.group" version="2.3.1.201302201838-r"/>
+<repository location="http://download.eclipse.org/egit/updates"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.apache.commons.logging" version="1.1.1.v201101211721"/>
+<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20120526062928/repository/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="com.google.guava" version="13.0.1"/>
+<repository location="http://mbarbero.github.com/guava-p2/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.emfstore.modelmutator.feature.feature.group" version="0.9.3.M5"/>
+<unit id="org.eclipse.emf.emfstore.fuzzy.feature.feature.group" version="0.9.3.M5"/>
+<repository location="http://download.eclipse.org/emf-store/milestones/archive/0.9.3.M5"/>
+</location>
+</locations>
+</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava14-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava14-sdk.target
new file mode 100644
index 000000000..4e05d818d
--- /dev/null
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-guava14-sdk.target
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?><target name="EMF Compare based on Kepler SDK" sequenceNumber="0">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.sdk.feature.group" version="2.9.0.v20130204-1146"/>
+<unit id="org.eclipse.emf.ecoretools.sdk.feature.group" version="1.2.0.201301291331"/>
+<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.7.0.201212181759"/>
+<unit id="org.eclipse.gmf.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.uml2.sdk.feature.group" version="4.1.0.v20130204-1402"/>
+<unit id="org.eclipse.jdt.feature.group" version="3.9.0.v20121210-132935-8-8uFyYFNOfwKNWSo-XLNBDV3834"/>
+<unit id="org.eclipse.papyrus.sdk.feature.feature.group" version="0.10.0.v201302061523"/>
+<unit id="org.eclipse.xtext.sdk.feature.group" version="2.4.0.v201302051002"/>
+<repository location="http://download.eclipse.org/releases/kepler"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.egit.feature.group" version="2.3.1.201302201838-r"/>
+<repository location="http://download.eclipse.org/egit/updates"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.apache.commons.logging" version="1.1.1.v201101211721"/>
+<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/R20120526062928/repository/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="com.google.guava" version="14.0.0"/>
+<repository location="http://mbarbero.github.com/guava-p2/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.emfstore.modelmutator.feature.feature.group" version="0.9.3.M5"/>
+<unit id="org.eclipse.emf.emfstore.fuzzy.feature.feature.group" version="0.9.3.M5"/>
+<repository location="http://download.eclipse.org/emf-store/milestones/archive/0.9.3.M5"/>
+</location>
+</locations>
+</target>
diff --git a/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-sdk.target b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-sdk.target
new file mode 100644
index 000000000..613b97453
--- /dev/null
+++ b/org.eclipse.emf.compare-parent/targetPlatforms/kepler-m5-sdk.target
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?><target name="EMF Compare based on Kepler SDK" sequenceNumber="0">
+<locations>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.sdk.feature.group" version="2.9.0.v20130204-1146"/>
+<unit id="org.eclipse.emf.ecoretools.sdk.feature.group" version="1.2.0.201301291331"/>
+<unit id="org.eclipse.gmf.runtime.notation.sdk.feature.group" version="1.7.0.201212181759"/>
+<unit id="org.eclipse.gmf.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.gmf.runtime.sdk.feature.group" version="1.7.0.201212181845"/>
+<unit id="org.eclipse.uml2.sdk.feature.group" version="4.1.0.v20130204-1402"/>
+<unit id="org.eclipse.jdt.feature.group" version="3.9.0.v20121210-132935-8-8uFyYFNOfwKNWSo-XLNBDV3834"/>
+<unit id="org.eclipse.papyrus.sdk.feature.feature.group" version="0.10.0.v201302061523"/>
+<unit id="org.eclipse.xtext.sdk.feature.group" version="2.4.0.v201302051002"/>
+<repository location="http://download.eclipse.org/releases/kepler"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.egit.feature.group" version="2.3.1.201302201838-r"/>
+<repository location="http://download.eclipse.org/egit/updates"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.swtbot.eclipse.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.ide.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.eclipse.test.junit4.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<unit id="org.eclipse.swtbot.feature.group" version="2.0.5.20111003_1754-3676ac8-dev-e36"/>
+<repository location="http://download.eclipse.org/technology/swtbot/helios/dev-build/update-site"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="com.google.guava" version="11.0.2.v201303041551"/>
+<unit id="org.apache.commons.logging" version="1.1.1.v201101211721"/>
+<repository location="http://build.eclipse.org/orbit/committers/orbit-I/20130305082625/I20130305082625/repository/"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.emf.emfstore.modelmutator.feature.feature.group" version="0.9.3.M5"/>
+<unit id="org.eclipse.emf.emfstore.fuzzy.feature.feature.group" version="0.9.3.M5"/>
+<repository location="http://download.eclipse.org/emf-store/milestones/archive/0.9.3.M5"/>
+</location>
+</locations>
+</target>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/plugin.properties b/packaging/org.eclipse.emf.compare-feature/sourceTemplateFeature/feature.properties
index 94d9e829d..748aa96d5 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/plugin.properties
+++ b/packaging/org.eclipse.emf.compare-feature/sourceTemplateFeature/feature.properties
@@ -1,12 +1,11 @@
-################################################################################
-# Copyright (c) 2006, 2012 Obeo.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Obeo - initial API and implementation
-################################################################################
-pluginName = EMF Compare Papyrus Support IDE Integration
-providerName = Eclipse Modeling Project
+################################################################################
+# Copyright (c) 2006, 2012 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+featureName = EMF Compare Core SDK
diff --git a/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml b/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml
index d77bb75d1..c32833e3c 100644
--- a/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.ecoretools-feature/feature.xml
@@ -1,42 +1,35 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.emf.compare.diagram.ecoretools"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.emf.compare">
-
- <description>
- %description
- </description>
-
- <copyright url="%copyrightURL">
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.emf.compare" version="2.1.0.qualifier"/>
- <import feature="org.eclipse.emf.compare.ide.ui" version="2.1.0.qualifier"/>
- <import feature="org.eclipse.emf.ecoretools" version="1.0.0"/>
- <import feature="org.eclipse.emf.compare.diagram.gmf" version="2.1.0.qualifier"/>
- </requires>
-
- <plugin
- id="org.eclipse.emf.compare.diagram.ide.ecoretools"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.emf.compare.diagram.ide.ui.ecoretools"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.emf.compare.diagram.ecoretools"
+ label="%featureName"
+ version="2.1.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.emf.compare.diagram.ide.ui.ecoretools">
+
+ <description>
+ %description
+ </description>
+
+ <copyright url="%copyrightURL">
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.emf.compare" version="2.1.0.qualifier"/>
+ <import feature="org.eclipse.emf.compare.ide.ui" version="2.1.0.qualifier"/>
+ <import feature="org.eclipse.emf.ecoretools" version="1.0.0"/>
+ <import feature="org.eclipse.emf.compare.diagram.gmf" version="2.1.0.qualifier"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.emf.compare.diagram.ide.ui.ecoretools"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml b/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml
index 5f45a8dcf..626d97116 100644
--- a/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.gmf-feature/feature.xml
@@ -4,7 +4,7 @@
label="%featureName"
version="2.1.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.emf.compare">
+ plugin="org.eclipse.emf.compare.diagram">
<description>
%description
@@ -39,13 +39,6 @@
unpack="false"/>
<plugin
- id="org.eclipse.emf.compare.diagram.ide"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
id="org.eclipse.emf.compare.diagram.ide.ui"
download-size="0"
install-size="0"
diff --git a/packaging/org.eclipse.emf.compare.diagram.papyrus-feature/feature.xml b/packaging/org.eclipse.emf.compare.diagram.papyrus-feature/feature.xml
index 39a657420..1c7b6055b 100644
--- a/packaging/org.eclipse.emf.compare.diagram.papyrus-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.diagram.papyrus-feature/feature.xml
@@ -1,48 +1,41 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.emf.compare.diagram.papyrus"
- label="%featureName"
- version="2.1.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.emf.compare">
-
- <description>
- %description
- </description>
-
- <copyright url="%copyrightURL">
- %copyright
- </copyright>
-
- <license url="%licenseURL">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.emf.compare" version="2.1.0.qualifier"/>
- <import feature="org.eclipse.emf.compare.diagram.gmf" version="2.1.0.qualifier"/>
- <import feature="org.eclipse.emf.compare.ide.ui" version="2.1.0.qualifier"/>
- <import feature="org.eclipse.emf.compare.uml2" version="2.1.0.qualifier"/>
- <import feature="org.eclipse.papyrus.infra.core.feature" version="0.9.1.v201209190809"/>
- <import feature="org.eclipse.papyrus.infra.emf.feature" version="0.9.1.v201209190809"/>
- <import feature="org.eclipse.papyrus.infra.gmfdiag.feature" version="0.9.1.v201209190809"/>
- <import feature="org.eclipse.papyrus.uml.diagram.feature" version="0.9.1.v201209190809"/>
- <import feature="org.eclipse.papyrus.uml.tools.feature" version="0.9.1.v201209190809"/>
- <import plugin="org.eclipse.gmf.runtime.diagram.ui" version="1.6.0" match="greaterOrEqual"/>
- </requires>
-
- <plugin
- id="org.eclipse.emf.compare.diagram.ide.papyrus"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.emf.compare.diagram.ide.ui.papyrus"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.eclipse.emf.compare.diagram.papyrus"
+ label="%featureName"
+ version="2.1.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.eclipse.emf.compare.diagram.ide.ui.papyrus">
+
+ <description>
+ %description
+ </description>
+
+ <copyright url="%copyrightURL">
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <requires>
+ <import feature="org.eclipse.emf.compare" version="2.1.0.qualifier"/>
+ <import feature="org.eclipse.emf.compare.diagram.gmf" version="2.1.0.qualifier"/>
+ <import feature="org.eclipse.emf.compare.ide.ui" version="2.1.0.qualifier"/>
+ <import feature="org.eclipse.emf.compare.uml2" version="2.1.0.qualifier"/>
+ <import feature="org.eclipse.papyrus.infra.core.feature" version="0.9.1.v201209190809"/>
+ <import feature="org.eclipse.papyrus.infra.emf.feature" version="0.9.1.v201209190809"/>
+ <import feature="org.eclipse.papyrus.infra.gmfdiag.feature" version="0.9.1.v201209190809"/>
+ <import feature="org.eclipse.papyrus.uml.diagram.feature" version="0.9.1.v201209190809"/>
+ <import feature="org.eclipse.papyrus.uml.tools.feature" version="0.9.1.v201209190809"/>
+ <import plugin="org.eclipse.gmf.runtime.diagram.ui" version="1.6.0" match="greaterOrEqual"/>
+ </requires>
+
+ <plugin
+ id="org.eclipse.emf.compare.diagram.ide.ui.papyrus"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
diff --git a/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml b/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml
index e1a31484d..00f2c9111 100644
--- a/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.ide.ui-feature/feature.xml
@@ -4,7 +4,7 @@
label="%featureName"
version="2.1.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.emf.compare">
+ plugin="org.eclipse.emf.compare.ide.ui">
<description>
%description
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/plugin.properties b/packaging/org.eclipse.emf.compare.ide.ui-feature/sourceTemplateFeature/feature.properties
index 03dfa5121..8ee51637e 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/plugin.properties
+++ b/packaging/org.eclipse.emf.compare.ide.ui-feature/sourceTemplateFeature/feature.properties
@@ -1,12 +1,11 @@
-################################################################################
-# Copyright (c) 2006, 2012 Obeo.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Obeo - initial API and implementation
-################################################################################
-pluginName = EMF Compare EcoreTools Support IDE Integration
-providerName = Eclipse Modeling Project
+################################################################################
+# Copyright (c) 2006, 2012 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+featureName = EMF Compare IDE UI SDK
diff --git a/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml b/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
index 538f37f33..876aa8cb4 100644
--- a/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.rcp.ui-feature/feature.xml
@@ -4,7 +4,7 @@
label="%featureName"
version="2.1.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.emf.compare">
+ plugin="org.eclipse.emf.compare.rcp.ui">
<description>
%description
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/plugin.properties b/packaging/org.eclipse.emf.compare.rcp.ui-feature/sourceTemplateFeature/feature.properties
index c90cf0c78..a2c0ca9ab 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide/plugin.properties
+++ b/packaging/org.eclipse.emf.compare.rcp.ui-feature/sourceTemplateFeature/feature.properties
@@ -1,12 +1,11 @@
-################################################################################
-# Copyright (c) 2006, 2012 Obeo.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Obeo - initial API and implementation
-################################################################################
-pluginName = EMF Compare Diagram Comparison Support IDE Integration
-providerName = Eclipse Modeling Project
+################################################################################
+# Copyright (c) 2006, 2012 Obeo.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Obeo - initial API and implementation
+################################################################################
+featureName = EMF Compare RCP UI SDK
diff --git a/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml b/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml
index 9b418b71a..f60e3c7f6 100644
--- a/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml
+++ b/packaging/org.eclipse.emf.compare.uml2-feature/feature.xml
@@ -4,7 +4,7 @@
label="%featureName"
version="2.1.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.emf.compare">
+ plugin="org.eclipse.emf.compare.uml2">
<description>
%description
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF
index 3b581f853..796a8c8b9 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/META-INF/MANIFEST.MF
@@ -12,11 +12,10 @@ Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.5.0",
org.eclipse.emf.compare,
org.eclipse.gmf.runtime.emf.core;bundle-version="1.2.2",
org.eclipse.gmf.runtime.notation;bundle-version="1.2.0",
- org.eclipse.emf.compare.diagram.ide.ecoretools;bundle-version="2.0.0",
org.eclipse.ui;bundle-version="3.5.0",
org.eclipse.emf.compare.uml2;bundle-version="2.1.0"
-Import-Package: com.google.common.base;version="[10.0.1,11.0.0)",
- com.google.common.collect;version="[10.0.1,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java
index 7dd6cc3c0..19f778dde 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/AbstractTest.java
@@ -5,7 +5,7 @@ import java.util.List;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.diagram.diff.DiagramDiffExtensionPostProcessor;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor;
import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.ecore.resource.Resource;
@@ -29,7 +29,7 @@ public abstract class AbstractTest {
postProcessorRegistry.addPostProcessor(new PostProcessorDescriptor(
"http://www.eclipse.org/gmf/runtime/\\d.\\d.\\d/notation", null,
"org.eclipse.emf.compare.diagram.diff.DiagramDiffExtensionPostProcessor",
- new DiagramDiffExtensionPostProcessor()));
+ new CompareDiagramPostProcessor()));
emfCompare = EMFCompare.builder().setPostProcessorRegistry(postProcessorRegistry).build();
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/edgechanges/EdgechangesTest.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/edgechanges/EdgechangesTest.java
index 98f6e63dd..192626ae9 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/edgechanges/EdgechangesTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/edgechanges/EdgechangesTest.java
@@ -2,10 +2,10 @@ package org.eclipse.emf.compare.diagram.ecoretools.tests.edgechanges;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
+import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertSame;
import static junit.framework.Assert.assertTrue;
-import static junit.framework.Assert.assertFalse;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import java.io.IOException;
@@ -18,15 +18,14 @@ import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.diagram.EdgeChange;
import org.eclipse.emf.compare.diagram.ecoretools.tests.AbstractTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.DiagramInputData;
import org.eclipse.emf.compare.diagram.ecoretools.tests.edgechanges.data.EdgeChangesInputData;
+import org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.utils.MatchUtil;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.View;
import org.junit.Ignore;
import org.junit.Test;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/hide/HideTest.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/hide/HideTest.java
index 8fe57a503..76abf5623 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/hide/HideTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/hide/HideTest.java
@@ -15,10 +15,10 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.diagram.Hide;
import org.eclipse.emf.compare.diagram.ecoretools.tests.AbstractTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.DiagramInputData;
import org.eclipse.emf.compare.diagram.ecoretools.tests.hide.data.HideInputData;
+import org.eclipse.emf.compare.diagram.internal.extensions.Hide;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gmf.runtime.notation.NotationPackage;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/merge/ExtensionMergeTest.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/merge/ExtensionMergeTest.java
index 1bfe3a4c7..605b753cd 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/merge/ExtensionMergeTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/merge/ExtensionMergeTest.java
@@ -21,11 +21,11 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
import org.eclipse.emf.compare.diagram.ecoretools.tests.AbstractTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.DiagramInputData;
import org.eclipse.emf.compare.diagram.ecoretools.tests.edgechanges.data.EdgeChangesInputData;
-import org.eclipse.emf.compare.diagram.merge.DiagramDiffMerger;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.merge.CompareDiagramMerger;
import org.eclipse.emf.compare.merge.AttributeChangeMerger;
import org.eclipse.emf.compare.merge.IMerger;
import org.eclipse.emf.compare.merge.ReferenceChangeMerger;
@@ -56,14 +56,14 @@ public class ExtensionMergeTest extends AbstractTest {
final IMerger.Registry registry = IMerger.RegistryImpl.createStandaloneInstance();
final IMerger umlMerger = new UMLDiffMerger();
umlMerger.setRanking(11);
- final IMerger diagramMerger = new DiagramDiffMerger();
+ final IMerger diagramMerger = new CompareDiagramMerger();
diagramMerger.setRanking(11);
registry.add(umlMerger);
registry.add(diagramMerger);
for (Diff diff : differences) {
final Class<? extends IMerger> expectedMerger;
if (diff instanceof DiagramDiff) {
- expectedMerger = DiagramDiffMerger.class;
+ expectedMerger = CompareDiagramMerger.class;
} else if (diff instanceof UMLDiff) {
expectedMerger = UMLDiffMerger.class;
} else if (diff instanceof AttributeChange) {
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/nodechanges/NodechangesTest.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/nodechanges/NodechangesTest.java
index 09ad88565..5e2e4d4cb 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/nodechanges/NodechangesTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/nodechanges/NodechangesTest.java
@@ -11,8 +11,8 @@ import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.onFeature;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removed;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.valueNameMatches;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.valueIs;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.valueNameMatches;
import java.io.IOException;
import java.util.List;
@@ -24,12 +24,11 @@ import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.EMFCompare;
import org.eclipse.emf.compare.ReferenceChange;
import org.eclipse.emf.compare.ResourceAttachmentChange;
-import org.eclipse.emf.compare.diagram.NodeChange;
import org.eclipse.emf.compare.diagram.ecoretools.tests.AbstractTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.DiagramInputData;
import org.eclipse.emf.compare.diagram.ecoretools.tests.nodechanges.data.NodeChangesInputData;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
import org.eclipse.emf.compare.scope.IComparisonScope;
-import org.eclipse.emf.compare.utils.MatchUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.Resource;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/show/ShowTest.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/show/ShowTest.java
index ce2a63435..9c005ef61 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/show/ShowTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/show/ShowTest.java
@@ -15,10 +15,10 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.diagram.Show;
import org.eclipse.emf.compare.diagram.ecoretools.tests.AbstractTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.DiagramInputData;
import org.eclipse.emf.compare.diagram.ecoretools.tests.show.data.ShowInputData;
+import org.eclipse.emf.compare.diagram.internal.extensions.Show;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.gmf.runtime.notation.NotationPackage;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/suite/AllTests.java
index 1a7cb9c70..b2d7577be 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/suite/AllTests.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ecoretools/tests/suite/AllTests.java
@@ -15,12 +15,12 @@ import junit.framework.Test;
import junit.textui.TestRunner;
import org.eclipse.emf.compare.ComparePackage;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
import org.eclipse.emf.compare.diagram.ecoretools.tests.edgechanges.EdgechangesTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.hide.HideTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.merge.ExtensionMergeTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.nodechanges.NodechangesTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.show.ShowTest;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
import org.eclipse.emf.compare.tests.suite.CompareTestSuite;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcorePackage;
@@ -63,7 +63,7 @@ public class AllTests {
@BeforeClass
public static void fillEMFRegistries() {
EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
- EPackage.Registry.INSTANCE.put(DiagramComparePackage.eNS_URI, DiagramComparePackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(ExtensionsPackage.eNS_URI, ExtensionsPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(NotationPackage.eNS_URI, NotationPackage.eINSTANCE);
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF
index 3e7eb56aa..514419455 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/META-INF/MANIFEST.MF
@@ -2,13 +2,12 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.compare.diagram.edit;singleton:=true
-Bundle-Version: 2.1.0.qualifier
+Bundle-Version: 2.2.0.qualifier
Bundle-ClassPath: .
-Bundle-Activator: org.eclipse.emf.compare.diagram.provider.DiagramEditPlugin$Implementation
+Bundle-Activator: org.eclipse.emf.compare.diagram.internal.extensions.provider.ExtensionsEditPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.emf.compare.diagram.provider
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.compare.diagram;visibility:=reexport,
org.eclipse.emf.edit;visibility:=reexport,
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/build.properties b/plugins/org.eclipse.emf.compare.diagram.edit/build.properties
index eef98df95..db29da77d 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/build.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/build.properties
@@ -1,4 +1,4 @@
-# Copyright (c) 2012 Obeo.
+# Copyright (c) 2013 Obeo.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/icons/full/obj16/LabelChange.gif b/plugins/org.eclipse.emf.compare.diagram.edit/icons/full/obj16/LabelChange.gif
deleted file mode 100644
index 7c2aaac84..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.edit/icons/full/obj16/LabelChange.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.edit/plugin.xml
index b5356c89b..40e840076 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/plugin.xml
@@ -2,7 +2,7 @@
<?eclipse version="3.0"?>
<!--
- Copyright (c) 2012 Obeo.
+ Copyright (c) 2013 Obeo.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@
<extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
<factory
uri="http://www.eclipse.org/emf/compare/diagram/2.0"
- class="org.eclipse.emf.compare.diagram.provider.spec.DiagramCompareAdapterFactorySpec"
+ class="org.eclipse.emf.compare.diagram.internal.extensions.provider.spec.ExtensionsItemProviderAdapterFactorySpec"
supportedTypes=
"org.eclipse.emf.edit.provider.IEditingDomainItemProvider
org.eclipse.emf.edit.provider.IStructuredItemContentProvider
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/pom.xml b/plugins/org.eclipse.emf.compare.diagram.edit/pom.xml
index 24bd78b24..ba46d5a95 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/pom.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/pom.xml
@@ -10,7 +10,7 @@
</parent>
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>org.eclipse.emf.compare.diagram.edit</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramDiffItemProvider.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/DiagramDiffItemProvider.java
index 5330b0ed0..c51c66de4 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramDiffItemProvider.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/DiagramDiffItemProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider;
import java.util.Collection;
@@ -21,8 +21,8 @@ import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
import org.eclipse.emf.compare.provider.DiffItemProvider;
@@ -37,7 +37,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
/**
- * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.DiagramDiff} object.
+ * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -45,7 +45,13 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
public class DiagramDiffItemProvider
extends DiffItemProvider
implements
- IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider {
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource,
+ IItemColorProvider,
+ IItemFontProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
@@ -86,7 +92,7 @@ public class DiagramDiffItemProvider
getResourceLocator(),
getString("_UI_DiagramDiff_semanticDiff_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DiagramDiff_semanticDiff_feature", "_UI_DiagramDiff_type"),
- DiagramComparePackage.Literals.DIAGRAM_DIFF__SEMANTIC_DIFF,
+ ExtensionsPackage.Literals.DIAGRAM_DIFF__SEMANTIC_DIFF,
true,
false,
true,
@@ -108,7 +114,7 @@ public class DiagramDiffItemProvider
getResourceLocator(),
getString("_UI_DiagramDiff_view_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_DiagramDiff_view_feature", "_UI_DiagramDiff_type"),
- DiagramComparePackage.Literals.DIAGRAM_DIFF__VIEW,
+ ExtensionsPackage.Literals.DIAGRAM_DIFF__VIEW,
true,
false,
true,
@@ -165,7 +171,7 @@ public class DiagramDiffItemProvider
*/
@Override
public ResourceLocator getResourceLocator() {
- return DiagramEditPlugin.INSTANCE;
+ return ExtensionsEditPlugin.INSTANCE;
}
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/EdgeChangeItemProvider.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/EdgeChangeItemProvider.java
index 88f1435b2..ef0576a6c 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/EdgeChangeItemProvider.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/EdgeChangeItemProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider;
import java.util.Collection;
@@ -19,7 +19,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.EdgeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemColorProvider;
@@ -31,7 +31,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
/**
- * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.EdgeChange} object.
+ * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -39,7 +39,13 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
public class EdgeChangeItemProvider
extends DiagramDiffItemProvider
implements
- IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider {
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource,
+ IItemColorProvider,
+ IItemFontProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramEditPlugin.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ExtensionsEditPlugin.java
index 38c431595..4864a865a 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramEditPlugin.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ExtensionsEditPlugin.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider;
import org.eclipse.emf.common.EMFPlugin;
@@ -19,19 +19,19 @@ import org.eclipse.emf.compare.provider.EMFCompareEditPlugin;
import org.eclipse.emf.ecore.provider.EcoreEditPlugin;
/**
- * This is the central singleton for the Diagram edit plugin.
+ * This is the central singleton for the Extensions edit plugin.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
-public final class DiagramEditPlugin extends EMFPlugin {
+public final class ExtensionsEditPlugin extends EMFPlugin {
/**
* Keep track of the singleton.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static final DiagramEditPlugin INSTANCE = new DiagramEditPlugin();
+ public static final ExtensionsEditPlugin INSTANCE = new ExtensionsEditPlugin();
/**
* Keep track of the singleton.
@@ -47,7 +47,7 @@ public final class DiagramEditPlugin extends EMFPlugin {
* <!-- end-user-doc -->
* @generated
*/
- public DiagramEditPlugin() {
+ public ExtensionsEditPlugin() {
super
(new ResourceLocator [] {
EMFCompareEditPlugin.INSTANCE,
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramCompareItemProviderAdapterFactory.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ExtensionsItemProviderAdapterFactory.java
index 9fdd40210..4a57fd438 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/DiagramCompareItemProviderAdapterFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ExtensionsItemProviderAdapterFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider;
import java.util.ArrayList;
import java.util.Collection;
@@ -17,7 +17,7 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.compare.diagram.util.DiagramCompareAdapterFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.util.ExtensionsAdapterFactory;
import org.eclipse.emf.edit.provider.ChangeNotifier;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
@@ -42,7 +42,7 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
* <!-- end-user-doc -->
* @generated
*/
-public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
+public class ExtensionsItemProviderAdapterFactory extends ExtensionsAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
/**
* This keeps track of the root adapter factory that delegates to this adapter factory.
* <!-- begin-user-doc -->
@@ -73,7 +73,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
* <!-- end-user-doc -->
* @generated
*/
- public DiagramCompareItemProviderAdapterFactory() {
+ public ExtensionsItemProviderAdapterFactory() {
supportedTypes.add(IEditingDomainItemProvider.class);
supportedTypes.add(IStructuredItemContentProvider.class);
supportedTypes.add(ITreeItemContentProvider.class);
@@ -84,7 +84,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.Show} instances.
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.internal.extensions.Show} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -92,7 +92,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
protected ShowItemProvider showItemProvider;
/**
- * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.Show}.
+ * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.Show}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -107,7 +107,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.Hide} instances.
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.internal.extensions.Hide} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -115,7 +115,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
protected HideItemProvider hideItemProvider;
/**
- * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.Hide}.
+ * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.Hide}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -130,7 +130,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.NodeChange} instances.
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.internal.extensions.NodeChange} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -138,7 +138,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
protected NodeChangeItemProvider nodeChangeItemProvider;
/**
- * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.NodeChange}.
+ * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.NodeChange}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -153,7 +153,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.EdgeChange} instances.
+ * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -161,7 +161,7 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
protected EdgeChangeItemProvider edgeChangeItemProvider;
/**
- * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.EdgeChange}.
+ * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -176,29 +176,6 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.emf.compare.diagram.LabelChange} instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected LabelChangeItemProvider labelChangeItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.emf.compare.diagram.LabelChange}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Adapter createLabelChangeAdapter() {
- if (labelChangeItemProvider == null) {
- labelChangeItemProvider = new LabelChangeItemProvider(this);
- }
-
- return labelChangeItemProvider;
- }
-
- /**
* This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -301,7 +278,6 @@ public class DiagramCompareItemProviderAdapterFactory extends DiagramCompareAdap
if (hideItemProvider != null) hideItemProvider.dispose();
if (nodeChangeItemProvider != null) nodeChangeItemProvider.dispose();
if (edgeChangeItemProvider != null) edgeChangeItemProvider.dispose();
- if (labelChangeItemProvider != null) labelChangeItemProvider.dispose();
}
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/HideItemProvider.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/HideItemProvider.java
index a75f7f504..76e8f9272 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/HideItemProvider.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/HideItemProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider;
import java.util.Collection;
@@ -19,7 +19,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.Hide;
+import org.eclipse.emf.compare.diagram.internal.extensions.Hide;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemColorProvider;
@@ -31,7 +31,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
/**
- * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.Hide} object.
+ * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.Hide} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -39,7 +39,13 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
public class HideItemProvider
extends DiagramDiffItemProvider
implements
- IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider {
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource,
+ IItemColorProvider,
+ IItemFontProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/NodeChangeItemProvider.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/NodeChangeItemProvider.java
index c6bb286f7..796773c33 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/NodeChangeItemProvider.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/NodeChangeItemProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider;
import java.util.Collection;
@@ -19,7 +19,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.NodeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemColorProvider;
@@ -31,7 +31,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
/**
- * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.NodeChange} object.
+ * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.NodeChange} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -39,7 +39,13 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
public class NodeChangeItemProvider
extends DiagramDiffItemProvider
implements
- IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider {
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource,
+ IItemColorProvider,
+ IItemFontProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/ShowItemProvider.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ShowItemProvider.java
index d2dc9fb8b..a8a2ce7cb 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/ShowItemProvider.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/provider/ShowItemProvider.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider;
import java.util.Collection;
@@ -19,7 +19,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.Show;
+import org.eclipse.emf.compare.diagram.internal.extensions.Show;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemColorProvider;
@@ -31,7 +31,7 @@ import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
/**
- * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.Show} object.
+ * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.internal.extensions.Show} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
@@ -39,7 +39,13 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
public class ShowItemProvider
extends DiagramDiffItemProvider
implements
- IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider {
+ IEditingDomainItemProvider,
+ IStructuredItemContentProvider,
+ ITreeItemContentProvider,
+ IItemLabelProvider,
+ IItemPropertySource,
+ IItemColorProvider,
+ IItemFontProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/LabelChangeItemProvider.java b/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/LabelChangeItemProvider.java
deleted file mode 100644
index 39f58f9ff..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src-gen/org/eclipse/emf/compare/diagram/provider/LabelChangeItemProvider.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/**
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- */
-package org.eclipse.emf.compare.diagram.provider;
-
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.compare.DifferenceKind;
-
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.LabelChange;
-
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
-import org.eclipse.emf.edit.provider.IItemColorProvider;
-import org.eclipse.emf.edit.provider.IItemFontProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
-import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.IItemPropertySource;
-import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-
-/**
- * This is the item provider adapter for a {@link org.eclipse.emf.compare.diagram.LabelChange} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
-public class LabelChangeItemProvider
- extends DiagramDiffItemProvider
- implements
- IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource, IItemColorProvider, IItemFontProvider {
- /**
- * This constructs an instance from a factory and a notifier.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public LabelChangeItemProvider(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- /**
- * This returns the property descriptors for the adapted class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
- if (itemPropertyDescriptors == null) {
- super.getPropertyDescriptors(object);
-
- addLeftPropertyDescriptor(object);
- addRightPropertyDescriptor(object);
- addOriginPropertyDescriptor(object);
- }
- return itemPropertyDescriptors;
- }
-
- /**
- * This adds a property descriptor for the Left feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void addLeftPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_LabelChange_left_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_LabelChange_left_feature", "_UI_LabelChange_type"),
- DiagramComparePackage.Literals.LABEL_CHANGE__LEFT,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Right feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void addRightPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_LabelChange_right_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_LabelChange_right_feature", "_UI_LabelChange_type"),
- DiagramComparePackage.Literals.LABEL_CHANGE__RIGHT,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Origin feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected void addOriginPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add
- (createItemPropertyDescriptor
- (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_LabelChange_origin_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_LabelChange_origin_feature", "_UI_LabelChange_type"),
- DiagramComparePackage.Literals.LABEL_CHANGE__ORIGIN,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This returns LabelChange.gif.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object getImage(Object object) {
- return overlayImage(object, getResourceLocator().getImage("full/obj16/LabelChange"));
- }
-
- /**
- * This returns the label text for the adapted class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String getText(Object object) {
- DifferenceKind labelValue = ((LabelChange)object).getKind();
- String label = labelValue == null ? null : labelValue.toString();
- return label == null || label.length() == 0 ?
- getString("_UI_LabelChange_type") :
- getString("_UI_LabelChange_type") + " " + label;
- }
-
- /**
- * This handles model notifications by calling {@link #updateChildren} to update any cached
- * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void notifyChanged(Notification notification) {
- updateChildren(notification);
-
- switch (notification.getFeatureID(LabelChange.class)) {
- case DiagramComparePackage.LABEL_CHANGE__LEFT:
- case DiagramComparePackage.LABEL_CHANGE__RIGHT:
- case DiagramComparePackage.LABEL_CHANGE__ORIGIN:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
- return;
- }
- super.notifyChanged(notification);
- }
-
- /**
- * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
- * that can be created under this object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
- super.collectNewChildDescriptors(newChildDescriptors, object);
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/DiagramCompareAdapterFactorySpec.java b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/ExtensionsItemProviderAdapterFactorySpec.java
index f24f341de..068db657c 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/DiagramCompareAdapterFactorySpec.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/ExtensionsItemProviderAdapterFactorySpec.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,16 +8,16 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider.spec;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider.spec;
import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.compare.diagram.provider.DiagramCompareItemProviderAdapterFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.provider.ExtensionsItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
/**
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class DiagramCompareAdapterFactorySpec extends DiagramCompareItemProviderAdapterFactory {
+public class ExtensionsItemProviderAdapterFactorySpec extends ExtensionsItemProviderAdapterFactory {
ForwardingDiagramDiffItemProvider fShowItemProvider;
@@ -48,15 +48,6 @@ public class DiagramCompareAdapterFactorySpec extends DiagramCompareItemProvider
}
@Override
- public Adapter createLabelChangeAdapter() {
- if (fLabelChangeItemProvider == null) {
- fLabelChangeItemProvider = new LabelChangeItemProviderSpec((ItemProviderAdapter)super
- .createLabelChangeAdapter());
- }
- return fLabelChangeItemProvider;
- }
-
- @Override
public Adapter createNodeChangeAdapter() {
if (fNodeChangeItemProvider == null) {
fNodeChangeItemProvider = new NodeChangeItemProviderSpec((ItemProviderAdapter)super
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/ForwardingDiagramDiffItemProvider.java b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/ForwardingDiagramDiffItemProvider.java
index d15e7bdcf..d310332ed 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/ForwardingDiagramDiffItemProvider.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/ForwardingDiagramDiffItemProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider.spec;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider.spec;
import com.google.common.base.Preconditions;
@@ -18,7 +18,7 @@ import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.provider.AdapterFactoryUtil;
import org.eclipse.emf.compare.provider.ForwardingItemProvider;
import org.eclipse.emf.compare.provider.spec.Strings;
@@ -149,7 +149,8 @@ public class ForwardingDiagramDiffItemProvider extends ForwardingItemProvider {
protected String getValueText(final DiagramDiff diagramDiff) {
String value = "<null>";
if (diagramDiff.getView() instanceof View) {
- value = diagramDiff.getView().eClass().getName() + " "
+ value = diagramDiff.getView().eClass().getName()
+ + " "
+ AdapterFactoryUtil.getText(getRootAdapterFactory(), ((View)diagramDiff.getView())
.getElement());
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/LabelChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/LabelChangeItemProviderSpec.java
index fcffb583d..451a7f340 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/LabelChangeItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/LabelChangeItemProviderSpec.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,9 +8,9 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider.spec;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider.spec;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
public class LabelChangeItemProviderSpec extends ForwardingDiagramDiffItemProvider {
diff --git a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/NodeChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/NodeChangeItemProviderSpec.java
index e4d7cd812..d98310141 100644
--- a/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/provider/spec/NodeChangeItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.diagram.edit/src/org/eclipse/emf/compare/diagram/internal/extensions/provider/spec/NodeChangeItemProviderSpec.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.provider.spec;
+package org.eclipse.emf.compare.diagram.internal.extensions.provider.spec;
import static com.google.common.base.Predicates.instanceOf;
import static com.google.common.collect.Iterables.filter;
@@ -20,8 +20,8 @@ import java.util.Collection;
import java.util.List;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.NodeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
public class NodeChangeItemProviderSpec extends ForwardingDiagramDiffItemProvider {
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
index a4dccd1fe..316a911ac 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/META-INF/MANIFEST.MF
@@ -12,10 +12,10 @@ Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.8.0",
org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
org.eclipse.emf.compare.diagram.ecoretools.tests;bundle-version="1.0.0",
org.eclipse.ui;bundle-version="3.103.0",
- org.eclipse.emf.compare.diagram.ide;bundle-version="2.0.0",
org.eclipse.emf.compare.diagram;bundle-version="2.0.0",
- org.eclipse.emf.compare.ide;bundle-version="3.0.0"
-Import-Package: com.google.common.base;version="[10.0.1,11.0.0)",
- com.google.common.collect;version="[10.0.1,11.0.0)"
+ org.eclipse.emf.compare.ide;bundle-version="3.0.0",
+ org.eclipse.emf.compare.diagram.ide.ui;bundle-version="3.0.0"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)"
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java
index 40d3e07ae..75cb9c1db 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/nodechanges/NodechangesTest.java
@@ -15,13 +15,12 @@ import java.util.List;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.LabelChange;
-import org.eclipse.emf.compare.diagram.NodeChange;
-import org.eclipse.emf.compare.diagram.diff.util.DiagramCompareConstants;
import org.eclipse.emf.compare.diagram.ecoretools.tests.AbstractTest;
import org.eclipse.emf.compare.diagram.ecoretools.tests.DiagramInputData;
-import org.eclipse.emf.compare.diagram.ide.GMFCompareIDEPlugin;
import org.eclipse.emf.compare.diagram.ide.ecoretools.tests.nodechanges.data.NodeChangesInputData;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.CompareDiagramIDEUIPlugin;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramConstants;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
import org.eclipse.emf.compare.extension.PostProcessorRegistry;
import org.eclipse.emf.compare.ide.EMFCompareIDE;
import org.eclipse.emf.compare.scope.IComparisonScope;
@@ -50,7 +49,7 @@ public class NodechangesTest extends AbstractTest {
@Test
public void testA10UseCase() throws IOException {
- GMFCompareIDEPlugin.getDefault().getPreferenceStore().setValue(DiagramCompareConstants.PREFERENCES_KEY_MOVE_THRESHOLD, 0);
+ CompareDiagramIDEUIPlugin.getDefault().getPreferenceStore().setValue(CompareDiagramConstants.PREFERENCES_KEY_MOVE_THRESHOLD, 0);
testMove(true);
@@ -59,7 +58,7 @@ public class NodechangesTest extends AbstractTest {
@Test
public void testA11UseCase() throws IOException {
- GMFCompareIDEPlugin.getDefault().getPreferenceStore().setValue(DiagramCompareConstants.PREFERENCES_KEY_MOVE_THRESHOLD, 200);
+ CompareDiagramIDEUIPlugin.getDefault().getPreferenceStore().setValue(CompareDiagramConstants.PREFERENCES_KEY_MOVE_THRESHOLD, 200);
testMove(false);
@@ -76,10 +75,10 @@ public class NodechangesTest extends AbstractTest {
final List<Diff> differences = comparison.getDifferences();
- assertSame(Integer.valueOf(2), Integer.valueOf(differences.size()));
+ assertSame(Integer.valueOf(1), Integer.valueOf(differences.size()));
- final Diff changeLabel = Iterators.find(differences.iterator(), and(instanceOf(LabelChange.class), ofKind(DifferenceKind.CHANGE)));
- assertNotNull(changeLabel);
+// final Diff changeLabel = Iterators.find(differences.iterator(), and(instanceOf(LabelChange.class), ofKind(DifferenceKind.CHANGE)));
+// assertNotNull(changeLabel);
final Diff changeName = Iterators.find(differences.iterator(), changedAttribute("tc01.EClass1", "name", "TheClass", "EClass1"));
assertNotNull(changeName);
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/suite/AllTests.java
index 94f35747c..a5daf3ef2 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/suite/AllTests.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools.tests/src/org/eclipse/emf/compare/diagram/ide/ecoretools/tests/suite/AllTests.java
@@ -15,8 +15,8 @@ import junit.framework.Test;
import junit.textui.TestRunner;
import org.eclipse.emf.compare.ComparePackage;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
import org.eclipse.emf.compare.diagram.ide.ecoretools.tests.nodechanges.NodechangesTest;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
import org.eclipse.emf.compare.tests.suite.CompareTestSuite;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcorePackage;
@@ -59,7 +59,7 @@ public class AllTests {
@BeforeClass
public static void fillEMFRegistries() {
EPackage.Registry.INSTANCE.put(ComparePackage.eNS_URI, ComparePackage.eINSTANCE);
- EPackage.Registry.INSTANCE.put(DiagramComparePackage.eNS_URI, DiagramComparePackage.eINSTANCE);
+ EPackage.Registry.INSTANCE.put(ExtensionsPackage.eNS_URI, ExtensionsPackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
EPackage.Registry.INSTANCE.put(NotationPackage.eNS_URI, NotationPackage.eINSTANCE);
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.checkstyle b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.checkstyle
deleted file mode 100644
index 42c474352..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.checkstyle
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
- <local-check-config name="EMF Compare" location="/org.eclipse.emf.compare-parent/codeStyle/EMFCompareCheckstyle5Configuration.xml" type="project" description="">
- <additional-data name="protect-config-file" value="false"/>
- </local-check-config>
- <fileset name="all" enabled="true" check-config-name="EMF Compare" local="true">
- <file-match-pattern match-pattern="." include-pattern="true"/>
- </fileset>
- <filter name="FilesFromPackage" enabled="true">
- <filter-data value="src/org/eclipse/emf/compare/diff/metamodel"/>
- </filter>
-</fileset-config>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.classpath b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.classpath
deleted file mode 100644
index 64c5e31b7..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.project b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.project
deleted file mode 100644
index 9db19827f..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.project
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.emf.compare.diagram.ide.ecoretools</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.resources.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4824b8026..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-encoding/<project>=UTF-8
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.runtime.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.runtime.prefs
deleted file mode 100644
index f8a67de1d..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.core.runtime.prefs
+++ /dev/null
@@ -1,2 +0,0 @@
-eclipse.preferences.version=1
-line.separator=\r\n
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 8199624a5..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,375 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
-org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
-org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled
-org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
-org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
-org.eclipse.jdt.core.compiler.problem.deadCode=error
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=error
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=error
-org.eclipse.jdt.core.compiler.problem.includeFieldsInNullAnalysis=disabled
-org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=error
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=disabled
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
-org.eclipse.jdt.core.compiler.problem.nullReference=error
-org.eclipse.jdt.core.compiler.problem.nullSpecInsufficientInfo=warning
-org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=error
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=error
-org.eclipse.jdt.core.compiler.problem.potentialNullSpecViolation=error
-org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=error
-org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
-org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
-org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
-org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=warning
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
-org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
-org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
-org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_assignment=0
-org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
-org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
-org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
-org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
-org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
-org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
-org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
-org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=0
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
-org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
-org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_after_package=1
-org.eclipse.jdt.core.formatter.blank_lines_before_field=1
-org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
-org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
-org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
-org.eclipse.jdt.core.formatter.blank_lines_before_method=1
-org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
-org.eclipse.jdt.core.formatter.blank_lines_before_package=0
-org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
-org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
-org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
-org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=true
-org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=true
-org.eclipse.jdt.core.formatter.comment.format_block_comments=true
-org.eclipse.jdt.core.formatter.comment.format_header=false
-org.eclipse.jdt.core.formatter.comment.format_html=true
-org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
-org.eclipse.jdt.core.formatter.comment.format_line_comments=true
-org.eclipse.jdt.core.formatter.comment.format_source_code=true
-org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
-org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
-org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
-org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
-org.eclipse.jdt.core.formatter.comment.line_length=110
-org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
-org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
-org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
-org.eclipse.jdt.core.formatter.compact_else_if=true
-org.eclipse.jdt.core.formatter.continuation_indentation=2
-org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
-org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
-org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
-org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
-org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
-org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
-org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_empty_lines=false
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
-org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
-org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
-org.eclipse.jdt.core.formatter.indentation.size=8
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
-org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
-org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
-org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
-org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
-org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
-org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
-org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
-org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
-org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
-org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
-org.eclipse.jdt.core.formatter.join_lines_in_comments=true
-org.eclipse.jdt.core.formatter.join_wrapped_lines=true
-org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
-org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
-org.eclipse.jdt.core.formatter.lineSplit=110
-org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
-org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
-org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
-org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
-org.eclipse.jdt.core.formatter.tabulation.char=tab
-org.eclipse.jdt.core.formatter.tabulation.size=4
-org.eclipse.jdt.core.formatter.use_on_off_tags=true
-org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
-org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
-org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
-org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=false
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.ui.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 4ffe0798a..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,61 +0,0 @@
-cleanup_settings_version=2
-eclipse.preferences.version=1
-editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_EMF Compare
-formatter_settings_version=12
-org.eclipse.jdt.ui.ignorelowercasenames=true
-org.eclipse.jdt.ui.importorder=fr;com;java;javax;org;
-org.eclipse.jdt.ui.ondemandthreshold=99
-org.eclipse.jdt.ui.staticondemandthreshold=99
-sp_cleanup.add_default_serial_version_id=true
-sp_cleanup.add_generated_serial_version_id=false
-sp_cleanup.add_missing_annotations=true
-sp_cleanup.add_missing_deprecated_annotations=true
-sp_cleanup.add_missing_methods=false
-sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=true
-sp_cleanup.add_missing_override_annotations_interface_methods=false
-sp_cleanup.add_serial_version_id=false
-sp_cleanup.always_use_blocks=true
-sp_cleanup.always_use_parentheses_in_expressions=false
-sp_cleanup.always_use_this_for_non_static_field_access=false
-sp_cleanup.always_use_this_for_non_static_method_access=false
-sp_cleanup.convert_to_enhanced_for_loop=false
-sp_cleanup.correct_indentation=false
-sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
-sp_cleanup.make_local_variable_final=false
-sp_cleanup.make_parameters_final=false
-sp_cleanup.make_private_fields_final=true
-sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=false
-sp_cleanup.never_use_blocks=false
-sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=true
-sp_cleanup.organize_imports=true
-sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
-sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
-sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
-sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=false
-sp_cleanup.remove_trailing_whitespaces_all=true
-sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
-sp_cleanup.remove_unnecessary_casts=false
-sp_cleanup.remove_unnecessary_nls_tags=true
-sp_cleanup.remove_unused_imports=true
-sp_cleanup.remove_unused_local_variables=false
-sp_cleanup.remove_unused_private_fields=true
-sp_cleanup.remove_unused_private_members=false
-sp_cleanup.remove_unused_private_methods=true
-sp_cleanup.remove_unused_private_types=true
-sp_cleanup.sort_members=false
-sp_cleanup.sort_members_all=false
-sp_cleanup.use_blocks=true
-sp_cleanup.use_blocks_only_for_return_and_throw=false
-sp_cleanup.use_parentheses_in_expressions=false
-sp_cleanup.use_this_for_non_static_field_access=false
-sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
-sp_cleanup.use_this_for_non_static_method_access=false
-sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.pde.api.tools.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.pde.api.tools.prefs
deleted file mode 100644
index 90e2e6a01..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/.settings/org.eclipse.pde.api.tools.prefs
+++ /dev/null
@@ -1,178 +0,0 @@
-ANNOTATION_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
-ANNOTATION_ELEMENT_TYPE_ADDED_FIELD=Warning
-ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
-ANNOTATION_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD=Warning
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Warning
-ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Warning
-ANNOTATION_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_TO_CLASS=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_TO_ENUM=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITHOUT_DEFAULT_VALUE=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD_WITH_DEFAULT_VALUE=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Warning
-API_USE_SCAN_FIELD_SEVERITY=Error
-API_USE_SCAN_METHOD_SEVERITY=Error
-API_USE_SCAN_TYPE_SEVERITY=Error
-CLASS_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
-CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
-CLASS_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Warning
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-CLASS_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERCLASS_SET=Warning
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-CLASS_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
-CLASS_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
-CLASS_ELEMENT_TYPE_CHANGED_SUPERCLASS=Warning
-CLASS_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Warning
-CLASS_ELEMENT_TYPE_CHANGED_TO_ENUM=Warning
-CLASS_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Warning
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-CLASS_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Warning
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Warning
-CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
-CLASS_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Warning
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Warning
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Warning
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
-ENUM_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
-ENUM_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Warning
-ENUM_ELEMENT_TYPE_CHANGED_TO_CLASS=Warning
-ENUM_ELEMENT_TYPE_CHANGED_TO_INTERFACE=Warning
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Warning
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Warning
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Warning
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Warning
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Warning
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Warning
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Warning
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Warning
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENTS=Warning
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Warning
-ILLEGAL_EXTEND=Warning
-ILLEGAL_IMPLEMENT=Warning
-ILLEGAL_INSTANTIATE=Warning
-ILLEGAL_OVERRIDE=Warning
-ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_MEMBER=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETERS=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_INTERFACE_BOUNDS=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_RESTRICTIONS=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_TO_ANNOTATION=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_TO_CLASS=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_TO_ENUM=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-INVALID_JAVADOC_TAG=Ignore
-INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore
-LEAK_EXTEND=Warning
-LEAK_FIELD_DECL=Warning
-LEAK_IMPLEMENT=Warning
-LEAK_METHOD_PARAM=Warning
-LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
-METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
-METHOD_ELEMENT_TYPE_ADDED_INTERFACE_BOUNDS=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-METHOD_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-METHOD_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
-METHOD_ELEMENT_TYPE_CHANGED_TYPE_PARAMETER=Warning
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Warning
-METHOD_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
-METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
-METHOD_ELEMENT_TYPE_REMOVED_INTERFACE_BOUNDS=Warning
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETERS=Warning
-MISSING_EE_DESCRIPTIONS=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
-UNUSED_PROBLEM_FILTERS=Warning
-automatically_removed_unused_problem_filters=false
-eclipse.preferences.version=1
-incompatible_api_component_version=Warning
-incompatible_api_component_version_include_major_without_breaking_change=Disabled
-incompatible_api_component_version_include_minor_without_api_change=Disabled
-invalid_since_tag_version=Warning
-malformed_since_tag=Warning
-missing_since_tag=Warning
-report_api_breakage_when_major_version_incremented=Disabled
-report_resolution_errors_api_component=Warning
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/META-INF/MANIFEST.MF
deleted file mode 100644
index 1bd525c19..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,16 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide.ecoretools;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ecoretools.EcoreToolsIDECompare
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.gmf.runtime.notation,
- org.eclipse.emf.ecoretools.diagram,
- org.eclipse.gmf.runtime.diagram.ui,
- org.eclipse.emf.compare.diagram.ide;bundle-version="2.0.0",
- org.eclipse.emf.compare.diagram;bundle-version="2.0.0",
- org.eclipse.compare
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %providerName
-Export-Package: org.eclipse.emf.compare.diagram.ide.ecoretools
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/about.html b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/about.html
deleted file mode 100644
index 670d10856..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/about.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>April 14, 2010</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
- repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
- href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- (&quot;Specification&quot;).</p>
-
-<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
- in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
- Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
- on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
- Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
- the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
- indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-</body>
-</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/build.properties
deleted file mode 100644
index b81a5af15..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
- #*******************************************************************************
- # Copyright (c) 2006, 2012 Obeo.
- # All rights reserved. This program and the accompanying materials
- # are made available under the terms of the Eclipse Public License v1.0
- # which accompanies this distribution, and is available at
- # http://www.eclipse.org/legal/epl-v10.html
- #
- # Contributors:
- # Obeo - initial API and implementation
- #******************************************************************************/
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- about.html
-src.includes = about.html
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/plugin.xml
deleted file mode 100644
index 59887d307..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/plugin.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.emf.compare.diagram.ide.viewLabelProvider">
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.ecoretools.EcoreToolsViewLabelProvider"
- diagramType="EcoreTools">
- </viewLabelProvider>
- </extension>
-
-
-</plugin>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/pom.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/pom.xml
deleted file mode 100644
index cd7845d1b..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/pom.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>emf.compare-parent</artifactId>
- <groupId>org.eclipse.emf.compare</groupId>
- <version>2.1.0-SNAPSHOT</version>
- <relativePath>../../org.eclipse.emf.compare-parent</relativePath>
- </parent>
- <groupId>org.eclipse.emf.compare</groupId>
- <artifactId>org.eclipse.emf.compare.diagram.ide.ecoretools</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsIDECompare.java b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsIDECompare.java
deleted file mode 100644
index bbe656c21..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsIDECompare.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ecoretools;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * Activator.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
-public class EcoreToolsIDECompare extends Plugin {
-
- /** The plug-in ID. */
- public static final String PLUGIN_ID = "org.eclipse.emf.compare.diagram.ide.ecoretools"; //$NON-NLS-1$
-
- /**
- * Context.
- */
- private static EcoreToolsIDECompare plugin;
-
- /**
- * {@inheritDoc}
- *
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext bundleContext) throws Exception {
- plugin = this;
- super.start(bundleContext);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext bundleContext) throws Exception {
- super.stop(bundleContext);
- plugin = null;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsViewLabelProvider.java
deleted file mode 100644
index 7802ef562..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ecoretools/EcoreToolsViewLabelProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ecoretools;
-
-import org.eclipse.emf.compare.diagram.provider.AbstractLabelProvider;
-import org.eclipse.emf.ecoretools.diagram.edit.parts.EcoreEditPartFactory;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * The provider for EcoreTools diagram kind.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
-public class EcoreToolsViewLabelProvider extends AbstractLabelProvider {
-
- /**
- * EcoreEditPartFactory.
- */
- private static final EcoreEditPartFactory EDIT_PART_FACTORY = new EcoreEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.classpath b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.classpath
deleted file mode 100644
index 2d1a4302f..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.project b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.project
deleted file mode 100644
index 26ba8e900..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.emf.compare.diagram.ide.papyrus</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 44217f8c0..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/META-INF/MANIFEST.MF
deleted file mode 100644
index 898c952e8..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,26 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide.papyrus;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Activator: org.eclipse.emf.compare.diagram.ide.papyrus.Activator
-Require-Bundle: org.eclipse.emf.compare.diagram;bundle-version="2.0.0",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.6.0",
- org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.papyrus.uml.tools.utils;bundle-version="0.9.1",
- org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.activity;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.clazz;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.communication;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.component;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.composite;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.deployment;bundle-version="0.9.1",
- org.eclipse.papyrus.infra.core;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.profile;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.sequence;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.statemachine;bundle-version="0.9.1",
- org.eclipse.papyrus.uml.diagram.usecase;bundle-version="0.9.1"
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Export-Package: org.eclipse.emf.compare.diagram.ide.papyrus
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/about.html b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/about.html
deleted file mode 100644
index 670d10856..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/about.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>April 14, 2010</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
- repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
- href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- (&quot;Specification&quot;).</p>
-
-<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
- in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
- Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
- on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
- Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
- the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
- indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-</body>
-</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/build.properties
deleted file mode 100644
index 30e2cedf4..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.properties,\
- about.html
-src.includes = about.html
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/plugin.xml
deleted file mode 100644
index 79fa6aec7..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/plugin.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension
- point="org.eclipse.emf.compare.diagram.ide.viewLabelProvider">
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.ActivityViewLabelProvider"
- diagramType="PapyrusUMLActivityDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.ClazzViewLabelProvider"
- diagramType="PapyrusUMLClassDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.CommunicationViewLabelProvider"
- diagramType="PapyrusUMLCommunicationDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.ComponentViewLabelProvider"
- diagramType="PapyrusUMLComponentDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.CompositeViewLabelProvider"
- diagramType="CompositeStructure">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.DeploymentViewLabelProvider"
- diagramType="PapyrusUMLDeploymentDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.ProfileViewLabelProvider"
- diagramType="PapyrusUMLProfileDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.SequenceViewLabelProvider"
- diagramType="PapyrusUMLSequenceDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.StateMachineViewLabelProvider"
- diagramType="PapyrusUMLStateMachineDiagram">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.UseCaseViewLabelProvider"
- diagramType="UseCase">
- </viewLabelProvider>
- <viewLabelProvider
- class="org.eclipse.emf.compare.diagram.ide.papyrus.PackageViewLabelProvider"
- diagramType="Package">
- </viewLabelProvider>
- </extension>
-</plugin>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/pom.xml b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/pom.xml
deleted file mode 100644
index 5b8a86ffa..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/pom.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>emf.compare-parent</artifactId>
- <groupId>org.eclipse.emf.compare</groupId>
- <version>2.1.0-SNAPSHOT</version>
- <relativePath>../../org.eclipse.emf.compare-parent</relativePath>
- </parent>
- <groupId>org.eclipse.emf.compare</groupId>
- <artifactId>org.eclipse.emf.compare.diagram.ide.papyrus</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/AbstractUMLViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/AbstractUMLViewLabelProvider.java
deleted file mode 100644
index c61c1af11..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/AbstractUMLViewLabelProvider.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.emf.compare.diagram.diff.util.GMFLabelUtil;
-import org.eclipse.emf.compare.diagram.provider.AbstractLabelProvider;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.tools.utils.CollaborationUseUtil;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
-import org.eclipse.papyrus.uml.tools.utils.InstanceSpecificationUtil;
-import org.eclipse.papyrus.uml.tools.utils.OperationUtil;
-import org.eclipse.papyrus.uml.tools.utils.ParameterUtil;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.CollaborationUse;
-import org.eclipse.uml2.uml.InstanceSpecification;
-import org.eclipse.uml2.uml.Operation;
-import org.eclipse.uml2.uml.Parameter;
-import org.eclipse.uml2.uml.Property;
-import org.eclipse.uml2.uml.util.UMLSwitch;
-
-/**
- * View label provider for UMLView.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public abstract class AbstractUMLViewLabelProvider extends AbstractLabelProvider {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.AbstractLabelProvider#elementLabel(org.eclipse.gmf.runtime.notation.View)
- */
- @Override
- public String elementLabel(View view) {
- if (view == null) {
- throw new IllegalArgumentException("view"); //$NON-NLS-1$
- }
- final ITextAwareEditPart editPart = GMFLabelUtil.getTextEditPart(view);
- final EObject semanticElement = getSemanticElement(editPart);
-
- final IMaskManagedLabelEditPolicy policy = (IMaskManagedLabelEditPolicy)editPart
- .getEditPolicy(IMaskManagedLabelEditPolicy.MASK_MANAGED_LABEL_EDIT_POLICY);
- final String label = getLabelSwitch(policy).doSwitch(semanticElement);
-
- if (label != null && label.length() > 0) {
- return label;
- }
-
- // fall-through super implementation
- return super.elementLabel(view);
- }
-
- /**
- * Get the label switch in relation to the label edit policy.
- *
- * @param labelEditPolicy
- * The policy.
- * @return The switch.
- */
- protected LabelSwitch getLabelSwitch(IMaskManagedLabelEditPolicy labelEditPolicy) {
- return new LabelSwitch(labelEditPolicy);
- }
-
- /**
- * Switch to return the label in relation to the kind of model object.
- *
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
- static class LabelSwitch extends UMLSwitch<String> {
-
- /**
- * The label edit policy.
- */
- private final IMaskManagedLabelEditPolicy labelEditPolicy;
-
- /**
- * Constructor.
- *
- * @param pLabelEditPolicy
- * The edit policy.
- */
- LabelSwitch(IMaskManagedLabelEditPolicy pLabelEditPolicy) {
- this.labelEditPolicy = pLabelEditPolicy;
- }
-
- /**
- * Returns the label edit policy.
- *
- * @return the labelEditPolicy The policy.
- */
- public IMaskManagedLabelEditPolicy getLabelEditPolicy() {
- return labelEditPolicy;
- }
-
- @Override
- public String caseProperty(Property object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PROPERTY;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return PropertyUtil.getCustomLabel(object, displayValue);
- }
-
- @Override
- public String caseOperation(Operation object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_OPERATION;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return OperationUtil.getCustomLabel(object, displayValue);
- }
-
- @Override
- public String caseInstanceSpecification(InstanceSpecification object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_INSTANCESPECIFICATION;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return InstanceSpecificationUtil.getCustomLabel(object, displayValue);
- }
-
- @Override
- public String caseCollaborationUse(CollaborationUse object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PROPERTY;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return CollaborationUseUtil.getCustomLabel(object, displayValue);
- }
-
- @Override
- public String caseParameter(Parameter object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PARAMETER;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return ParameterUtil.getCustomLabel(object, displayValue);
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/Activator.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/Activator.java
deleted file mode 100644
index 11d9711d6..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/Activator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-/**
- * Activator.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class Activator implements BundleActivator {
-
- /**
- * The bundle context.
- */
- private static BundleContext context;
-
- static BundleContext getContext() {
- return context;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ActivityViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ActivityViewLabelProvider.java
deleted file mode 100644
index 70482badf..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ActivityViewLabelProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.activity.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * View label provider for Activity.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class ActivityViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.papyrus.AbstractUMLViewLabelProvider#getLabelSwitch(org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy)
- */
- protected LabelSwitch getLabelSwitch(IMaskManagedLabelEditPolicy labelEditPolicy) {
- return new ActivityLabelSwitch(labelEditPolicy);
- }
-
- /**
- * Switch to return the label in relation to the kind of model object.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
- class ActivityLabelSwitch extends LabelSwitch {
-
- /**
- * Constructor.
- * @param labelEditPolicy The label edit policy.
- */
- ActivityLabelSwitch(IMaskManagedLabelEditPolicy labelEditPolicy) {
- super(labelEditPolicy);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.papyrus.AbstractUMLViewLabelProvider.LabelSwitch#caseProperty(org.eclipse.uml2.uml.Property)
- */
- @Override
- public String caseProperty(Property object) {
- if (object.getOwningAssociation() != null) {
- int displayValue = ICustomAppearence.DEFAULT_UML_RELATIONEND_PROPERTY;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return PropertyUtil.getCustomLabel(object, displayValue);
- }
- return super.caseProperty(object);
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ClazzViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ClazzViewLabelProvider.java
deleted file mode 100644
index a453b1a55..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ClazzViewLabelProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * View label provider for Class.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class ClazzViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.papyrus.AbstractUMLViewLabelProvider#getLabelSwitch(org.eclipse.papyrus.diagram.common.editpolicies.IMaskManagedLabelEditPolicy)
- */
- @Override
- protected LabelSwitch getLabelSwitch(IMaskManagedLabelEditPolicy labelEditPolicy) {
- return new ClassLabelSwitch(labelEditPolicy);
- }
-
- /**
- * Switch to return the label in relation to the kind of model object.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
- class ClassLabelSwitch extends LabelSwitch {
-
- /**
- * Constructor.
- * @param labelEditPolicy The label edit policy..
- */
- ClassLabelSwitch(IMaskManagedLabelEditPolicy labelEditPolicy) {
- super(labelEditPolicy);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.papyrus.AbstractUMLViewLabelProvider.LabelSwitch#caseProperty(org.eclipse.uml2.uml.Property)
- */
- @Override
- public String caseProperty(Property object) {
- if (object.getOwningAssociation() != null) {
- int displayValue = ICustomAppearence.DEFAULT_UML_RELATIONEND_PROPERTY;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return PropertyUtil.getCustomLabel(object, displayValue);
- }
- return super.caseProperty(object);
- }
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CommunicationViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CommunicationViewLabelProvider.java
deleted file mode 100644
index ec7b6ba99..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CommunicationViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.communication.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for Communication.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class CommunicationViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ComponentViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ComponentViewLabelProvider.java
deleted file mode 100644
index e7d72d001..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ComponentViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.component.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for Activity.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class ComponentViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CompositeViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CompositeViewLabelProvider.java
deleted file mode 100644
index 6a89ca0c9..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/CompositeViewLabelProvider.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.IMaskManagedLabelEditPolicy;
-import org.eclipse.papyrus.uml.diagram.composite.edit.parts.UMLEditPartFactory;
-import org.eclipse.papyrus.uml.tools.utils.ICustomAppearence;
-import org.eclipse.papyrus.uml.tools.utils.ParameterUtil;
-import org.eclipse.papyrus.uml.tools.utils.PropertyUtil;
-import org.eclipse.uml2.uml.Parameter;
-import org.eclipse.uml2.uml.Port;
-import org.eclipse.uml2.uml.Property;
-
-/**
- * View label provider for Composite.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class CompositeViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
- @Override
- protected LabelSwitch getLabelSwitch(IMaskManagedLabelEditPolicy labelEditPolicy) {
- return new CompositeLabelSwitch(labelEditPolicy);
- }
-
- /**
- * Switch to return the label in relation to the kind of model object.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
- class CompositeLabelSwitch extends LabelSwitch {
-
- /**
- * Constructor.
- * @param labelEditPolicy The label edit policy.
- */
- CompositeLabelSwitch(IMaskManagedLabelEditPolicy labelEditPolicy) {
- super(labelEditPolicy);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.papyrus.AbstractUMLViewLabelProvider.LabelSwitch#caseProperty(org.eclipse.uml2.uml.Property)
- */
- @Override
- public String caseProperty(Property object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_COMPO_PROPERTY;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return PropertyUtil.getCustomLabel(object, displayValue);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.uml2.uml.util.UMLSwitch#casePort(org.eclipse.uml2.uml.Port)
- */
- @Override
- public String casePort(Port object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PORT;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return PropertyUtil.getCustomLabel(object, displayValue);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.papyrus.AbstractUMLViewLabelProvider.LabelSwitch#caseParameter(org.eclipse.uml2.uml.Parameter)
- */
- @Override
- public String caseParameter(Parameter object) {
- int displayValue = ICustomAppearence.DEFAULT_UML_PARAMETER;
- if (getLabelEditPolicy() != null) {
- displayValue = getLabelEditPolicy().getCurrentDisplayValue();
- }
- return ParameterUtil.getCustomLabel(object, displayValue);
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/DeploymentViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/DeploymentViewLabelProvider.java
deleted file mode 100644
index 8f1ca8d3c..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/DeploymentViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for Deployment.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class DeploymentViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/PackageViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/PackageViewLabelProvider.java
deleted file mode 100644
index 05431e169..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/PackageViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for Package.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class PackageViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ProfileViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ProfileViewLabelProvider.java
deleted file mode 100644
index 261b1ea66..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/ProfileViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.profile.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for Profile.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class ProfileViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/SequenceViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/SequenceViewLabelProvider.java
deleted file mode 100644
index cd7013eb3..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/SequenceViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for Sequence.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class SequenceViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/StateMachineViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/StateMachineViewLabelProvider.java
deleted file mode 100644
index adaa9d493..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/StateMachineViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for StateMachine.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class StateMachineViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/UseCaseViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/UseCaseViewLabelProvider.java
deleted file mode 100644
index f1b141bb0..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/UseCaseViewLabelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
-
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.usecase.edit.parts.UMLEditPartFactory;
-
-/**
- * View label provider for Use Case.
- * @author Mikael Barbero <a href="mailto:mikael.barbero@obeo.fr">Mikael.barbero@obeo.fr</a>
- */
-public class UseCaseViewLabelProvider extends AbstractUMLViewLabelProvider {
-
- /**
- * The edit part factory.
- */
- private static final UMLEditPartFactory EDIT_PART_FACTORY = new UMLEditPartFactory();
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#isManaged(org.eclipse.gmf.runtime.notation.View)
- */
- public boolean isManaged(View view) {
- return EDIT_PART_FACTORY.createEditPart(null, view) instanceof ITextAwareEditPart;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/META-INF/MANIFEST.MF
index 53ff29c39..ec2f1c71a 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/META-INF/MANIFEST.MF
@@ -2,12 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide.ui.ecoretools;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ui.ecoretools.EcoreToolsIDEUICompare
+Bundle-Version: 2.2.0.qualifier
+Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ui.ecoretools.internal.EcoreToolsIDEUICompare
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.compare,
- org.eclipse.emf.compare.diagram.ide.ecoretools;bundle-version="2.1.0",
org.eclipse.emf.compare.diagram.ide.ui;bundle-version="2.0.0",
org.eclipse.emf.compare;bundle-version="3.0.0",
org.eclipse.jface;bundle-version="3.5.0",
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.ini b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.ini
new file mode 100644
index 000000000..eec22440e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.properties
new file mode 100644
index 000000000..2e10f27e4
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/about.properties
@@ -0,0 +1,26 @@
+# /**
+# * <copyright>
+# *
+# * Copyright (c) 2006, 2012 Obeo and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Obeo - Initial API and implementation
+# *
+# * </copyright>
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=EMF Compare EcoreTools Integration
+
+featureText=EMF Compare - EcoreTools Integration\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright Obeo and others. 2006, 2012. All rights reserved.\n\
+\n\
+EMF Compare brings comparison to the Eclipse Modeling Framework\n\
+Visit http://www.eclipse.org/emf/compare
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/build.properties
index 3ff4800e6..2c4329be3 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/build.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/build.properties
@@ -1,7 +1,24 @@
+ #*******************************************************************************
+ # Copyright (c) 2013 Obeo.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ # Obeo - initial API and implementation
+ #******************************************************************************/
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
- plugin.properties
-src.includes = about.html
+ plugin.properties,\
+ modeling32.png,\
+ about.properties,\
+ about.html,\
+ about.ini
+src.includes = about.html,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/modeling32.png b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/modeling32.png
new file mode 100644
index 000000000..6b08de2ad
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.properties
index 058633e45..c170a5601 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.properties
@@ -8,5 +8,5 @@
# Contributors:
# Obeo - initial API and implementation
################################################################################
-pluginName = EMF Compare EcoreTools Support IDE UI Integration
+pluginName = EMF Compare EcoreTools Integration
providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.xml
index 8b0c530a7..f8ac7177b 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/plugin.xml
@@ -1,10 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
+
+<!--
+ Copyright (c) 2013 Obeo.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Obeo - initial API and implementation
+-->
+
<plugin>
<extension
point="org.eclipse.compare.contentMergeViewers">
<viewer
- class="org.eclipse.emf.compare.diagram.ide.ui.ecoretools.DiagramContentMergeViewerCreator"
+ class="org.eclipse.emf.compare.diagram.ide.ui.ecoretools.internal.DiagramContentMergeViewerCreator"
extensions="diagramcompare_match, ecorediag"
id="org.eclipse.emf.compare.ide.ui.internal.ViewContentMergeViewer"
label="Diagram Compare Content Merge Viewer">
@@ -14,7 +26,7 @@
contentTypeId="org.eclipse.emf.compare.diagram.ide.ui.ecoretools">
</contentTypeBinding>
<viewer
- class="org.eclipse.emf.compare.diagram.ide.ui.ecoretools.DiagramContentMergeViewerCreator"
+ class="org.eclipse.emf.compare.diagram.ide.ui.ecoretools.internal.DiagramContentMergeViewerCreator"
extensions="diagramcompare_diff, ecorediag"
id="org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.ViewListContentMergeViewer"
label="Diagram Compare Content Merge Viewer">
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/pom.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/pom.xml
index de8e90f7d..299fede5f 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/pom.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/pom.xml
@@ -10,7 +10,7 @@
</parent>
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>org.eclipse.emf.compare.diagram.ide.ui.ecoretools</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/DiagramContentMergeViewerCreator.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/internal/DiagramContentMergeViewerCreator.java
index 8369eaddb..91ce11208 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/DiagramContentMergeViewerCreator.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/internal/DiagramContentMergeViewerCreator.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.papyrus;
+package org.eclipse.emf.compare.diagram.ide.ui.ecoretools.internal;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.IViewerCreator;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/EcoreToolsIDEUICompare.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/internal/EcoreToolsIDEUICompare.java
index f3672dced..2e18e07c8 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/EcoreToolsIDEUICompare.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/internal/EcoreToolsIDEUICompare.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.ecoretools;
+package org.eclipse.emf.compare.diagram.ide.ui.ecoretools.internal;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/META-INF/MANIFEST.MF
index 6b616bafd..df070b60c 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/META-INF/MANIFEST.MF
@@ -1,9 +1,9 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: Papyrus Diagram IDE UI Comparison Support
+Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide.ui.papyrus;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ui.papyrus.PapyrusIDEUICompare
+Bundle-Version: 2.2.0.qualifier
+Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ui.papyrus.internal.PapyrusIDEUICompare
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.compare,
@@ -25,7 +25,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.papyrus.uml.diagram.common,
org.eclipse.papyrus.infra.emf.diagram.common;bundle-version="0.9.1",
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.9.1",
- org.eclipse.emf.compare.diagram.ide.papyrus;bundle-version="2.0.0"
+ org.eclipse.papyrus.infra.core;bundle-version="0.9.1"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: Eclipse Modeling Project
-Export-Package: org.eclipse.emf.compare.diagram.ide.ui.papyrus
+Bundle-Vendor: %providerName
+Export-Package: org.eclipse.emf.compare.diagram.ide.ui.papyrus.internal;x-internal:=true
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.ini b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.ini
new file mode 100644
index 000000000..eec22440e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.properties
new file mode 100644
index 000000000..4c4332d9d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/about.properties
@@ -0,0 +1,26 @@
+# /**
+# * <copyright>
+# *
+# * Copyright (c) 2006, 2012 Obeo and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Obeo - Initial API and implementation
+# *
+# * </copyright>
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=EMF Compare Papyrus Integration
+
+featureText=EMF Compare - Papyrus Integration\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright Obeo and others. 2006, 2012. All rights reserved.\n\
+\n\
+EMF Compare brings comparison to the Eclipse Modeling Framework\n\
+Visit http://www.eclipse.org/emf/compare
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/build.properties
index 0ef0f305d..3710dba02 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/build.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/build.properties
@@ -1,5 +1,5 @@
#*******************************************************************************
- # Copyright (c) 2006, 2012 Obeo.
+ # Copyright (c) 2013 Obeo.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -14,5 +14,11 @@ bin.includes = META-INF/,\
.,\
plugin.xml,\
about.html,\
- plugin.properties
-src.includes = about.html
+ plugin.properties,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
+src.includes = about.html,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/modeling32.png b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/modeling32.png
new file mode 100644
index 000000000..6b08de2ad
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.properties
index 1c9ef2305..a97fbbc68 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.properties
@@ -8,5 +8,5 @@
# Contributors:
# Obeo - initial API and implementation
################################################################################
-pluginName = EMF Compare Papyrus Support IDE UI Integration
+pluginName = EMF Compare Papyrus Integration
providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.xml
index 92a475900..cf62be313 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/plugin.xml
@@ -1,10 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
+
+<!--
+ Copyright (c) 2013 Obeo.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Obeo - initial API and implementation
+-->
+
<plugin>
<extension
point="org.eclipse.compare.contentMergeViewers">
<viewer
- class="org.eclipse.emf.compare.diagram.ide.ui.papyrus.DiagramContentMergeViewerCreator"
+ class="org.eclipse.emf.compare.diagram.ide.ui.papyrus.internal.DiagramContentMergeViewerCreator"
extensions="diagramcompare_match, diagramcompare_diff, di, notation"
id="org.eclipse.emf.compare.ui.papyrus.contentviewer"
label="Diagram Compare Content Merge Viewer">
@@ -21,7 +33,7 @@
<extension
point="org.eclipse.core.contenttype.contentTypes">
<content-type
- describer="org.eclipse.emf.compare.diagram.ide.papyrus.DiContentDescriptor"
+ describer="org.eclipse.emf.compare.diagram.ide.ui.papyrus.internal.DiContentDescriptor"
file-extensions="di"
id="org.eclipse.emf.compare.papyrus.ui.papyruscontenttype"
name="Papyrus DI Content Type"
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/pom.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/pom.xml
index e5b6c57a9..b73b43cd2 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/pom.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/pom.xml
@@ -10,7 +10,7 @@
</parent>
<groupId>org.eclipse.emf.compare</groupId>
<artifactId>org.eclipse.emf.compare.diagram.ide.ui.papyrus</artifactId>
- <version>2.1.0-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<build>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/DiContentDescriptor.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/DiContentDescriptor.java
index 8d094ff43..93b9c2953 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.papyrus/src/org/eclipse/emf/compare/diagram/ide/papyrus/DiContentDescriptor.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/DiContentDescriptor.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.papyrus;
+package org.eclipse.emf.compare.diagram.ide.ui.papyrus.internal;
import java.io.BufferedReader;
import java.io.IOException;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/DiagramContentMergeViewerCreator.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/DiagramContentMergeViewerCreator.java
index 3c03cc2e5..f3d3a91aa 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.ecoretools/src/org/eclipse/emf/compare/diagram/ide/ui/ecoretools/DiagramContentMergeViewerCreator.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/DiagramContentMergeViewerCreator.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.ecoretools;
+package org.eclipse.emf.compare.diagram.ide.ui.papyrus.internal;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.IViewerCreator;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/PapyrusIDEUICompare.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/PapyrusIDEUICompare.java
index 926cd352f..c645648df 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/PapyrusIDEUICompare.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui.papyrus/src/org/eclipse/emf/compare/diagram/ide/ui/papyrus/internal/PapyrusIDEUICompare.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.papyrus;
+package org.eclipse.emf.compare.diagram.ide.ui.papyrus.internal;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
index c806d8934..bd73468dc 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide.ui;singleton:=true
Bundle-Version: 3.0.0.qualifier
-Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ui.GMFCompareUIPlugin
+Bundle-Activator: org.eclipse.emf.compare.diagram.ide.ui.internal.CompareDiagramIDEUIPlugin
Require-Bundle: org.eclipse.compare,
org.eclipse.emf.compare,
org.eclipse.gmf.runtime.diagram.ui,
@@ -11,21 +11,17 @@ Require-Bundle: org.eclipse.compare,
org.eclipse.emf.compare.ide;bundle-version="3.0.0",
org.eclipse.emf.compare.ide.ui;bundle-version="2.1.0",
org.eclipse.emf.compare.rcp.ui;bundle-version="2.1.0",
- org.eclipse.emf.compare.diagram.ide;bundle-version="2.0.0",
org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.emf.ecore.edit;bundle-version="2.5.0",
org.eclipse.emf.compare.edit;bundle-version="3.0.0"
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.emf.compare.diagram.ide.ui,
- org.eclipse.emf.compare.diagram.ide.ui.decoration,
- org.eclipse.emf.compare.diagram.ide.ui.decoration.provider,
- org.eclipse.emf.compare.diagram.ide.ui.internal.accessor,
- org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer,
- org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram,
- org.eclipse.emf.compare.diagram.ide.ui.internal.preferences,
- org.eclipse.emf.compare.diagram.ide.ui.mergeviewer
+Export-Package: org.eclipse.emf.compare.diagram.ide.ui.internal;x-internal:=true,
+ org.eclipse.emf.compare.diagram.ide.ui.internal.accessor;x-internal:=true,
+ org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.factory;x-internal:=true,
+ org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;x-internal:=true,
+ org.eclipse.emf.compare.diagram.ide.ui.internal.preferences;x-internal:=true
Bundle-Vendor: %providerName
-Import-Package: com.google.common.base;version="10.0.1",
- com.google.common.collect;version="10.0.1"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)"
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui/build.properties
index c1268f527..70980bf51 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/build.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/build.properties
@@ -1,14 +1,13 @@
-###############################################################################
-# Copyright (c) 2009, 2012 Tobias Jaehnel and Others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Tobias Jaehnel - Bug#241385
-# Obeo - rework on generic gmf comparison
-###############################################################################
+ #*******************************************************************************
+ # Copyright (c) 2013 Obeo.
+ # All rights reserved. This program and the accompanying materials
+ # are made available under the terms of the Eclipse Public License v1.0
+ # which accompanies this distribution, and is available at
+ # http://www.eclipse.org/legal/epl-v10.html
+ #
+ # Contributors:
+ # Obeo - initial API and implementation
+ #******************************************************************************/
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml
index 13f9988af..c870dff40 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/plugin.xml
@@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
+
+<!--
+ Copyright (c) 2013 Obeo.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Obeo - initial API and implementation
+-->
+
<plugin>
- <extension
- point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
- <decoratorProvider
- class="org.eclipse.emf.compare.diagram.ide.ui.decoration.provider.DiffDecoratorProvider">
- <Priority
- name="Lowest">
- </Priority>
- </decoratorProvider>
- </extension>
<extension
point="org.eclipse.ui.preferencePages">
@@ -32,5 +35,13 @@
ranking="40">
</factory>
</extension>
+ <extension
+ point="org.eclipse.emf.compare.rcp.ui.filters">
+ <filter
+ activeByDefault="true"
+ class="org.eclipse.emf.compare.diagram.ide.ui.structuremergeviewer.filters.GMFRefinedElementsFilter"
+ label="Diagram Refined elements">
+ </filter>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractEditPartMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractEditPartMergeViewer.java
deleted file mode 100644
index 908b96ec0..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractEditPartMergeViewer.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui;
-
-import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.jface.viewers.ISelection;
-
-/**
- * Abstract viewer for comparison of graphical elements.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- * @since 3.0
- */
-public abstract class AbstractEditPartMergeViewer extends AbstractEditPartViewer {
-
- /** The side that manages this viewer. */
- private final MergeViewerSide fSide;
-
- /**
- * Constructor.
- *
- * @param side
- * The side having to be handle.
- */
- public AbstractEditPartMergeViewer(MergeViewerSide side) {
- fSide = side;
- }
-
- /**
- * Set the input of the viewer.
- *
- * @param object
- * The input.
- */
- public abstract void setInput(Object object);
-
- /**
- * Returns the wrapped {@link AbstractEditPartViewer}.
- *
- * @return The viewer.
- */
- protected abstract AbstractEditPartViewer getGraphicalViewer();
-
- /**
- * {@inheritDoc}
- */
- public MergeViewerSide getSide() {
- return fSide;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
- */
- @Override
- public ISelection getSelection() {
- return getGraphicalViewer().getSelection();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ISelectionProvider(org.eclipse.jface.viewers.ISelection)
- */
- @Override
- public void setSelection(ISelection selection) {
- getGraphicalViewer().setSelection(selection);
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractGraphicalMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractGraphicalMergeViewer.java
deleted file mode 100644
index 401ee4d0c..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/AbstractGraphicalMergeViewer.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui;
-
-import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
-import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack;
-import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Abstract graphical merge viewer for comparison of graphical elements.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- * @since 3.0
- */
-public abstract class AbstractGraphicalMergeViewer extends AbstractEditPartMergeViewer {
-
- /** The diagram edit domain. */
- protected DiagramEditDomain editDomain;
-
- /** Listener for forwarding selection. */
- private final ISelectionChangedListener fForwardingSelectionListener;
-
- /**
- * The constructor.
- *
- * @param parent
- * The parent composite.
- * @param side
- * The side having to be handle.
- */
- public AbstractGraphicalMergeViewer(Composite parent, MergeViewerSide side) {
- super(side);
-
- editDomain = new DiagramEditDomain(null);
- editDomain.setCommandStack(new DiagramCommandStack(editDomain));
-
- setControl(createControl(parent));
- hookControl();
-
- fForwardingSelectionListener = new ForwardingViewerSelectionListener();
- // getGraphicalViewer().addSelectionChangedListener(fForwardingSelectionListener);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gef.ui.parts.AbstractEditPartViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
- */
- @Override
- protected void handleDispose(DisposeEvent event) {
- // getGraphicalViewer().removeSelectionChangedListener(fForwardingSelectionListener);
- super.handleDispose(event);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.AbstractEditPartMergeViewer#getGraphicalViewer()
- */
- @Override
- protected abstract AbstractEditPartViewer getGraphicalViewer();
-
- /**
- * Listener for forwarding selection.
- */
- private class ForwardingViewerSelectionListener implements ISelectionChangedListener {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- fireSelectionChanged();
- }
-
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/GMFCompareUIPlugin.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/GMFCompareUIPlugin.java
deleted file mode 100644
index 2d560452c..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/GMFCompareUIPlugin.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Tobias Jaehnel and Others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Tobias Jaehnel - Bug#241385
- * Obeo - rework on generic gmf comparison
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui;
-
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle.
- *
- * @author Tobias Jaehnel <tjaehnel@gmail.com>
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
- */
-public class GMFCompareUIPlugin extends AbstractUIPlugin {
-
- /** The plug-in ID. */
- public static final String PLUGIN_ID = "org.eclipse.emf.compare.diagram.ide.ui"; //$NON-NLS-1$
-
- /** The constant for the moved icon. */
- public static final String ICON_MOVED = "EMFCompareGMF.icon.moved"; //$NON-NLS-1$
-
- /** The constant for the added icon. */
- public static final String ICON_ADDED = "EMFCompareGMF.icon.added"; //$NON-NLS-1$
-
- /** The constant for the deleted icon. */
- public static final String ICON_DELETED = "EMFCompareGMF.icon.deleted"; //$NON-NLS-1$
-
- /** The shared instance. */
- private static GMFCompareUIPlugin plugin;
-
- /**
- * The constructor.
- */
- public GMFCompareUIPlugin() {
- // Do nothing
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance.
- *
- * @return the shared instance
- */
- public static GMFCompareUIPlugin getDefault() {
- return plugin;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
- */
- @Override
- protected void initializeImageRegistry(ImageRegistry registry) {
- registry.put(ICON_ADDED, PlatformUI.getWorkbench().getSharedImages().getImage(
- ISharedImages.IMG_OBJ_ADD));
- registry.put(ICON_DELETED, PlatformUI.getWorkbench().getSharedImages().getImage(
- ISharedImages.IMG_ETOOL_DELETE));
- registry.put(ICON_MOVED, PlatformUI.getWorkbench().getSharedImages().getImage(
- ISharedImages.IMG_ELCL_SYNCED));
- }
-
- /**
- * Returns a SWT image from registry.
- *
- * @param key
- * the image key
- * @return the image from the registry
- */
- public Image getImage(String key) {
- return getImageRegistry().get(key);
- }
-
- /**
- * Utility method to check if the object is a node or edge. Annotation can be set only on these types.
- *
- * @param gmfView
- * the view to be tested
- * @return true if the object is instance of Node or Edge
- */
- public static boolean isValid(Object gmfView) {
- return gmfView instanceof Node || gmfView instanceof Edge;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/AbstractDifferenceDecorator.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/AbstractDifferenceDecorator.java
deleted file mode 100644
index 560cca676..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/AbstractDifferenceDecorator.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.emf.compare.diagram.ide.ui.decoration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.Hide;
-import org.eclipse.emf.compare.diagram.LabelChange;
-import org.eclipse.emf.compare.diagram.Show;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.provider.DiffDecoratorProvider;
-import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.swt.graphics.Color;
-
-/**
- * The diff decorator superclass.
- *
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
- */
-public abstract class AbstractDifferenceDecorator implements IDecorator {
-
- /** the notificationListener. */
- protected NotificationListener notificationListener = new NotificationListener() {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- public void notifyChanged(Notification notification) {
- // on each notification, just refresh the decorator.
- refresh();
- }
- };
-
- /** the view target. */
- private IDecoratorTarget decoratorTarget;
-
- /** the decoration list to place on the target. */
- private List<IDecoration> decorationsTarget;
-
- /**
- * Constructor.
- *
- * @param target
- * the target to decorate.
- */
- protected AbstractDifferenceDecorator(IDecoratorTarget target) {
- this.decoratorTarget = target;
- }
-
- /**
- * Add a list of decoration to the list.
- *
- * @param decorations
- * the decorations to add
- * @return true if add has been correctly done.
- */
- private boolean addDecorations(List<IDecoration> decorations) {
- if (decorationsTarget == null) {
- decorationsTarget = new ArrayList<IDecoration>(decorations.size());
- }
- return decorationsTarget.addAll(decorations);
- }
-
- /**
- * Returns the decoratorTarget.
- *
- * @return The decoratorTarget.
- */
- public IDecoratorTarget getTarget() {
- return decoratorTarget;
- }
-
- /**
- * Removes all the decorations if they exists.
- */
- protected void removeDecorations() {
- if (decorationsTarget != null) {
- for (IDecoration decoration : decorationsTarget) {
- decoratorTarget.removeDecoration(decoration);
- }
- decorationsTarget.clear();
- }
- }
-
- protected IGraphicalEditPart getTargetEditPart() {
- return (IGraphicalEditPart)decoratorTarget.getAdapter(IGraphicalEditPart.class);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#refresh()
- */
- public final void refresh() {
- removeDecorations();
- if (DiffDecoratorProvider.shouldDecorate(getTarget())) {
- final IGraphicalEditPart gep = getTargetEditPart();
- final View view = gep.getNotationView();
- final DiagramDiff diff = DiffDecoratorProvider.getRelatedSelectedDifference(view);
- if (diff instanceof Hide) {
- addDecorations(getHidedDecorations());
- } else if (diff instanceof Show) {
- addDecorations(getShowedDecorations());
- } else if (diff instanceof LabelChange) {
- addDecorations(getLabelModifiedDecorations());
- } else if (diff.getKind() == DifferenceKind.MOVE) {
- addDecorations(getMovedDecorations());
- } else if (diff.getKind() == DifferenceKind.CHANGE) {
- addDecorations(getModifiedDecorations());
- } else if (diff.getKind() == DifferenceKind.ADD) {
- addDecorations(getAddedDecorations());
- } else if (diff.getKind() == DifferenceKind.DELETE) {
- addDecorations(getRemovedDecorations());
- }
- }
- }
-
- /**
- * Utility method to highlight an edge with specified color and line width.
- *
- * @param figure
- * the connection figure to highlight
- * @param color
- * the highlight color to use
- * @param size
- * the line width
- */
- protected void highlightEdge(IFigure figure, Color color, int size) {
- if (figure instanceof PolylineConnection) {
- figure.setBackgroundColor(color);
- figure.setForegroundColor(color);
- ((PolylineConnection)figure).setLineWidth(size);
- }
- }
-
- /**
- * Utility method to highlight a node.
- *
- * @param figure
- * the node to highlight
- * @param color
- * the highlight color to use
- * @param size
- * the line border width
- */
- protected void highlightNode(IFigure figure, Color color, int size) {
- figure.setBorder(new LineBorder(color, size));
- figure.setOpaque(false);
- }
-
- /**
- * Method used to create a specific set of decorations for the {@link DiffDecoratorProvider#DIFF_MODIFIED}
- * decoration.
- *
- * @return a list of {@link IDecoration}
- */
- protected abstract List<IDecoration> getModifiedDecorations();
-
- /**
- * Method used to create a specific set of decorations for the {@link DiffDecoratorProvider#DIFF_ADDED}
- * decoration.
- *
- * @return a list of {@link IDecoration}
- */
- protected abstract List<IDecoration> getAddedDecorations();
-
- /**
- * Method used to create a specific set of decorations for the {@link DiffDecoratorProvider#DIFF_REMOVED}
- * decoration.
- *
- * @return a list of {@link IDecoration}
- */
- protected abstract List<IDecoration> getRemovedDecorations();
-
- /**
- * Method used to create a specific set of decorations for the {@link DiffDecoratorProvider#DIFF_MOVED}
- * decoration.
- *
- * @return a list of {@link IDecoration}
- */
- protected abstract List<IDecoration> getMovedDecorations();
-
- /**
- * Method used to create a specific set of decorations for the {@link DiffDecoratorProvider#DIFF_HIDED}
- * decoration.
- *
- * @return a list of {@link IDecoration}
- */
- protected abstract List<IDecoration> getHidedDecorations();
-
- /**
- * Method used to create a specific set of decorations for the {@link DiffDecoratorProvider#DIFF_SHOWED}
- * decoration.
- *
- * @return a list of {@link IDecoration}
- */
- protected abstract List<IDecoration> getShowedDecorations();
-
- /**
- * Method used to create a specific set of decorations for the
- * {@link DiffDecoratorProvider#DIFF_LABEL_MODIFIED} decoration.
- *
- * @return a list of {@link IDecoration}
- */
- protected abstract List<IDecoration> getLabelModifiedDecorations();
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DeleteGhostImageFigure.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DeleteGhostImageFigure.java
deleted file mode 100644
index b4f643ac9..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DeleteGhostImageFigure.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.decoration;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.RectangleFigure;
-
-/**
- * Figure to represent a phantom of a graphical object.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class DeleteGhostImageFigure extends RectangleFigure {
-
- /**
- * Constructor.
- */
- public DeleteGhostImageFigure() {
- super();
- }
-
- // public DeleteGhostImageFigure(IFigure figure, int alpha, RGB transparency) {
- // super(figure, alpha, transparency);
- // }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.draw2d.Shape#paintFigure(org.eclipse.draw2d.Graphics)
- */
- @Override
- public void paintFigure(Graphics graphics) {
- super.paintFigure(graphics);
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffDecorationEditPolicy.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffDecorationEditPolicy.java
deleted file mode 100644
index e67fd1b81..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffDecorationEditPolicy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.decoration;
-
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.DecorationEditPolicy;
-
-/**
- * DecorationEditPolicy which forces the creation of decorators after each refresh.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class DiffDecorationEditPolicy extends DecorationEditPolicy {
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.editpolicies.DecorationEditPolicy#refresh()
- */
- @Override
- public void refresh() {
- decorators = null;
- super.refresh();
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffEdgeDecorator.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffEdgeDecorator.java
deleted file mode 100644
index a7fd80c36..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffEdgeDecorator.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.emf.compare.diagram.ide.ui.decoration;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.emf.compare.diagram.ide.ui.GMFCompareUIPlugin;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Decorator for edges.
- *
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
- */
-public class DiffEdgeDecorator extends AbstractDifferenceDecorator {
-
- /**
- * Constructor.
- *
- * @param target
- * the edge to decorate.
- */
- public DiffEdgeDecorator(IDecoratorTarget target) {
- super(target);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#activate()
- */
- public void activate() {
- final IGraphicalEditPart gep = getTargetEditPart();
- DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(gep.getNotationView(),
- NotationPackage.eINSTANCE.getNode_LayoutConstraint(), notificationListener);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#deactivate()
- */
- public void deactivate() {
- removeDecorations();
- final IGraphicalEditPart gep = getTargetEditPart();
- DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(
- gep.getNotationView(), NotationPackage.eINSTANCE.getNode_LayoutConstraint(),
- notificationListener);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getModifiedDecorations()
- */
- @Override
- protected List<IDecoration> getModifiedDecorations() {
- highlightEdge(getTargetEditPart().getFigure(), ColorConstants.blue, 2);
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getAddedDecorations()
- */
- @Override
- protected List<IDecoration> getAddedDecorations() {
- final ArrayList<IDecoration> decorations = new ArrayList<IDecoration>(1);
- highlightEdge(getTargetEditPart().getFigure(), ColorConstants.green, 2);
- final Image added = GMFCompareUIPlugin.getDefault().getImage(GMFCompareUIPlugin.ICON_ADDED);
- final IDecoration decoration2 = getTarget().addConnectionDecoration(added, 50, false);
- decorations.add(decoration2);
- return decorations;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getRemovedDecorations()
- */
- @Override
- protected List<IDecoration> getRemovedDecorations() {
- final ArrayList<IDecoration> decorations = new ArrayList<IDecoration>(1);
- highlightEdge(getTargetEditPart().getFigure(), ColorConstants.red, 2);
- final Image deleted = GMFCompareUIPlugin.getDefault().getImage(GMFCompareUIPlugin.ICON_DELETED);
- final IDecoration decoration2 = getTarget().addConnectionDecoration(deleted, 50, false);
- decorations.add(decoration2);
- return decorations;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getMovedDecorations()
- */
- @Override
- protected List<IDecoration> getMovedDecorations() {
- final ArrayList<IDecoration> decorations = new ArrayList<IDecoration>(1);
- final Image moved = GMFCompareUIPlugin.getDefault().getImage(GMFCompareUIPlugin.ICON_MOVED);
- final IDecoration decoration = getTarget().addConnectionDecoration(moved, 50, false);
- decorations.add(decoration);
- return decorations;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getHidedDecorations()
- */
- @Override
- protected List<IDecoration> getHidedDecorations() {
- highlightEdge(getTargetEditPart().getFigure(), ColorConstants.orange, 2);
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getShowedDecorations()
- */
- @Override
- protected List<IDecoration> getShowedDecorations() {
- highlightEdge(getTargetEditPart().getFigure(), ColorConstants.orange, 2);
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getLabelModifiedDecorations()
- */
- @Override
- protected List<IDecoration> getLabelModifiedDecorations() {
- return Collections.emptyList();
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffLabelDecorator.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffLabelDecorator.java
deleted file mode 100644
index fffb32e8d..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffLabelDecorator.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.emf.compare.diagram.ide.ui.decoration;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.emf.compare.diagram.ide.ui.GMFCompareUIPlugin;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Decorator for labels.
- *
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
- */
-public class DiffLabelDecorator extends AbstractDifferenceDecorator {
-
- /**
- * Constructor.
- *
- * @param target
- * the label to decorate.
- */
- public DiffLabelDecorator(IDecoratorTarget target) {
- super(target);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#activate()
- */
- public void activate() {
- final IGraphicalEditPart gep = getTargetEditPart();
- DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(gep.getNotationView(),
- NotationPackage.eINSTANCE.getNode_LayoutConstraint(), notificationListener);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#deactivate()
- */
- public void deactivate() {
- removeDecorations();
- final IGraphicalEditPart gep = getTargetEditPart();
- DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(
- gep.getNotationView(), NotationPackage.eINSTANCE.getNode_LayoutConstraint(),
- notificationListener);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getModifiedDecorations()
- */
- @Override
- protected List<IDecoration> getModifiedDecorations() {
- getTargetEditPart().getContentPane().setBorder(new LineBorder(ColorConstants.blue, 2));
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getAddedDecorations()
- */
- @Override
- protected List<IDecoration> getAddedDecorations() {
- getTargetEditPart().getContentPane().setBorder(new LineBorder(ColorConstants.green, 2));
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getRemovedDecorations()
- */
- @Override
- protected List<IDecoration> getRemovedDecorations() {
- getTargetEditPart().getContentPane().setBorder(new LineBorder(ColorConstants.red, 2));
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getMovedDecorations()
- */
- @Override
- protected List<IDecoration> getMovedDecorations() {
- final ArrayList<IDecoration> decorations = new ArrayList<IDecoration>(1);
- final Image moved = GMFCompareUIPlugin.getDefault().getImage(GMFCompareUIPlugin.ICON_MOVED);
- final IDecoration decoration = getTarget().addShapeDecoration(moved, Direction.NORTH_EAST, 1, false);
- decorations.add(decoration);
- return decorations;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getHidedDecorations()
- */
- @Override
- protected List<IDecoration> getHidedDecorations() {
- getTargetEditPart().getContentPane().setBorder(new LineBorder(ColorConstants.orange, 2));
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getShowedDecorations()
- */
- @Override
- protected List<IDecoration> getShowedDecorations() {
- getTargetEditPart().getContentPane().setBorder(new LineBorder(ColorConstants.orange, 2));
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getLabelModifiedDecorations()
- */
- @Override
- protected List<IDecoration> getLabelModifiedDecorations() {
- getTargetEditPart().getContentPane().setBorder(new LineBorder(ColorConstants.blue, 2));
- return Collections.emptyList();
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffNodeDecorator.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffNodeDecorator.java
deleted file mode 100644
index 1ba676b97..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/DiffNodeDecorator.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.emf.compare.diagram.ide.ui.decoration;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.emf.compare.diagram.ide.ui.GMFCompareUIPlugin;
-import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoration;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget.Direction;
-import org.eclipse.gmf.runtime.notation.NotationPackage;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * Decorator for nodes.
- *
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
- */
-public class DiffNodeDecorator extends AbstractDifferenceDecorator {
-
- /**
- * Constructor.
- *
- * @param target
- * the node to decorate.
- */
- public DiffNodeDecorator(IDecoratorTarget target) {
- super(target);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#activate()
- */
- public void activate() {
- final IGraphicalEditPart gep = getTargetEditPart();
- DiagramEventBroker.getInstance(gep.getEditingDomain()).addNotificationListener(gep.getNotationView(),
- NotationPackage.eINSTANCE.getNode_LayoutConstraint(), notificationListener);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecorator#deactivate()
- */
- public void deactivate() {
- removeDecorations();
- final IGraphicalEditPart gep = getTargetEditPart();
- DiagramEventBroker.getInstance(gep.getEditingDomain()).removeNotificationListener(
- gep.getNotationView(), NotationPackage.eINSTANCE.getNode_LayoutConstraint(),
- notificationListener);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getMovedDecorations()
- */
- @Override
- protected List<IDecoration> getMovedDecorations() {
- final ArrayList<IDecoration> decorations = new ArrayList<IDecoration>(1);
- final Image moved = GMFCompareUIPlugin.getDefault().getImage(GMFCompareUIPlugin.ICON_MOVED);
- final IDecoration decoration = getTarget().addShapeDecoration(moved, Direction.NORTH_EAST, 1, false);
- decorations.add(decoration);
- return decorations;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getModifiedDecorations()
- */
- @Override
- protected List<IDecoration> getModifiedDecorations() {
- highlightNode(getTargetEditPart().getFigure(), ColorConstants.blue, 2);
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getAddedDecorations()
- */
- @Override
- protected List<IDecoration> getAddedDecorations() {
- final ArrayList<IDecoration> decorations = new ArrayList<IDecoration>(1);
- highlightNode(getTargetEditPart().getFigure(), ColorConstants.green, 2);
- final Image added = GMFCompareUIPlugin.getDefault().getImage(GMFCompareUIPlugin.ICON_ADDED);
- final IDecoration decoration2 = getTarget().addShapeDecoration(added, Direction.NORTH_WEST, 1, false);
- decorations.add(decoration2);
- return decorations;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getHidedDecorations()
- */
- @Override
- protected List<IDecoration> getHidedDecorations() {
- highlightNode(getTargetEditPart().getFigure(), ColorConstants.orange, 2);
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getLabelModifiedDecorations()
- */
- @Override
- protected List<IDecoration> getLabelModifiedDecorations() {
- highlightNode(getTargetEditPart().getFigure(), ColorConstants.blue, 2);
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getRemovedDecorations()
- */
- @Override
- protected List<IDecoration> getRemovedDecorations() {
- final ArrayList<IDecoration> decorations = new ArrayList<IDecoration>(1);
- highlightNode(getTargetEditPart().getFigure(), ColorConstants.red, 2);
- final Image deleted = GMFCompareUIPlugin.getDefault().getImage(GMFCompareUIPlugin.ICON_DELETED);
- final IDecoration decoration2 = getTarget().addShapeDecoration(deleted, Direction.NORTH_WEST, 1,
- false);
- decorations.add(decoration2);
- return decorations;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.ide.ui.decoration.AbstractDifferenceDecorator#getShowedDecorations()
- */
- @Override
- protected List<IDecoration> getShowedDecorations() {
- highlightNode(getTargetEditPart().getFigure(), ColorConstants.orange, 2);
- return Collections.emptyList();
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/DiffDecoratorProvider.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/DiffDecoratorProvider.java
deleted file mode 100644
index c146f741d..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/DiffDecoratorProvider.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.decoration.provider;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.ide.ui.EMFCompareDiagramIDEUIMessages;
-import org.eclipse.emf.compare.diagram.ide.ui.GMFCompareUIPlugin;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.DiffEdgeDecorator;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.DiffLabelDecorator;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.DiffNodeDecorator;
-import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
-import org.eclipse.gmf.runtime.common.core.service.IOperation;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.CreateDecoratorsOperation;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider;
-import org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.Edge;
-import org.eclipse.gmf.runtime.notation.Node;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * The graphical decorator for comparison.
- *
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
- */
-public class DiffDecoratorProvider extends AbstractProvider implements IDecoratorProvider {
-
- /** The decorator marker for diff. used also to annotate the diagrams during comparison. */
- public static final String DIFF = "diff-marker"; //$NON-NLS-1$
-
- /** Constant for added element. */
- public static final String DIFF_ADDED = "diff-added"; //$NON-NLS-1$
-
- /** Constant for removed element. */
- public static final String DIFF_REMOVED = "diff-removed"; //$NON-NLS-1$
-
- /** Constant for moved element. */
- public static final String DIFF_MOVED = "diff-moved"; //$NON-NLS-1$
-
- /** Constant for hided element. */
- public static final String DIFF_HIDED = "diff-hided"; //$NON-NLS-1$
-
- /** Constant for showed element. */
- public static final String DIFF_SHOWED = "diff-showed"; //$NON-NLS-1$
-
- /** Constant for modified element. */
- public static final String DIFF_MODIFIED = "diff-modified"; //$NON-NLS-1$
-
- /** Constant for modified element. */
- public static final String DIFF_LABEL_MODIFIED = "diff-label-modified"; //$NON-NLS-1$
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.common.core.service.IProvider#provides(org.eclipse.gmf.runtime.common.core.service.IOperation)
- */
- public boolean provides(IOperation operation) {
- if (operation instanceof CreateDecoratorsOperation) {
- final IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation)operation)
- .getDecoratorTarget();
- return shouldDecorate(decoratorTarget);
- }
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorProvider#createDecorators(org.eclipse.gmf.runtime.diagram.ui.services.decorator.IDecoratorTarget)
- */
- public void createDecorators(IDecoratorTarget decoratorTarget) {
- final View view = (View)decoratorTarget.getAdapter(View.class);
- if (shouldDecorate(view)) {
- final ITextAwareEditPart label = (ITextAwareEditPart)decoratorTarget
- .getAdapter(ITextAwareEditPart.class);
-
- if (label != null && isNode(view)) {
- // a label = a node representation + a textholder
- decoratorTarget.installDecorator(DIFF, new DiffLabelDecorator(decoratorTarget));
- } else if (isEdge(view)) {
- decoratorTarget.installDecorator(DIFF, new DiffEdgeDecorator(decoratorTarget));
- } else if (isNode(view)) {
- decoratorTarget.installDecorator(DIFF, new DiffNodeDecorator(decoratorTarget));
- } else {
- final String errorMsg = EMFCompareDiagramIDEUIMessages.getString(
- "DiffDecoratorProvider.UnknownView", view); //$NON-NLS-1$
- final IStatus status = new Status(IStatus.WARNING, GMFCompareUIPlugin.PLUGIN_ID, errorMsg);
- GMFCompareUIPlugin.getDefault().getLog().log(status);
- }
- }
- }
-
- /**
- * Check the EAnnotations list of the view to find the diff one.
- *
- * @param decoratorTarget
- * the target to test
- * @return true if target should be decorated ( diff EAnnotation is set )
- */
- public static boolean shouldDecorate(IDecoratorTarget decoratorTarget) {
- return shouldDecorate((View)decoratorTarget.getAdapter(View.class));
- }
-
- /**
- * Check the EAnnotations list of the view to find the diff one.
- *
- * @param view
- * the view element to check
- * @return true if view should be decorated ( diff EAnnotation is set )
- */
- public static boolean shouldDecorate(final View view) {
- return !(view instanceof Diagram) && getRelatedSelectedDifference(view) != null;
- }
-
- /**
- * Check if the view is a link representation.
- *
- * @param view
- * the gmf view
- * @return true if the view is an edge
- */
- private static boolean isEdge(View view) {
- return view != null && (view instanceof Edge) && view.eContainer() instanceof Diagram;
- }
-
- /**
- * Check if the view is a node representation.
- *
- * @param view
- * the gmf view
- * @return true if the view is a node
- */
- private static boolean isNode(View view) {
- return view != null && (view instanceof Node);
- }
-
- /**
- * Get the graphical difference in relation to the given view.
- *
- * @param view
- * The view.
- * @return The graphical difference.
- */
- public static DiagramDiff getRelatedSelectedDifference(View view) {
- SelectedDiffAdapter adapter = getSelectedDiffAdapter(view);
- if (adapter != null) {
- Notifier notifier = adapter.getTarget();
- if (notifier instanceof DiagramDiff) {
- return (DiagramDiff)notifier;
- }
- }
- return null;
- }
-
- /**
- * Get a <code>SelectedDiffAdapter</code> if it exists, on the given view.
- *
- * @param view
- * The view.
- * @return The adapter or null.
- */
- private static SelectedDiffAdapter getSelectedDiffAdapter(View view) {
- Iterator<Adapter> adapters = view.eAdapters().iterator();
- while (adapters.hasNext()) {
- Adapter adapter = adapters.next();
- if (adapter.isAdapterForType(DiagramDiff.class)) {
- return (SelectedDiffAdapter)adapter;
- }
- }
- return null;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/SelectedDiffAdapter.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/SelectedDiffAdapter.java
deleted file mode 100644
index 7a72447f4..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/decoration/provider/SelectedDiffAdapter.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.decoration.provider;
-
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-
-/**
- * Adapter to retrieve the graphical differences on an object.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public class SelectedDiffAdapter implements Adapter {
-
- /** A graphical difference. */
- private DiagramDiff diff;
-
- /**
- * Constructor.
- *
- * @param diff
- * A graphical difference.
- */
- public SelectedDiffAdapter(DiagramDiff diff) {
- this.diff = diff;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- public void notifyChanged(Notification notification) {
- // TODO Auto-generated method stub
-
- }
-
- public Notifier getTarget() {
- return diff;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
- */
- public void setTarget(Notifier newTarget) {
- if (newTarget instanceof DiagramDiff) {
- this.diff = (DiagramDiff)newTarget;
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object)
- */
- public boolean isAdapterForType(Object type) {
- return type == DiagramDiff.class;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/AbstractGraphicalMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/AbstractGraphicalMergeViewer.java
new file mode 100644
index 000000000..74c0bd6a9
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/AbstractGraphicalMergeViewer.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal;
+
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.MergeViewer;
+import org.eclipse.gef.ui.parts.AbstractEditPartViewer;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * Abstract graphical merge viewer for comparison of graphical elements.<br>
+ * Inspired from org.eclipse.emf.compare.rcp.ui.mergeviewer.StructuredMergeViewer.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ * @since 3.0
+ */
+public abstract class AbstractGraphicalMergeViewer extends MergeViewer {
+
+ /**
+ * Control of the viewer.
+ */
+ private final Control fControl;
+
+ /**
+ * The constructor.
+ *
+ * @param parent
+ * The parent composite.
+ * @param side
+ * The side having to be handle.
+ */
+ public AbstractGraphicalMergeViewer(Composite parent, MergeViewerSide side) {
+ super(side);
+ fControl = createControl(parent);
+ hookControl(fControl);
+ }
+
+ @Override
+ public Control getControl() {
+ return fControl;
+ }
+
+ /**
+ * It creates and returns the control of the viewer.
+ *
+ * @param parent
+ * The parent composite.
+ * @return The control.
+ */
+ protected abstract Control createControl(Composite parent);
+
+ /**
+ * Get the encapsulated GEF viewer.
+ *
+ * @return The graphical viewer.
+ */
+ protected abstract AbstractEditPartViewer getGraphicalViewer();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
+ */
+ @Override
+ public ISelection getSelection() {
+ return getGraphicalViewer().getSelection();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
+ */
+ @Override
+ public void setSelection(ISelection selection, boolean reveal) {
+ getGraphicalViewer().setSelection(selection);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java
new file mode 100644
index 000000000..a60d946e1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/CompareDiagramIDEUIPlugin.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.internal;
+
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramConfiguration;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramConstants;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor;
+import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
+import org.eclipse.emf.compare.extension.PostProcessorRegistry;
+import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public class CompareDiagramIDEUIPlugin extends AbstractUIPlugin {
+
+ /** The shared instance. */
+ private static CompareDiagramIDEUIPlugin plugin;
+
+ /** Specific configuration for diagram comparison. */
+ private CompareDiagramConfiguration configuration;
+
+ /**
+ * The constructor.
+ */
+ public CompareDiagramIDEUIPlugin() {
+ // Do nothing
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ configuration = new CompareDiagramConfiguration();
+ getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ // XXX: does it work ?
+
+ if (CompareDiagramConstants.PREFERENCES_KEY_MOVE_THRESHOLD.equals(event.getProperty())) {
+ Object newValue = event.getNewValue();
+ if (newValue != null) {
+ configuration.setMoveThreshold((Integer)newValue);
+ } else {
+ configuration.setMoveThreshold(0);
+ }
+ }
+ }
+ });
+ configuration.setMoveThreshold(getPreferenceStore().getInt(
+ CompareDiagramConstants.PREFERENCES_KEY_MOVE_THRESHOLD));
+
+ PostProcessorRegistry postProcessorRegistry = EMFCompareIDEPlugin.getDefault()
+ .getPostProcessorRegistry();
+ for (PostProcessorDescriptor descriptor : postProcessorRegistry.getRegisteredPostProcessors()) {
+ if (descriptor.getExtensionClassName().equals(CompareDiagramPostProcessor.class.getName())) {
+ CompareDiagramPostProcessor postProcessor = (CompareDiagramPostProcessor)descriptor
+ .getPostProcessor();
+ postProcessor.setConfiguration(configuration);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ *
+ * @return the shared instance
+ */
+ public static CompareDiagramIDEUIPlugin getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/EMFCompareDiagramIDEUIMessages.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/EMFCompareDiagramIDEUIMessages.java
index d7a12ac5f..0222821b6 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/EMFCompareDiagramIDEUIMessages.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/EMFCompareDiagramIDEUIMessages.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui;
+package org.eclipse.emf.compare.diagram.ide.ui.internal;
import java.text.MessageFormat;
import java.util.MissingResourceException;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEDiffAccessorImpl.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEDiffAccessorImpl.java
index 2da084afb..2aa59f1cb 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEDiffAccessorImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEDiffAccessorImpl.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.compare.diagram.ide.ui.internal.accessor;
import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
import org.eclipse.emf.ecore.EObject;
@@ -68,7 +68,10 @@ public class DiagramIDEDiffAccessorImpl extends DiagramIDEMatchAccessorImpl impl
public EObject getEObject(MergeViewerSide side) {
EObject obj = getEObject();
Match eObjectMatch = fComparison.getMatch(obj);
- return getEObject(eObjectMatch, side);
+ if (eObjectMatch != null) {
+ return getEObject(eObjectMatch, side);
+ }
+ return null;
}
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEMatchAccessorImpl.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEMatchAccessorImpl.java
index 82d1f4e92..48e73c5c3 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEMatchAccessorImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/DiagramIDEMatchAccessorImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,19 +27,28 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.swt.graphics.Image;
/**
+ * Input of each diagram merge viewer when a match is selected.
+ *
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
public class DiagramIDEMatchAccessorImpl implements IDiagramNodeAccessor, ITypedElement, IStreamContentAccessor {
+ /** The comparison. */
+ protected Comparison fComparison;
+
+ /** The related match object. */
private Match fMatch;
+ /** The side to impact. */
private MergeViewerSide fSide;
- protected Comparison fComparison;
-
/**
- * @param adapterFactory
- * @param eObject
+ * Constructor.
+ *
+ * @param match
+ * The related match object.
+ * @param side
+ * The side to impact.
*/
public DiagramIDEMatchAccessorImpl(Match match, MergeViewerSide side) {
this.fMatch = match;
@@ -96,45 +105,78 @@ public class DiagramIDEMatchAccessorImpl implements IDiagramNodeAccessor, ITyped
return new ByteArrayInputStream(new byte[] {' ' });
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getEObject(org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
+ */
public EObject getEObject(MergeViewerSide side) {
return getEObject(fMatch, side);
}
+ /**
+ * Get the object from the given side.
+ *
+ * @param match
+ * The match of the expected object.
+ * @param side
+ * The side to look for.
+ * @return The found object.
+ */
protected EObject getEObject(Match match, MergeViewerSide side) {
+ EObject result = null;
switch (side) {
case LEFT:
- return match.getLeft();
+ result = match.getLeft();
+ break;
case RIGHT:
- return match.getRight();
+ result = match.getRight();
+ break;
case ANCESTOR:
- return match.getOrigin();
- default:
+ result = match.getOrigin();
break;
+ default:
}
- return null;
+ return result;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getDiagram(org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
+ */
public Diagram getDiagram(MergeViewerSide side) {
+ Diagram diagram = null;
EObject obj = getEObject(side);
if (obj != null) {
- return getDiagram(obj);
+ diagram = getDiagram(obj);
} else {
obj = getEObject(getOpposite(side));
if (obj != null) {
- Diagram diagram = getDiagram(obj);
+ diagram = getDiagram(obj);
if (diagram != null) {
Match diagramMatch = fComparison.getMatch(diagram);
- return (Diagram)getEObject(diagramMatch, side);
+ diagram = (Diagram)getEObject(diagramMatch, side);
}
}
}
- return null;
+ return diagram;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getOwnedDiagram()
+ */
public Diagram getOwnedDiagram() {
return getDiagram(fSide);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getOwnedView()
+ */
public View getOwnedView() {
View result = (View)getEObject(fSide);
if (result == null) {
@@ -143,19 +185,37 @@ public class DiagramIDEMatchAccessorImpl implements IDiagramNodeAccessor, ITyped
return result;
}
+ /**
+ * Get the related diagram from the given object.
+ *
+ * @param obj
+ * The object.
+ * @return The diagram.
+ */
protected Diagram getDiagram(EObject obj) {
+ Diagram diagram = null;
if (obj instanceof Diagram) {
- return (Diagram)obj;
+ diagram = (Diagram)obj;
} else if (obj instanceof View) {
- return ((View)obj).getDiagram();
+ diagram = ((View)obj).getDiagram();
}
- return null;
+ return diagram;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getComparison()
+ */
public Comparison getComparison() {
return fComparison;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getOriginSide()
+ */
public MergeViewerSide getOriginSide() {
EObject origin = getEObject(MergeViewerSide.ANCESTOR);
if (origin == null) {
@@ -165,14 +225,31 @@ public class DiagramIDEMatchAccessorImpl implements IDiagramNodeAccessor, ITyped
}
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getSide()
+ */
public MergeViewerSide getSide() {
return fSide;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor#getAllDiffs()
+ */
public List<Diff> getAllDiffs() {
return fComparison.getDifferences();
}
+ /**
+ * Get the opposite side of the given one.
+ *
+ * @param side
+ * The given side.
+ * @return the opposite one.
+ */
private MergeViewerSide getOpposite(MergeViewerSide side) {
if (side == MergeViewerSide.LEFT) {
return MergeViewerSide.RIGHT;
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramDiffAccessor.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramDiffAccessor.java
index 7d5f6a701..58753c562 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramDiffAccessor.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramDiffAccessor.java
@@ -1,10 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.internal.accessor;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.accessor.IEObjectAccessor;
+/**
+ * Input for selection of elements related to a difference.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
public interface IDiagramDiffAccessor extends IDiagramNodeAccessor, IEObjectAccessor {
+ /**
+ * Get the difference related to this input.
+ *
+ * @return The graphical difference.
+ */
DiagramDiff getDiff();
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramNodeAccessor.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramNodeAccessor.java
index 0021e1f04..f26af85ad 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramNodeAccessor.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/IDiagramNodeAccessor.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.internal.accessor;
import java.util.List;
@@ -9,22 +19,71 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
+/**
+ * Input for selection of nodes related to a match.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
public interface IDiagramNodeAccessor {
+ /**
+ * Get the related comparison.
+ *
+ * @return The comparison.
+ */
Comparison getComparison();
+ /**
+ * Get the object from the related match of this input and the given side.
+ *
+ * @param side
+ * The side to scan.
+ * @return The object.
+ */
EObject getEObject(MergeViewerSide side);
+ /**
+ * Get the diagram from the given side.
+ *
+ * @param side
+ * The side t scan.
+ * @return The diagram.
+ */
Diagram getDiagram(MergeViewerSide side);
+ /**
+ * Get the diagram related to this input.
+ *
+ * @return The diagram.
+ */
Diagram getOwnedDiagram();
+ /**
+ * Get the view related to this input.
+ *
+ * @return The view.
+ */
View getOwnedView();
+ /**
+ * Get the side considered as the origin version.
+ *
+ * @return The origin side.
+ */
MergeViewerSide getOriginSide();
+ /**
+ * Get the side of this input.
+ *
+ * @return The side.
+ */
MergeViewerSide getSide();
+ /**
+ * Get all the differences of the comparison.
+ *
+ * @return The differences.
+ */
List<Diff> getAllDiffs();
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEDiffAccessorFactory.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEDiffAccessorFactory.java
index 50ac3c486..65de89758 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEDiffAccessorFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEDiffAccessorFactory.java
@@ -1,18 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.factory;
import org.eclipse.compare.ITypedElement;
import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.DiagramIDEDiffAccessorImpl;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.accessor.IAccessorFactory.AbstractAccessorFactory;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
/**
+ * Factory for graphical differences accessors.
+ *
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
public class DiagramIDEDiffAccessorFactory extends AbstractAccessorFactory {
/**
+ * It creates a graphical accessor from the given selected difference and expected side.
+ *
+ * @param diff
+ * The selected difference.
+ * @param side
+ * The side of the input to create.
+ * @return The accessor.
+ */
+ private ITypedElement createAccessor(DiagramDiff diff, MergeViewerSide side) {
+ return new DiagramIDEDiffAccessorImpl(diff, side);
+ }
+
+ /**
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.accessor.IAccessorFactory#isFactoryFor(java.lang.Object)
@@ -21,10 +46,6 @@ public class DiagramIDEDiffAccessorFactory extends AbstractAccessorFactory {
return target instanceof DiagramDiff;
}
- private ITypedElement createAccessor(DiagramDiff diff, MergeViewerSide side) {
- return new DiagramIDEDiffAccessorImpl(diff, side);
- }
-
/**
* {@inheritDoc}
*
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEMatchAccessorFactory.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEMatchAccessorFactory.java
index 8a0e48205..e3ff8aa5e 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEMatchAccessorFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/accessor/factory/DiagramIDEMatchAccessorFactory.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.factory;
import org.eclipse.compare.ITypedElement;
@@ -8,10 +18,16 @@ import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.accessor.IAcce
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
/**
+ * Factory for graphical matches accessors.
+ *
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
public class DiagramIDEMatchAccessorFactory extends AbstractAccessorFactory {
+ /**
+ * Predicate on the namespace URI to create a graphical match accessor and so to be able to open a diagram
+ * comparison on the selection of a graphical match.
+ */
private static final String NS_URI_PATTERN = "http://www.eclipse.org/gmf/runtime/\\d.\\d.\\d/notation";
/**
@@ -20,14 +36,25 @@ public class DiagramIDEMatchAccessorFactory extends AbstractAccessorFactory {
* @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.accessor.IAccessorFactory#isFactoryFor(java.lang.Object)
*/
public boolean isFactoryFor(Object target) {
+ // CHECKSTYLE:OFF
return target instanceof Match
&& (((Match)target).getLeft() != null
&& ((Match)target).getLeft().eClass().getEPackage().getNsURI()
.matches(NS_URI_PATTERN) || ((Match)target).getRight() != null
&& ((Match)target).getRight().eClass().getEPackage().getNsURI().matches(
NS_URI_PATTERN));
+ // CHECKSTYLE:ON
}
+ /**
+ * It creates a graphical accessor from the given selected match and expected side.
+ *
+ * @param match
+ * The selected match.
+ * @param side
+ * The side of the input to create.
+ * @return The accessor.
+ */
private ITypedElement createAccessor(Match match, MergeViewerSide side) {
return new DiagramIDEMatchAccessorImpl(match, side);
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/DiagramCompareContentMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/DiagramCompareContentMergeViewer.java
deleted file mode 100644
index d8f5328d3..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/DiagramCompareContentMergeViewer.java
+++ /dev/null
@@ -1,634 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.compare.CompareNavigator;
-import org.eclipse.compare.ICompareNavigator;
-import org.eclipse.compare.contentmergeviewer.ContentMergeViewer;
-import org.eclipse.compare.internal.CompareHandlerService;
-import org.eclipse.compare.internal.Utilities;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.diagram.ide.ui.AbstractEditPartMergeViewer;
-import org.eclipse.emf.compare.domain.ICompareEditingDomain;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
-import org.eclipse.emf.compare.ide.ui.internal.EMFCompareConstants;
-import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.tree.TreeContentMergeViewerContentProvider;
-import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.DynamicObject;
-import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.EMFCompareColor;
-import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColor;
-import org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColorProvider;
-import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.ToolBarManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public abstract class DiagramCompareContentMergeViewer extends ContentMergeViewer implements ISelectionChangedListener, ICompareColorProvider, IAdaptable {
-
- private static final String HANDLER_SERVICE = "fHandlerService";
-
- protected static final int HORIZONTAL = 1;
-
- protected static final int VERTICAL = 2;
-
- protected static final double HSPLIT = 0.5;
-
- protected static final double VSPLIT = 0.3;
-
- /**
- * Width of center bar
- */
- protected static final int CENTER_WIDTH = 34;
-
- protected AbstractEditPartMergeViewer fAncestor;
-
- protected AbstractEditPartMergeViewer fLeft;
-
- protected AbstractEditPartMergeViewer fRight;
-
- private ActionContributionItem fCopyDiffLeftToRightItem;
-
- private ActionContributionItem fCopyDiffRightToLeftItem;
-
- protected final Comparison fComparison;
-
- private final AtomicBoolean fSyncingSelections = new AtomicBoolean(false);
-
- private EMFCompareColor fColors;
-
- private final ICompareEditingDomain fEditingDomain;
-
- private final DynamicObject fDynamicObject;
-
- /**
- * @param style
- * @param bundle
- * @param cc
- */
- protected DiagramCompareContentMergeViewer(Composite parent, int style, ResourceBundle bundle,
- CompareConfiguration cc) {
- super(style, bundle, cc);
- fDynamicObject = new DynamicObject(this);
-
- fComparison = (Comparison)cc.getProperty(EMFCompareConstants.COMPARE_RESULT);
-
- fEditingDomain = (ICompareEditingDomain)getCompareConfiguration().getProperty(
- EMFCompareConstants.EDITING_DOMAIN);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.mergeviewer.ICompareColorProvider#getCompareColor()
- */
- public ICompareColor getCompareColor() {
- return fColors;
- }
-
- /**
- * @return the fEditingDomain
- */
- protected final ICompareEditingDomain getEditingDomain() {
- return fEditingDomain;
- }
-
- /**
- * @return the fComparison
- */
- protected final Comparison getComparison() {
- return fComparison;
- }
-
- /**
- * {@inheritDoc}
- * <p>
- * Overriden to enhance visibility.
- * </p>
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#isThreeWay()
- */
- @Override
- public boolean isThreeWay() {
- // enhances visibility
- return super.isThreeWay();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#updateContent(java.lang.Object,
- * java.lang.Object, java.lang.Object)
- */
- @Override
- protected void updateContent(Object ancestor, Object left, Object right) {
-
- fAncestor.setInput(ancestor);
- fLeft.setInput(left);
- fRight.setInput(right);
-
- // must update selection after the three viewers input has been set
- // to avoid some NPE/AssertionError (they are calling each other on selectionChanged event to
- // synchronize their selection)
-
- // EObject leftInitialItem = null;
- // if (left instanceof IDiagramNodeAccessor) {
- // leftInitialItem = ((IDiagramNodeAccessor)left).getEObject(MergeViewerSide.LEFT);
- // }
- //
- // ISelection leftSelection = createSelectionOrEmpty(leftInitialItem);
- // fLeft.setSelection(leftSelection); // others will synchronize on this one :)
-
- // getCenterControl().redraw();
-
- // if (ancestor != null) {
- // ancestorTED = EditingDomainUtils.getOrCreateEditingDomain(ancestor);
- // }
- // if (left != null) {
- // leftTED = EditingDomainUtils.getOrCreateEditingDomain(left);
- // annotateSide(DifferenceSource.LEFT);
- // }
- //
- // if (right != null) {
- // rightTED = EditingDomainUtils.getOrCreateEditingDomain(right);
- // annotateSide(DifferenceSource.RIGHT);
- // }
-
- }
-
- // /**
- // * Execute a RecordingCommand to annotate the {@link #getInput() input} of this viewer. Only the given
- // * <code>side</code> is annotated.
- // *
- // * @param side
- // * The side to annotate.
- // */
- // private void annotateSide(final DifferenceSource side) {
- // TransactionalEditingDomain ted = null;
- // if (side == DifferenceSource.LEFT) {
- // ted = leftTED;
- // } else {
- // ted = rightTED;
- // }
- //
- // // annotate models
- // final RecordingCommand command = new RecordingCommand(ted) {
- // @Override
- // protected void doExecute() {
- // if (gmfModelCreator != null) {
- // gmfModelCreator.setInput(getInput());
- // gmfModelCreator.addEAnnotations(side);
- // }
- // }
- // };
- // ted.getCommandStack().execute(command);
- // }
- //
- // /**
- // * Execute a RecordingCommand to annotate the {@link #getInput() input} of this viewer. Only the given
- // * <code>side</code> is annotated.
- // *
- // * @param side
- // * The side to annotate.
- // */
- // protected void unnannotateSide(final DifferenceSource side) {
- // TransactionalEditingDomain ted = null;
- // if (side == DifferenceSource.LEFT) {
- // ted = leftTED;
- // } else {
- // ted = rightTED;
- // }
- //
- // // de-annotate models
- // final RecordingCommand command = new RecordingCommand(ted) {
- // @Override
- // protected void doExecute() {
- // if (gmfModelCreator != null) {
- // gmfModelCreator.setInput(getInput());
- // gmfModelCreator.removeEAnnotations(side);
- // }
- // }
- // };
- // ted.getCommandStack().execute(command);
- // }
-
- private ISelection createSelectionOrEmpty(final Object o) {
- final ISelection selection;
- if (o != null) {
- selection = new StructuredSelection(o);
- } else {
- selection = StructuredSelection.EMPTY;
- }
- return selection;
- }
-
- /**
- * Inhibits this method to avoid asking to save on each input change!!
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#doSave(java.lang.Object,
- * java.lang.Object)
- */
- @Override
- protected boolean doSave(Object newInput, Object oldInput) {
- return false;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#createControls(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected void createControls(Composite composite) {
- fAncestor = createMergeViewer(composite, MergeViewerSide.ANCESTOR, this);
- fAncestor.addSelectionChangedListener(this);
-
- fLeft = createMergeViewer(composite, MergeViewerSide.LEFT, this);
- fLeft.addSelectionChangedListener(this);
-
- fRight = createMergeViewer(composite, MergeViewerSide.RIGHT, this);
- fRight.addSelectionChangedListener(this);
-
- fColors = new EMFCompareColor(this, null, getCompareConfiguration());
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#createToolItems(org.eclipse.jface.action.ToolBarManager)
- */
- @Override
- protected void createToolItems(ToolBarManager toolBarManager) {
- // Copy actions
- CompareConfiguration cc = getCompareConfiguration();
- if (cc.isRightEditable()) {
- Action copyLeftToRight = new Action() {
- @Override
- public void run() {
- copyDiff(true);
- // Select next diff
- navigate(true);
- }
- };
- Utilities.initAction(copyLeftToRight, getResourceBundle(), "action.CopyDiffLeftToRight.");
- copyLeftToRight.setEnabled(false);
- fCopyDiffLeftToRightItem = new ActionContributionItem(copyLeftToRight);
- fCopyDiffLeftToRightItem.setVisible(true);
- toolBarManager.appendToGroup("merge", fCopyDiffLeftToRightItem); //$NON-NLS-1$
- getHandlerService().registerAction(copyLeftToRight, "org.eclipse.compare.copyLeftToRight");
- }
-
- if (cc.isLeftEditable()) {
- Action copyRightToLeft = new Action() {
- @Override
- public void run() {
- copyDiff(false);
- // Select next diff
- navigate(true);
- }
- };
- Utilities.initAction(copyRightToLeft, getResourceBundle(), "action.CopyDiffRightToLeft.");
- copyRightToLeft.setEnabled(false);
- fCopyDiffRightToLeftItem = new ActionContributionItem(copyRightToLeft);
- fCopyDiffRightToLeftItem.setVisible(true);
- toolBarManager.appendToGroup("merge", fCopyDiffRightToLeftItem); //$NON-NLS-1$
- getHandlerService().registerAction(copyRightToLeft, "org.eclipse.compare.copyRightToLeft");
- }
-
- // Navigation
- final Action nextDiff = new Action() {
- @Override
- public void run() {
- navigate(true);
- }
- };
- Utilities.initAction(nextDiff, getResourceBundle(), "action.NextDiff.");
- ActionContributionItem contributionNextDiff = new ActionContributionItem(nextDiff);
- contributionNextDiff.setVisible(true);
- toolBarManager.appendToGroup("navigation", contributionNextDiff);
-
- final Action previousDiff = new Action() {
- @Override
- public void run() {
- navigate(false);
- }
- };
- Utilities.initAction(previousDiff, getResourceBundle(), "action.PrevDiff.");
- ActionContributionItem contributionPreviousDiff = new ActionContributionItem(previousDiff);
- contributionPreviousDiff.setVisible(true);
- toolBarManager.appendToGroup("navigation", contributionPreviousDiff);
-
- // Undo/Redo
- // final UndoAction undoAction = new UndoAction(fEditingDomain);
- // final RedoAction redoAction = new RedoAction(fEditingDomain);
- //
- // fEditingDomain.getCommandStack().addCommandStackListener(new CommandStackListener() {
- // public void commandStackChanged(EventObject event) {
- // undoAction.update();
- // redoAction.update();
- // refresh();
- // }
- // });
- //
- // getHandlerService().setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
- // getHandlerService().setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#copy(boolean)
- */
- @Override
- protected void copy(boolean leftToRight) {
- EList<Diff> differences = getComparison().getDifferences();
-
- final Command copyCommand = getEditingDomain().createCopyAllNonConflictingCommand(differences,
- leftToRight, EMFCompareIDEPlugin.getDefault().getMergerRegistry());
-
- getEditingDomain().getCommandStack().execute(copyCommand);
-
- if (leftToRight) {
- setRightDirty(true);
- } else {
- setLeftDirty(true);
- }
- refresh();
- }
-
- /**
- * Called by the framework to navigate to the next (or previous) difference. This will open the content
- * viewer for the next (or previous) diff displayed in the structure viewer.
- *
- * @param next
- * <code>true</code> if we are to open the next structure viewer's diff, <code>false</code> if
- * we should go to the previous instead.
- */
- protected void navigate(boolean next) {
- final Control control = getControl();
- if (control != null && !control.isDisposed()) {
- final ICompareNavigator navigator = getCompareConfiguration().getContainer().getNavigator();
- if (navigator instanceof CompareNavigator && ((CompareNavigator)navigator).hasChange(next)) {
- navigator.selectChange(next);
- }
- }
- }
-
- /**
- *
- */
- protected abstract void copyDiff(boolean leftToRight);
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#handleResizeAncestor(int, int, int, int)
- */
- @Override
- protected void handleResizeAncestor(int x, int y, int width, int height) {
- if (width > 0) {
- getAncestorMergeViewer().getControl().setVisible(true);
- getAncestorMergeViewer().getControl().setBounds(x, y, width, height);
- } else {
- getAncestorMergeViewer().getControl().setVisible(false);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#handleResizeLeftRight(int, int, int,
- * int, int, int)
- */
- @Override
- protected void handleResizeLeftRight(int x, int y, int width1, int centerWidth, int width2, int height) {
- fLeft.getControl().setBounds(x, y, width1, height);
- fRight.getControl().setBounds(x + width1 + centerWidth, y, width2, height);
- }
-
- protected abstract AbstractEditPartMergeViewer createMergeViewer(Composite parent, MergeViewerSide side,
- DiagramCompareContentMergeViewer master);
-
- @Override
- protected final int getCenterWidth() {
- return CENTER_WIDTH;
- }
-
- protected final CompareHandlerService getHandlerService() {
- return (CompareHandlerService)fDynamicObject.get(HANDLER_SERVICE);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getControl()
- */
- @Override
- public Composite getControl() {
- return (Composite)super.getControl();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#createCenterControl(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createCenterControl(Composite parent) {
- final Control ret = super.createCenterControl(parent);
-
- final PaintListener paintListener = new PaintListener() {
- public void paintControl(PaintEvent e) {
- paintCenter(e.gc);
- }
- };
- ret.addPaintListener(paintListener);
-
- ret.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- ret.removePaintListener(paintListener);
- }
- });
-
- return ret;
- }
-
- protected abstract void paintCenter(GC g);
-
- /**
- * @return the fAncestor
- */
- public AbstractEditPartMergeViewer getAncestorMergeViewer() {
- return fAncestor;
- }
-
- /**
- * @return the fLeft
- */
- public AbstractEditPartMergeViewer getLeftMergeViewer() {
- return fLeft;
- }
-
- /**
- * @return the fRight
- */
- public AbstractEditPartMergeViewer getRightMergeViewer() {
- return fRight;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- if (fSyncingSelections.compareAndSet(false, true)) { // prevents stack overflow :)
- try {
- ISelectionProvider selectionProvider = event.getSelectionProvider();
- ISelection selection = event.getSelection();
- synchronizeSelection(selectionProvider, selection);
- updateToolItems();
- } finally {
- fSyncingSelections.set(false);
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#updateToolItems()
- */
- @Override
- protected void updateToolItems() {
- super.updateToolItems();
-
- Diff diff = getDiffFrom(getRightMergeViewer());
- if (diff == null) {
- diff = getDiffFrom(getLeftMergeViewer());
- }
- boolean enableCopy = false;
- if (diff != null) {
- enableCopy = true;
- }
-
- if (fCopyDiffLeftToRightItem != null) {
- fCopyDiffLeftToRightItem.getAction().setEnabled(enableCopy);
- }
- if (fCopyDiffRightToLeftItem != null) {
- fCopyDiffRightToLeftItem.getAction().setEnabled(enableCopy);
- }
- }
-
- /**
- * Checks the element selected in the given viewer in order to determine whether it can be adapted into a
- * Diff.
- *
- * @param viewer
- * The viewer which selection is to be checked.
- * @return The first of the Diffs selected in the given viewer, if any.
- */
- protected Diff getDiffFrom(AbstractEditPartMergeViewer viewer) {
- Diff diff = null;
- final ISelection selection = viewer.getSelection();
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
- final Iterator<?> selectedElements = ((IStructuredSelection)selection).iterator();
- while (diff == null && selectedElements.hasNext()) {
- final Object element = selectedElements.next();
- if (element instanceof GraphicalEditPart
- && ((GraphicalEditPart)element).getModel() instanceof EObject) {
- final List<Diff> diffs = getComparison().getDifferences(
- (EObject)((GraphicalEditPart)element).getModel());
- if (!diffs.isEmpty()) {
- diff = diffs.get(0);
- }
- }
- }
- }
- return diff;
- }
-
- private void synchronizeSelection(final ISelectionProvider selectionProvider, final ISelection selection) {
- if (selectionProvider == fLeft) {
- fRight.setSelection(selection);
- fAncestor.setSelection(selection);
- } else if (selectionProvider == fRight) {
- fLeft.setSelection(selection);
- fAncestor.setSelection(selection);
- } else { // selectionProvider == fAncestor
- fLeft.setSelection(selection);
- fRight.setSelection(selection);
- }
- }
-
- /**
- * Implementation of the model content provider for the GMF comparison.
- *
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
- */
- protected class GMFModelContentMergeContentProvider extends TreeContentMergeViewerContentProvider {
-
- public GMFModelContentMergeContentProvider(CompareConfiguration cc, Comparison comparison) {
- super(cc, comparison);
- }
-
- @Override
- public void saveLeftContent(Object input, byte[] bytes) {
- // unnannotateSide(DifferenceSource.LEFT);
- // unnannotateSide(DifferenceSource.RIGHT);
- super.saveLeftContent(input, bytes);
- }
-
- @Override
- public void saveRightContent(Object input, byte[] bytes) {
- // unnannotateSide(DifferenceSource.LEFT);
- // unnannotateSide(DifferenceSource.RIGHT);
- super.saveRightContent(input, bytes);
- }
-
- }
-
- public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
- if (adapter == CompareHandlerService.class) {
- return getHandlerService();
- }
- if (adapter == CompareHandlerService[].class) {
- return new CompareHandlerService[] {getHandlerService(), };
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
index 30cda9a3e..e831c6723 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramContentMergeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,67 +12,75 @@ package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagr
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
+import static com.google.common.base.Predicates.or;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.onFeature;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.valueIs;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.EventObject;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.ResourceBundle;
import org.eclipse.compare.CompareConfiguration;
-import org.eclipse.draw2d.FreeformLayeredPane;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Polyline;
+import org.eclipse.draw2d.PolylineConnection;
+import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.DifferenceSource;
+import org.eclipse.emf.compare.DifferenceState;
import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.NodeChange;
-import org.eclipse.emf.compare.diagram.ide.ui.AbstractEditPartMergeViewer;
-import org.eclipse.emf.compare.diagram.ide.ui.AbstractGraphicalMergeViewer;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.DeleteGhostImageFigure;
+import org.eclipse.emf.compare.command.impl.CopyCommand;
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramDiffAccessor;
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor;
-import org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.DiagramCompareContentMergeViewer;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.domain.ICompareEditingDomain;
import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
+import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.tree.TreeContentMergeViewerContentProvider;
-import org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider.DiffNode;
+import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.RedoAction;
+import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.UndoAction;
+import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer;
import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
+import org.eclipse.emf.compare.utils.DiffUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.emf.transaction.TransactionalCommandStack;
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.LayerConstants;
+import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
import org.eclipse.gef.editparts.LayerManager;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
import org.eclipse.gmf.runtime.notation.BasicCompartment;
import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.Edge;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
/**
* Specialized {@link org.eclipse.compare.contentmergeviewer.ContentMergeViewer} that uses
@@ -80,829 +88,1781 @@ import org.eclipse.swt.widgets.Display;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class DiagramContentMergeViewer extends DiagramCompareContentMergeViewer {
-
- private Map<IFigure, Phantom> phantomsMap = new HashMap<IFigure, Phantom>();
-
- private Map<IFigure, IFigure> containerMap = new HashMap<IFigure, IFigure>();
-
- private Map<IFigure, Integer> phantomSelection = new HashMap<IFigure, Integer>();
+public class DiagramContentMergeViewer extends EMFCompareContentMergeViewer {
/**
- * Bundle name of the property file containing all displayed strings.
+ * Interface for the management of decorators.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
- private static final String BUNDLE_NAME = DiagramContentMergeViewer.class.getName();
+ private interface IDecoratorManager {
- /**
- * The {@link org.eclipse.emf.common.notify.AdapterFactory} used to create
- * {@link AdapterFactoryContentProvider} and {@link AdapterFactoryLabelProvider} for ancestor, left and
- * right {@link org.eclipse.jface.viewers.TreeViewer}.
- */
- private final ComposedAdapterFactory fAdapterFactory;
+ /**
+ * It hides the revealed decorators.
+ */
+ void hideAll();
- /**
- * Creates a new {@link DiagramContentMergeViewer} by calling the super constructor with the given
- * parameters.
- * <p>
- * It calls {@link #buildControl(Composite)} as stated in its javadoc.
- * <p>
- * It sets a {@link TreeContentMergeViewerContentProvider specific}
- * {@link #setContentProvider(org.eclipse.jface.viewers.IContentProvider) content provider} to properly
- * display ancestor, left and right parts.
- *
- * @param parent
- * the parent composite to build the UI in
- * @param config
- * the {@link CompareConfiguration}
- */
- public DiagramContentMergeViewer(Composite parent, CompareConfiguration config) {
- super(parent, SWT.NONE, ResourceBundle.getBundle(BUNDLE_NAME), config);
- fAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- fAdapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
- fAdapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+ /**
+ * From a given difference, it hides the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ void hideDecorators(Diff difference);
- buildControl(parent);
- setContentProvider(new GMFModelContentMergeContentProvider(config, fComparison));
+ /**
+ * From a given difference, it reveals the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ void revealDecorators(Diff difference);
}
/**
- * {@inheritDoc}
+ * Decorator manager to create, hide or reveal decorator figures related to deleted or added graphical
+ * objects.
*
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
- @Override
- protected void handleDispose(DisposeEvent event) {
- fAdapterFactory.dispose();
- super.handleDispose(event);
- }
+ private abstract class AbstractDecoratorManager implements IDecoratorManager {
+
+ /**
+ * Decorator represented by a <code>figure</code> on a <code>layer</code>, from the given
+ * <code>side</code> of the merge viewer. An edit part may be linked to the <code>figure</code> in
+ * some cases.<br>
+ * The decorator is related to a <code>difference</code> and it is binded with the reference view and
+ * figure.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ protected abstract class AbstractDecorator {
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getAncestorMergeViewer()
- */
- @SuppressWarnings("unchecked")
- // see createMergeViewer() to see it is safe
- @Override
- public AbstractGraphicalMergeViewer getAncestorMergeViewer() {
- return (AbstractGraphicalMergeViewer)super.getAncestorMergeViewer();
- }
+ /** The reference <code>View</code> for this decorator. */
+ protected View fOriginView;
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getLeftMergeViewer()
- */
- @SuppressWarnings("unchecked")
- // see createMergeViewer() to see it is safe
- @Override
- public AbstractGraphicalMergeViewer getLeftMergeViewer() {
- return (AbstractGraphicalMergeViewer)super.getLeftMergeViewer();
- }
+ /** The reference <code>IFigure</code> for this phantom. */
+ protected IFigure fOriginFigure;
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getRightMergeViewer()
- */
- @SuppressWarnings("unchecked")
- // see createMergeViewer() to see it is safe
- @Override
- public AbstractGraphicalMergeViewer getRightMergeViewer() {
- return (AbstractGraphicalMergeViewer)super.getRightMergeViewer();
- }
+ /** The <code>IFigure</code> representing this phantom. */
+ protected IFigure fFigure;
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#copyDiff(boolean)
- */
- @Override
- protected void copyDiff(boolean leftToRight) {
- /*
- * FIXME change this! For the moment we always do a new setInput() on the content viewer whenever we
- * select a Diagram Difference. This is meant to change so that we use selection synchronization
- * instead. This code will break whenever we implement that change.
- */
- if (getInput() instanceof DiffNode) {
- final Command command = getEditingDomain().createCopyCommand(((DiffNode)getInput()).getTarget(),
- leftToRight, EMFCompareIDEPlugin.getDefault().getMergerRegistry());
- getEditingDomain().getCommandStack().execute(command);
+ /** The layer on which the <code>figure</code> has to be drawn. */
+ protected IFigure fLayer;
- if (leftToRight) {
- setRightDirty(true);
- } else {
- setLeftDirty(true);
+ /** The side of the merge viewer on which the <code>figure</code> has to be drawn. */
+ protected MergeViewerSide fSide;
+
+ /** The difference related to this phantom. */
+ protected Diff fDifference;
+
+ /** The edit part of the figure representing this phantom. May be null. */
+ protected EditPart fEditPart;
+
+ /**
+ * Getter.
+ *
+ * @return the originView {@link Phantom#fOriginView}.
+ */
+ public View getOriginView() {
+ return fOriginView;
}
- refresh();
- return;
- }
- final IStructuredSelection selection;
- if (leftToRight) {
- selection = (IStructuredSelection)getLeftMergeViewer().getSelection();
- } else {
- selection = (IStructuredSelection)getRightMergeViewer().getSelection();
- }
- Object firstElement = selection.getFirstElement();
+ /**
+ * Setter.
+ *
+ * @param originView
+ * {@link Phantom#fOriginView}.
+ */
+ public void setOriginView(View originView) {
+ this.fOriginView = originView;
+ }
- if (firstElement instanceof GraphicalEditPart) {
- Object elt = ((GraphicalEditPart)firstElement).getModel();
- if (elt instanceof EObject) {
- List<Diff> differences = getComparison().getDifferences((EObject)elt);
+ /**
+ * Getter.
+ *
+ * @return the originFigure {@link Phantom#fOriginFigure}.
+ */
+ public IFigure getOriginFigure() {
+ return fOriginFigure;
+ }
- final Command command = getEditingDomain().createCopyAllNonConflictingCommand(differences,
- leftToRight, EMFCompareIDEPlugin.getDefault().getMergerRegistry());
- getEditingDomain().getCommandStack().execute(command);
+ /**
+ * Setter.
+ *
+ * @param originFigure
+ * {@link Phantom#fOriginFigure}.
+ */
+ public void setOriginFigure(IFigure originFigure) {
+ this.fOriginFigure = originFigure;
+ }
- if (leftToRight) {
- setRightDirty(true);
- } else {
- setLeftDirty(true);
- }
- refresh();
+ /**
+ * Getter.
+ *
+ * @return the figure {@link Phantom#fFigure}.
+ */
+ public IFigure getFigure() {
+ return fFigure;
}
- }
- }
+ /**
+ * Setter.
+ *
+ * @param figure
+ * {@link Phantom#fFigure}.
+ */
+ public void setFigure(IFigure figure) {
+ this.fFigure = figure;
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getContents(boolean)
- */
- @Override
- protected byte[] getContents(boolean left) {
- return null;
- }
+ /**
+ * Getter.
+ *
+ * @return the layer {@link Phantom#fLayer}.
+ */
+ public IFigure getLayer() {
+ return fLayer;
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#createMergeViewer(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected AbstractEditPartMergeViewer createMergeViewer(final Composite parent, MergeViewerSide side,
- DiagramCompareContentMergeViewer master) {
- final DiagramMergeViewer mergeTreeViewer = new DiagramMergeViewer(parent, side);
- return mergeTreeViewer;
- }
+ /**
+ * Setter.
+ *
+ * @param layer
+ * {@link Phantom#fLayer}.
+ */
+ public void setLayer(IFigure layer) {
+ this.fLayer = layer;
+ }
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#paintCenter(org.eclipse.swt.widgets.Canvas,
- * org.eclipse.swt.graphics.GC)
- */
- @Override
- protected void paintCenter(GC g) {
+ /**
+ * Getter.
+ *
+ * @return the side {@link Phantom#fSide}.
+ */
+ public MergeViewerSide getSide() {
+ return fSide;
+ }
- }
+ /**
+ * Setter.
+ *
+ * @param side
+ * {@link Phantom#fSide}.
+ */
+ public void setSide(MergeViewerSide side) {
+ this.fSide = side;
+ }
- private class Phantom {
- public IFigure figure;
+ /**
+ * Getter.
+ *
+ * @return the difference {@link Phantom#fDifference}.
+ */
+ public Diff getDifference() {
+ return fDifference;
+ }
- public IFigure layer;
+ /**
+ * Setter.
+ *
+ * @param difference
+ * {@link Phantom#fDifference}.
+ */
+ public void setDifference(Diff difference) {
+ this.fDifference = difference;
+ }
+
+ /**
+ * Getter.
+ *
+ * @return the editPart {@link Phantom#fEditPart}.
+ */
+ public EditPart getEditPart() {
+ return fEditPart;
+ }
+
+ /**
+ * Setter.
+ *
+ * @param editPart
+ * {@link Phantom#fEditPart}.
+ */
+ public void setEditPart(EditPart editPart) {
+ this.fEditPart = editPart;
+ }
- public Phantom(IFigure figure, IFigure layer) {
- this.figure = figure;
- this.layer = layer;
}
- }
- private Predicate<Diff> diffsForPhantoms = and(ofKind(DifferenceKind.DELETE),
- instanceOf(NodeChange.class));
+ /**
+ * From a given difference, it hides the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ public void hideDecorators(Diff difference) {
+ List<? extends AbstractDecorator> oldDecorators = getDecorators(difference);
+ if (oldDecorators != null && !oldDecorators.isEmpty() && getComparison() != null) {
+ handleDecorators(oldDecorators, false, true);
+ }
+ }
- @Override
- protected void updateContent(Object ancestor, Object left, Object right) {
- // TODO: To Fix the problem to locate ghost figures
- // TODO: To test multi-diagrams to clean phantoms
- // TODO: To manage the edge cases for phantoms (display the same figures (composing the edge) but in
- // red color)
- // TODO: To change decorators (to take off the icons (+ for adds) and use the same decoration as
- // changes for moves)
- super.updateContent(ancestor, left, right);
-
- // FIXME: Alternative solution (start of implementation) to correctly manage the position of ghost
- // figures.
- // if (left instanceof IDiagramNodeAccessor) {
- //
- // IDiagramNodeAccessor input = (IDiagramNodeAccessor)left;
- // Comparison comparison = input.getComparison();
- //
- // PhantomsManager manager = new PhantomsManager();
- // manager.initCacheFigures(comparison);
- // manager.initPhantoms(comparison, Collections2.filter(input.getAllDiffs(), diffsForPhantoms));
- // manager.attachPhantoms();
- //
- // }
-
- if (left instanceof IDiagramNodeAccessor) {
- IDiagramNodeAccessor input = (IDiagramNodeAccessor)left;
-
- Collection<Diff> deleteDiffs = Collections2.filter(input.getAllDiffs(), diffsForPhantoms);
-
- // *** BEGIN first solution ***
- // FIXME: In some cases (o.e.e.c.d.ide.ui.papyrus.tests/NodeChange/a9) the position of the ghost
- // is outside the visible containing figure.
- // You have to create the hierarchy of figures between the visible one and the new ghost figure.
- // For that, you have to map all the figures from every side (see alternative solution).
- if (phantomsMap.isEmpty()) {
-
- fLeft.flush();
- ((DiagramMergeViewer)fLeft).getGraphicalViewer().flush();
- fRight.flush();
- ((DiagramMergeViewer)fRight).getGraphicalViewer().flush();
- fAncestor.flush();
- ((DiagramMergeViewer)fAncestor).getGraphicalViewer().flush();
-
- // Create phantoms -> cache them and their possible container
- Iterator<Diff> itDeleteDiffs = deleteDiffs.iterator();
- while (itDeleteDiffs.hasNext()) {
-
- DiagramDiff diff = (DiagramDiff)itDeleteDiffs.next();
-
- View viewRef = (View)diff.getView();
- IFigure ref = getReferenceFigureValue(input.getComparison(), diff);
- Diagram diagram = viewRef.getDiagram();
-
- MergeViewerSide targetSide = getTargetSide(input.getComparison(), viewRef);
- Diagram targetDiagram = (Diagram)getMatchView(input.getComparison(), diagram, targetSide);
- DiagramMergeViewer targetViewer = getViewer(targetSide);
-
- IFigure targetLayer = LayerManager.Helper.find(targetViewer.getEditPart(targetDiagram))
- .getLayer(LayerConstants.SCALABLE_LAYERS);
-
- IFigure ghost = createGhostFigure(ref, targetSide,
- viewRef.eContainer() instanceof BasicCompartment);
- phantomsMap.put(ref, new Phantom(ghost, targetLayer));
-
- View parentViewRef = (View)getMatchView(diff.getMatch(), getSide(input.getComparison(),
- viewRef));
-
- if (parentViewRef != null) {
- IFigure parentRefFigure = getFigure(input.getComparison(), parentViewRef);
- View parentTargetView = (View)getMatchView(diff.getMatch(), getSide(diff));
- if (parentTargetView != null) {
- IFigure parentTargetFigure = getFigure(input.getComparison(), parentTargetView);
- containerMap.put(parentRefFigure, parentTargetFigure);
- }
- }
+ /**
+ * From a given difference, it reveals the related decorators.
+ *
+ * @param difference
+ * The difference.
+ */
+ public void revealDecorators(Diff difference) {
- }
+ List<? super AbstractDecorator> decorators = (List<? super AbstractDecorator>)getDecorators(difference);
- // Iterate on cache to attach phantoms on the correct figures
- for (Entry<IFigure, Phantom> entry : phantomsMap.entrySet()) {
- IFigure ref = entry.getKey();
-
- Phantom target = entry.getValue();
- IFigure ghost = target.figure;
- IFigure targetLayer = target.layer;
-
- IFigure parentGhost = findMatchingParentGhost(ref);
- if (parentGhost != null) {
- addToParent(ref, ghost, parentGhost);
- } else {
- IFigure parent = findMatchingParent(ref);
- if (parent != null) {
- addToParent(ref, ghost, parent);
- } else {
- targetLayer.add(ghost);
- }
- }
- }
- }
- // *** END first solution ***
+ // Create phantoms only if they do not already exist and if the related difference is an ADD or
+ // DELETE
+ if ((decorators == null || decorators.isEmpty()) && isGoodCandidate(difference)) {
- // reset phantom selections
- resetPhantomSelections();
+ DiagramDiff diagramDiff = (DiagramDiff)difference;
- // set phantom selections
- if (input instanceof IDiagramDiffAccessor) {
- IFigure figureRef = getReferenceFigure(input.getComparison(),
- (View)((IDiagramDiffAccessor)left).getDiff().getView());
+ List<View> referenveViews = getReferenceViews(diagramDiff);
- Phantom target = phantomsMap.get(figureRef);
- if (target != null) {
+ for (View referenceView : referenveViews) {
+ IFigure referenceFigure = getFigure(referenceView);
- int oldLineWidth = ((Shape)target.figure).getLineWidth();
+ if (referenceFigure != null) {
+ MergeViewerSide targetSide = getTargetSide(getComparison().getMatch(referenceView),
+ referenceView);
- // save its line width
- phantomSelection.put(target.figure, oldLineWidth);
+ if (decorators == null) {
+ decorators = new ArrayList();
+ }
- // enhance its line width
- ((Shape)target.figure).setLineWidth(oldLineWidth + 2);
+ decorators.add(createAndRegisterDecorator(difference, referenceView, referenceFigure,
+ targetSide));
+ }
}
- }
- }
- }
-
- private void addToParent(IFigure ref, IFigure ghost, IFigure parent) {
- parent.add(ghost);
- Rectangle copyRef = ref.getBounds().getCopy();
- ref.getParent().translateToAbsolute(copyRef);
- ghost.setBounds(copyRef);
- }
+ }
- private void resetPhantomSelections() {
- for (Entry<IFigure, Integer> entry : phantomSelection.entrySet()) {
- IFigure fig = entry.getKey();
- int oldValue = entry.getValue();
- ((Shape)fig).setLineWidth(oldValue);
+ // The selected difference is an ADD or DELETE and decorators exist for it
+ if (decorators != null && !decorators.isEmpty()) {
+ revealDecorators((List<? extends AbstractDecorator>)decorators);
+ }
}
- phantomSelection.clear();
- }
-
- private IFigure getReferenceFigureValue(Comparison comparison, DiagramDiff diff) {
- View viewRef = (View)diff.getView();
- return getReferenceFigure(comparison, viewRef);
- }
- private MergeViewerSide getTargetSide(Comparison comparison, View viewRef) {
- Match matchViewRef = comparison.getMatch(viewRef);
- // looking for null side
- MergeViewerSide side = null;
- if (matchViewRef.getLeft() == null) {
- side = MergeViewerSide.LEFT;
- } else {
- side = MergeViewerSide.RIGHT;
+ /**
+ * It reveals the given decorators.
+ *
+ * @param decorators
+ * The main decorators.
+ */
+ protected void revealDecorators(List<? extends AbstractDecorator> decorators) {
+ handleDecorators(decorators, true, true);
}
- return side;
- }
+ /**
+ * Get the figure related to the given view.
+ *
+ * @param view
+ * The view.
+ * @return the figure.
+ */
+ protected IFigure getFigure(View view) {
+ MergeViewerSide side = getSide(view);
+ GraphicalEditPart originEditPart = (GraphicalEditPart)getViewer(side).getEditPart(view);
+ if (originEditPart != null) {
+ return originEditPart.getFigure();
+ }
+ return null;
+ }
- private IFigure findMatchingParentGhost(IFigure figure) {
- IFigure parent = figure.getParent();
- if (parent != null) {
- Phantom parentTarget = phantomsMap.get(parent);
- if (parentTarget == null) {
- return findMatchingParentGhost(parent);
- } else {
- return parentTarget.figure;
+ /**
+ * It manages the display of the given decorators.
+ *
+ * @param decorators
+ * The decorators to handle.
+ * @param isAdd
+ * True if it has to be revealed, False otherwise.
+ * @param areMain
+ * It indicates if the given decorators to handle are considered as the main ones (the ones
+ * directly linked to the selected difference).
+ */
+ protected void handleDecorators(List<? extends AbstractDecorator> decorators, boolean isAdd,
+ boolean areMain) {
+ for (AbstractDecorator decorator : decorators) {
+ handleDecorator(decorator, isAdd, areMain);
}
}
- return parent;
- }
- private IFigure findMatchingParent(IFigure figure) {
- IFigure parent = figure.getParent();
- if (parent != null) {
- IFigure parentTarget = containerMap.get(parent);
- if (parentTarget == null) {
- return findMatchingParent(parent);
+ /**
+ * It manages the display of the given decorator.
+ *
+ * @param decorator
+ * The decorator to handle.
+ * @param isAdd
+ * True if it has to be revealed, False otherwise.
+ * @param isMain
+ * It indicates if the given decorator to handle is considered as the main one (the one
+ * directly linked to the selected difference).
+ */
+ protected void handleDecorator(AbstractDecorator decorator, boolean isAdd, boolean isMain) {
+ IFigure layer = decorator.getLayer();
+ IFigure figure = decorator.getFigure();
+ EditPart editpart = decorator.getEditPart();
+ if (editpart == null) {
+ if (isAdd && !layer.getChildren().contains(figure)) {
+ handleAddDecorator(decorator, layer, figure, isMain);
+ } else if (layer.getChildren().contains(figure)) {
+ handleDeleteDecorator(decorator, layer, figure, isMain);
+ }
} else {
- return parentTarget;
+ if (isAdd && !editpart.isActive()) {
+ editpart.activate();
+ handleAddDecorator(decorator, layer, figure, isMain);
+ } else if (editpart.isActive()) {
+ editpart.deactivate();
+ handleDeleteDecorator(decorator, layer, figure, isMain);
+ }
}
+
}
- return parent;
- }
- private DiagramMergeViewer getViewer(MergeViewerSide side) {
- switch (side) {
- case LEFT:
- return (DiagramMergeViewer)fLeft;
- case RIGHT:
- return (DiagramMergeViewer)fRight;
- case ANCESTOR:
- return (DiagramMergeViewer)fAncestor;
- default:
- return null;
+ /**
+ * It manages the reveal of the given decorator.
+ *
+ * @param decorator
+ * The decorator.
+ * @param parent
+ * The parent figure which has to get the figure to reveal (<code>toAdd</code>)
+ * @param toAdd
+ * The figure to reveal.
+ * @param isMain
+ * It indicates if the given decorator to reveal is considered as the main one (the one
+ * directly linked to the selected difference).
+ */
+ protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
+ boolean isMain) {
+ parent.add(toAdd);
}
- }
- private EObject getMatchView(Comparison comparison, View view, MergeViewerSide side) {
- Match match = comparison.getMatch(view);
- return getMatchView(match, side);
- }
+ /**
+ * It manages the hiding of the given decorator.
+ *
+ * @param decorator
+ * The decorator.
+ * @param parent
+ * The parent figure which has to get the figure to hide (<code>toDelete</code>)
+ * @param toDelete
+ * The figure to hide.
+ * @param isMain
+ * It indicates if the given decorator to hide is considered as the main one (the one
+ * directly linked to the selected difference).
+ */
+ protected void handleDeleteDecorator(AbstractDecorator decorator, IFigure parent, IFigure toDelete,
+ boolean isMain) {
+ parent.remove(toDelete);
+ }
- private EObject getMatchView(Match match, MergeViewerSide side) {
- switch (side) {
- case LEFT:
- return match.getLeft();
- case RIGHT:
- return match.getRight();
- case ANCESTOR:
- return match.getOrigin();
- default:
- return null;
+ /**
+ * It checks if the given difference is a good candidate to manage decorators.<br>
+ *
+ * @see {@link PhantomManager#goodCandidate()}.
+ * @param difference
+ * The difference.
+ * @return True if it is a good candidate, False otherwise.
+ */
+ private boolean isGoodCandidate(Diff difference) {
+ return goodCandidate().apply(difference);
}
- }
- private IFigure getReferenceFigure(Comparison comparison, View view) {
- MergeViewerSide originSide = null;
- if (getMatchView(comparison, view, MergeViewerSide.ANCESTOR) != null) {
- originSide = MergeViewerSide.ANCESTOR;
- } else {
- Match match = comparison.getMatch(view);
- if (match.getLeft() != null) {
- originSide = MergeViewerSide.LEFT;
+ /**
+ * Get the layer on the given side, from the reference view.<br>
+ *
+ * @see @ link PhantomManager#getIDLayer(View)} .
+ * @param referenceView
+ * The reference view.
+ * @param side
+ * The side where the layer has to be found.
+ * @return The layer figure.
+ */
+ protected IFigure getLayer(View referenceView, MergeViewerSide side) {
+ Diagram referenceDiagram = referenceView.getDiagram();
+ Diagram targetDiagram = (Diagram)getMatchView(referenceDiagram, side);
+ DiagramMergeViewer targetViewer = getViewer(side);
+ IFigure targetLayer = LayerManager.Helper.find(targetViewer.getEditPart(targetDiagram)).getLayer(
+ getIDLayer(referenceView));
+ return targetLayer;
+ }
+
+ /**
+ * Get the layer ID to use from the reference view.<br>
+ * If the reference view is an edge, it is the {@link LayerConstants.CONNECTION_LAYER} which is used,
+ * {@link LayerConstants.SCALABLE_LAYERS} otherwise.
+ *
+ * @param referenceView
+ * The reference view.
+ * @return The ID of te layer.
+ */
+ protected Object getIDLayer(View referenceView) {
+ if (referenceView instanceof Edge) {
+ return LayerConstants.CONNECTION_LAYER;
} else {
- originSide = MergeViewerSide.RIGHT;
+ return LayerConstants.SCALABLE_LAYERS;
}
}
- EObject origin = getMatchView(comparison, view, originSide);
+ /**
+ * It translates the coordinates of the given bounds, from the reference figure and the root of this
+ * one, to absolute coordinates.
+ *
+ * @param referenceFigure
+ * The reference figure.
+ * @param rootReferenceFigure
+ * The root of the reference figure.
+ * @param boundsToTranslate
+ * The bounds to translate.
+ */
+ protected void translateCoordinates(IFigure referenceFigure, IFigure rootReferenceFigure,
+ Rectangle boundsToTranslate) {
+ IFigure referenceParentFigure = referenceFigure.getParent();
+ if (referenceParentFigure != null && referenceFigure != rootReferenceFigure) {
+ if (referenceParentFigure.isCoordinateSystem()) {
+ boundsToTranslate.x += referenceParentFigure.getBounds().x;
+ boundsToTranslate.y += referenceParentFigure.getBounds().y;
+ }
+ translateCoordinates(referenceParentFigure, rootReferenceFigure, boundsToTranslate);
+ }
+ }
- if (origin instanceof View) {
+ /**
+ * Get the predicate to know the differences concerned by the display of decorators.
+ *
+ * @return The predicate.
+ */
+ protected abstract Predicate<Diff> goodCandidate();
+
+ /**
+ * Get the views which have to be used as reference to build the related decorators from the given
+ * difference of the value concerned by the difference.<br>
+ *
+ * @param difference
+ * The difference.
+ * @return The list of reference views.
+ */
+ protected abstract List<View> getReferenceViews(DiagramDiff difference);
+
+ /**
+ * Get the side where decorators have to be drawn, according to the given reference view and its
+ * match.<br>
+ *
+ * @param match
+ * The match of the reference view.
+ * @param referenceView
+ * The reference view.
+ * @return The side for phantoms.
+ */
+ protected abstract MergeViewerSide getTargetSide(Match match, View referenceView);
+
+ /**
+ * It creates new decorators and registers them.
+ *
+ * @param diff
+ * The related difference used as index for the main decorator.
+ * @param referenceView
+ * The reference view as base for creation of the decorator.
+ * @param referenceFigure
+ * The reference figure as base for creation of the decorator.
+ * @param targetSide
+ * The side where the decorator has to be created.
+ * @return The list of main decorators.
+ */
+ protected abstract AbstractDecorator createAndRegisterDecorator(Diff diff, View referenceView,
+ IFigure referenceFigure, MergeViewerSide targetSide);
+
+ /**
+ * Get the main decorators related to the given difference.
+ *
+ * @param difference
+ * The difference.
+ * @return The list of main decorators.
+ */
+ protected abstract List<? extends AbstractDecorator> getDecorators(Diff difference);
- return getFigure(comparison, (View)origin);
- }
- return null;
}
- private IFigure getFigure(Comparison comparison, View view) {
- MergeViewerSide side = getSide(comparison, view);
- GraphicalEditPart originEditPart = (GraphicalEditPart)getViewer(side).getEditPart(view);
- return originEditPart.getFigure();
- }
+ /**
+ * Phantom manager to create, hide or reveal phantom figures related to deleted or added graphical
+ * objects.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ private class PhantomManager extends AbstractDecoratorManager {
+
+ /**
+ * Phantom represented by a <code>figure</code> on a <code>layer</code>, from the given
+ * <code>side</code> of the merge viewer. An edit part may be linked to the <code>figure</code> in
+ * some cases.<br>
+ * The phantom is related to a <code>difference</code> and it is binded with the reference view and
+ * figure.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ private class Phantom extends AbstractDecorator {
+
+ /**
+ * Constructor.
+ *
+ * @param layer
+ * {@link Phantom#fLayer}.
+ * @param side
+ * {@link Phantom#fSide}.
+ * @param originView
+ * {@link Phantom#fOriginView}.
+ * @param originFigure
+ * {@link Phantom#fOriginFigure}.
+ * @param diff
+ * {@link Phantom#fDifference}.
+ */
+ public Phantom(IFigure layer, MergeViewerSide side, View originView, IFigure originFigure,
+ Diff diff) {
+ setLayer(layer);
+ setSide(side);
+ setOriginView(originView);
+ setOriginFigure(originFigure);
+ setDifference(diff);
+ }
- private IFigure createGhostFigure(IFigure ref, MergeViewerSide side, boolean isEltOfList) {
+ /**
+ * Get the decorator dependencies of this one. The dependencies are the decorator ancestors plus
+ * the extremities of an edge decorator.
+ *
+ * @return The list of found decorators.
+ */
+ public List<? extends AbstractDecorator> getDependencies() {
+ List<AbstractDecorator> result = new ArrayList<AbstractDecorator>();
+ result.addAll(getAncestors());
+ if (fOriginView instanceof Edge) {
+ View source = ((Edge)fOriginView).getSource();
+ View target = ((Edge)fOriginView).getTarget();
+ result.addAll(getOrCreateRelatedDecorators(source));
+ result.addAll(getOrCreateRelatedDecorators(target));
+ }
+ return result;
+ }
+
+ /**
+ * From the given view, get or create the related phantoms.
+ *
+ * @param referenceView
+ * The given view.
+ * @return The list of phantoms.
+ */
+ private List<Phantom> getOrCreateRelatedDecorators(EObject referenceView) {
+ List<Phantom> result = new ArrayList<Phantom>();
+ Collection<Diff> changes = Collections2.filter(getComparison().getDifferences(referenceView),
+ goodCandidate());
+ for (Diff change : changes) {
+ Phantom phantom = fPhantomRegistry.get(change);
+ if (phantom == null) {
+ IFigure referenceFigure = PhantomManager.this.getFigure((View)referenceView);
+ if (referenceFigure != null) {
+ phantom = createAndRegisterDecorator(change, (View)referenceView,
+ referenceFigure, fSide);
+ }
+ }
+ if (phantom != null) {
+ result.add(phantom);
+ }
+ }
+ return result;
+ }
- Rectangle rect = ref.getBounds().getCopy();
+ /**
+ * Get the ancestor decorators of this one.
+ *
+ * @return The list of the ancestors.
+ */
+ private List<? extends AbstractDecorator> getAncestors() {
+ List<AbstractDecorator> result = new ArrayList<AbstractDecorator>();
+ EObject parentOriginView = fOriginView.eContainer();
+ while (parentOriginView != null) {
+ result.addAll(getOrCreateRelatedDecorators(parentOriginView));
+ parentOriginView = parentOriginView.eContainer();
+ }
+ return result;
+ }
+ }
- IFigure ghost = null;
+ /** Registry of created phantoms, indexed by difference. */
+ private final Map<Diff, Phantom> fPhantomRegistry = new HashMap<Diff, Phantom>();
- if (isEltOfList) {
- ghost = new Polyline();
- ((Polyline)ghost).addPoint(new Point(rect.x, rect.y - 1));
- ((Polyline)ghost).addPoint(new Point(rect.x + rect.width, rect.y - 1));
- ghost.setBackgroundColor(new Color(Display.getCurrent(), new RGB(255, 0, 0)));
- ((Shape)ghost).setLineWidth(2);
- } else {
- ghost = new DeleteGhostImageFigure();
- ghost.setBounds(rect);
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#goodCandidate()<br>
+ * Only the diagram differences ADD or DELETE are concerned by this display.
+ */
+ @Override
+ protected Predicate<Diff> goodCandidate() {
+ return new Predicate<Diff>() {
+ public boolean apply(Diff difference) {
+ return and(instanceOf(DiagramDiff.class),
+ or(ofKind(DifferenceKind.ADD), ofKind(DifferenceKind.DELETE))).apply(difference);
+ }
+ };
}
- rect.performScale(((DiagramRootEditPart)getViewer(side).getGraphicalViewer().getRootEditPart())
- .getZoomManager().getZoom());
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getReferenceViews(org.eclipse.emf.compare.diagram.DiagramDiff)
+ */
+ @Override
+ protected List<View> getReferenceViews(DiagramDiff difference) {
+ List<View> result = new ArrayList<View>();
- ghost.setForegroundColor(new Color(Display.getCurrent(), new RGB(255, 0, 0)));
- ((Shape)ghost).setAlpha(150);
- return ghost;
- }
+ Match match = getComparison().getMatch(difference.getView());
- private MergeViewerSide getSide(Diff diff) {
- if (diff.getSource() == DifferenceSource.LEFT) {
- return MergeViewerSide.LEFT;
- } else {
- return MergeViewerSide.RIGHT;
- }
+ EObject originObj = match.getOrigin();
+ EObject leftObj = match.getLeft();
+ EObject rightObj = match.getRight();
- }
+ if (leftObj instanceof View || rightObj instanceof View) {
+ result.add(getReferenceView((View)originObj, (View)leftObj, (View)rightObj));
+ }
- private MergeViewerSide getSide(Comparison comparison, View view) {
- Match match = comparison.getMatch(view);
- if (match.getLeft() == view) {
- return MergeViewerSide.LEFT;
- } else if (match.getRight() == view) {
- return MergeViewerSide.RIGHT;
- } else if (match.getOrigin() == view) {
- return MergeViewerSide.ANCESTOR;
- } else {
- return null;
+ return result;
}
- }
-
- // *** BEGIN alternative developing solution ***
- final class PhantomsManager {
- /** */
- private Map<IFigure, MatchFigure> relevantFigures = new HashMap<IFigure, MatchFigure>();
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getTargetSide(org.eclipse.emf.compare.Match,
+ * org.eclipse.gmf.runtime.notation.View)<br>
+ * If the left object is null, a phantom should be drawn instead. Else, it means that the right
+ * object is null and a phantom should be displayed on the right side.
+ */
+ @Override
+ protected MergeViewerSide getTargetSide(Match match, View referenceView) {
+ MergeViewerSide targetSide = null;
+ if (match.getLeft() == null) {
+ targetSide = MergeViewerSide.LEFT;
+ } else {
+ targetSide = MergeViewerSide.RIGHT;
+ }
+ return targetSide;
+ }
- private List<MatchFigure> matchedFigures = new ArrayList<MatchFigure>();
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#createAndRegisterDecorator(org.eclipse.emf.compare.Diff,
+ * org.eclipse.gmf.runtime.notation.View, org.eclipse.draw2d.IFigure,
+ * org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
+ */
+ @Override
+ protected Phantom createAndRegisterDecorator(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide targetSide) {
+ Phantom phantom = createPhantom(diff, referenceView, referenceFigure, targetSide);
+ fPhantomRegistry.put(diff, phantom);
+ return phantom;
+ }
- private Map<IFigure, IFigure> phantoms = new HashMap<IFigure, IFigure>();
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getDecorators(org.eclipse.emf.compare.Diff)
+ */
+ @Override
+ protected List<Phantom> getDecorators(Diff difference) {
+ List<Phantom> result = new ArrayList<DiagramContentMergeViewer.PhantomManager.Phantom>();
+ Phantom phantom = fPhantomRegistry.get(difference);
+ if (phantom != null) {
+ result.add(phantom);
+ }
+ return result;
+ }
- public void initCacheFigures(Comparison comparison) {
- List<Match> matches = getAllMatches(comparison);
- for (Match match : matches) {
- createMatchFigure(match);
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#handleDecorator(org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager.AbstractDecorator,
+ * boolean)
+ */
+ @Override
+ protected void handleDecorator(AbstractDecorator decorator, boolean isAdd, boolean isMain) {
+ super.handleDecorator(decorator, isAdd, isMain);
+ // Display the dependencies (context) of this decorator
+ for (AbstractDecorator ancestor : ((Phantom)decorator).getDependencies()) {
+ super.handleDecorator(ancestor, isAdd, false);
}
- // Add glue to the figures
- for (MatchFigure matchFigure : matchedFigures) {
- createParentMatchFigures(matchFigure);
+ }
+
+ @Override
+ protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
+ boolean isMain) {
+ super.handleAddDecorator(decorator, parent, toAdd, isMain);
+ // Set the highlight of the figure
+ Color strokeColor = null;
+ if (isMain) {
+ ((Shape)toAdd).setLineWidth(((Shape)toAdd).getLineWidth() + 1);
+ strokeColor = getCompareColor().getStrokeColor(decorator.getDifference(), isThreeWay(),
+ false, true);
+ // figure.setBorder(new FocusBorder());
+
+ // FIXME: Find a way to set the focus on this figure.
+ getViewer(decorator.getSide()).getGraphicalViewer().reveal(toAdd);
+ } else {
+ strokeColor = getCompareColor().getStrokeColor(decorator.getDifference(), isThreeWay(),
+ false, false);
+
}
+ toAdd.setForegroundColor(strokeColor);
}
- public void initPhantoms(Comparison comparison, Collection<Diff> deleteDifferences) {
- Iterator<Diff> itDeleteDiffs = deleteDifferences.iterator();
- while (itDeleteDiffs.hasNext()) {
+ @Override
+ protected void handleDeleteDecorator(AbstractDecorator decorator, IFigure parent, IFigure toDelete,
+ boolean isMain) {
+ super.handleDeleteDecorator(decorator, parent, toDelete, isMain);
+ // Re-initialize the highlight of the figure
+ if (isMain) {
+ ((Shape)toDelete).setLineWidth(((Shape)toDelete).getLineWidth() - 1);
+ Color strokeColor = getCompareColor().getStrokeColor(decorator.getDifference(), isThreeWay(),
+ false, false);
+ toDelete.setForegroundColor(strokeColor);
+ // figure.setBorder(null);
+ }
+ }
- DiagramDiff diff = (DiagramDiff)itDeleteDiffs.next();
+ /**
+ * Get the view which has to be used as reference to build a phantom.<br>
+ * The reference is the non null object among the given objects. In case of delete object, in the
+ * context of three-way comparison, the reference will be the ancestor one (<code>originObj</code>).
+ *
+ * @param originObj
+ * The ancestor object.
+ * @param leftView
+ * The left object.
+ * @param rightView
+ * The right object.
+ * @return The reference object.
+ */
+ private View getReferenceView(View originObj, View leftView, View rightView) {
+ View referenceView;
+ if (originObj != null) {
+ referenceView = originObj;
+ } else if (leftView != null) {
+ referenceView = leftView;
+ } else {
+ referenceView = rightView;
+ }
+ return referenceView;
+ }
- Map<MergeViewerSide, IFigure> figures = getFigures(comparison, diff);
+ /**
+ * It creates a new phantom from the given difference, view and figure.
+ *
+ * @param diff
+ * The related difference used as index for the main phantom.
+ * @param referenceView
+ * The reference view as base for creation of the phantom.
+ * @param referenceFigure
+ * The reference figure as base for creation of the phantom.
+ * @param side
+ * The side where the phantom has to be created.
+ * @return The phantom.
+ */
+ private Phantom createPhantom(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide side) {
- View refView = (View)diff.getView();
- Match match = comparison.getMatch(refView);
+ MergeViewerSide referenceSide = getSide(referenceView);
- MergeViewerSide refSide = getReferenceSide(match);
- IFigure refFigure = figures.get(refSide);
+ Rectangle rect = referenceFigure.getBounds().getCopy();
- MatchFigure matchFigure = new MatchFigure(figures.get(MergeViewerSide.ANCESTOR), figures
- .get(MergeViewerSide.LEFT), figures.get(MergeViewerSide.RIGHT));
+ IFigure referenceLayer = getLayer(referenceView, referenceSide);
+ translateCoordinates(referenceFigure, referenceLayer, rect);
- MergeViewerSide targetSide = getTargetSide(comparison, refView);
+ IFigure ghost = null;
- IFigure ghost = createGhostFigure(refFigure, targetSide,
- refView.eContainer() instanceof BasicCompartment);
- matchFigure.setGhost(targetSide, ghost);
+ IFigure targetLayer = getLayer(referenceView, side);
+ Phantom phantom = new Phantom(targetLayer, side, referenceView, referenceFigure, diff);
- relevantFigures.put(refFigure, matchFigure);
- relevantFigures.put(ghost, matchFigure);
- phantoms.put(refFigure, ghost);
+ // Container "list" case
+ if (referenceView.eContainer() instanceof BasicCompartment) {
+ ghost = new Polyline();
- }
- }
+ Diff refiningDiff = Iterators.find(diff.getRefinedBy().iterator(), and(
+ valueIs(referenceView), onFeature(NotationPackage.Literals.VIEW__PERSISTED_CHILDREN
+ .getName())));
- public void attachPhantoms() {
- for (Entry<IFigure, IFigure> entry : phantoms.entrySet()) {
- IFigure refFigure = entry.getKey();
- MatchFigure matchFigure = relevantFigures.get(refFigure);
- MatchFigure matchFigureParent = relevantFigures.get(refFigure.getParent());
- IFigure ghost = matchFigure.ghost;
- if (ghost != null) {
- IFigure targetParent = matchFigureParent.getFigure(matchFigure.getSide(ghost));
+ // FIXME:
+ // - It has to manage visible views.
+ // - What about transient children ?
+ int index = DiffUtil.findInsertionIndex(getComparison(), refiningDiff,
+ side == MergeViewerSide.LEFT);
- // Retrieve the target layer. FIXME: retrieve the target diagram view to get its editpart.
- IFigure targetLayer = LayerManager.Helper.find(
- getViewer(matchFigure.getSide(ghost)).getEditPart(null)).getLayer(
- LayerConstants.SCALABLE_LAYERS);
+ IFigure referenceParentFigure = referenceFigure.getParent();
+ Rectangle referenceParentBounds = referenceParentFigure.getBounds().getCopy();
+ translateCoordinates(referenceParentFigure, referenceLayer, referenceParentBounds);
- if (targetParent instanceof FreeformLayeredPane) {
- targetLayer.add(ghost);
- } else {
- targetParent.add(ghost);
+ View parentView = (View)getMatchView(referenceView.eContainer(), side);
+ if (parentView != null) {
+ int nbElements = getVisibleViews(parentView).size();
+ if (index > nbElements) {
+ index = nbElements;
}
+ }
+ // FIXME: The add of decorators modifies the physical coordinates of elements
+ // FIXME: Compute position from the y position of the first child + sum of height of the
+ // children.
+ int pos = rect.height * index + referenceParentBounds.y + 1;
+
+ ((Polyline)ghost).setEndpoints(new Point(rect.x, pos), new Point(rect.x + rect.width, pos));
+
+ // Edge case
+ } else if (referenceView instanceof Edge) {
+ // If the edge phantom ties shapes where their coordinates changed
+ if (hasAnExtremityChange((Edge)referenceView, side)) {
+ EditPart edgeEditPart = createEdgeEditPart((Edge)referenceView, referenceSide, side);
+ if (edgeEditPart instanceof GraphicalEditPart) {
+ phantom.setEditPart(edgeEditPart);
+ ghost = ((GraphicalEditPart)edgeEditPart).getFigure();
+ ghost.getChildren().clear();
+ }
+ // Else, it creates only a polyline connection figure with the same properties as the
+ // reference
+ } else {
+ if (referenceFigure instanceof PolylineConnection) {
+ ghost = new PolylineConnection();
+ ghost.setBounds(rect);
+ ((PolylineConnection)ghost).setPoints(((PolylineConnection)referenceFigure)
+ .getPoints().getCopy());
+ }
}
}
- }
- private MergeViewerSide getReferenceSide(Match match) {
- EObject origin = match.getOrigin();
- if (origin != null) {
- return MergeViewerSide.ANCESTOR;
- } else {
- EObject left = match.getLeft();
- EObject right = match.getRight();
- if (left != null) {
- return MergeViewerSide.LEFT;
- } else if (right != null) {
- return MergeViewerSide.RIGHT;
- }
+ // Default case: Nodes
+ if (ghost == null) {
+ ghost = new RectangleFigure();
+ ghost.setBounds(rect);
}
- return null;
- }
- private ViewSide getReferenceView(Match match) {
- switch (getReferenceSide(match)) {
- case ANCESTOR:
- return new ViewSide(MergeViewerSide.ANCESTOR, (View)match.getOrigin());
- case LEFT:
- return new ViewSide(MergeViewerSide.LEFT, (View)match.getLeft());
- case RIGHT:
- return new ViewSide(MergeViewerSide.RIGHT, (View)match.getRight());
+ if (ghost instanceof Shape) {
+ ((Shape)ghost).setFill(false);
}
- return null;
+
+ phantom.setFigure(ghost);
+
+ translateWhenInsideContainerChange(phantom);
+
+ return phantom;
}
- private List<Match> getAllMatches(Comparison comparison) {
- List<Match> result = new ArrayList<Match>();
- for (Match match : comparison.getMatches()) {
- result.add(match);
- result.addAll(Lists.newArrayList(match.getAllSubmatches()));
- }
- return result;
+ /**
+ * Get the visible view under the given parent view.
+ *
+ * @param parent
+ * The parent view.
+ * @return The list of views.
+ */
+ private List<View> getVisibleViews(View parent) {
+ return (List<View>)Lists.newArrayList(Iterators.filter(parent.getChildren().iterator(),
+ new Predicate<Object>() {
+ public boolean apply(Object input) {
+ return input instanceof View && ((View)input).isVisible();
+ }
+ }));
}
- private List<Match> getDeepestMatches(Comparison comparison) {
- List<Match> result = new ArrayList<Match>();
- for (Match match : comparison.getMatches()) {
- result.addAll(getDeepestMatches(match));
+ /**
+ * It translates and resizes the figure of the given phantom when this one is nested in a container
+ * which is subjected to a coordinates change.
+ *
+ * @param phantom
+ * The phantom.
+ */
+ private void translateWhenInsideContainerChange(Phantom phantom) {
+ // FIXME: It was "phantom.getDifference().getMatch()" replaced by
+ // "getDiffAncestors(phantom.getDifference())" to fix a regression due to an other regression
+ // about
+ // the location of the extensions under matches.
+ Collection<Diff> changes = Collections2.filter(getDiffAncestors(phantom.getDifference()),
+ new Predicate<Diff>() {
+
+ public boolean apply(Diff difference) {
+ // FIXME: it will be changed to CHANGE (change coordinates (or dimension))
+ return difference.getKind() == DifferenceKind.MOVE;
+ }
+
+ });
+ if (changes.size() > 0) {
+ View referenceView = phantom.getOriginView();
+ View parentReferenceView = (View)referenceView.eContainer();
+ if (parentReferenceView != null) {
+ View parentView = (View)getMatchView(parentReferenceView, phantom.getSide());
+ IFigure parentFigure = getFigure(parentView);
+ if (parentFigure != null) {
+ Rectangle parentRect = parentFigure.getBounds().getCopy();
+ translateCoordinates(parentFigure,
+ getLayer(parentReferenceView, getSide(parentView)), parentRect);
+
+ IFigure parentReferenceFigure = getFigure(parentReferenceView);
+ // CHECKSTYLE:OFF
+ if (parentReferenceFigure != null) {
+ Rectangle parentReferenceRect = parentReferenceFigure.getBounds().getCopy();
+ translateCoordinates(parentReferenceFigure, getLayer(parentReferenceView,
+ getSide(parentReferenceView)), parentReferenceRect);
+
+ int deltaX = parentRect.x - parentReferenceRect.x;
+ int deltaY = parentRect.y - parentReferenceRect.y;
+ int deltaWidth = parentRect.width - parentReferenceRect.width;
+ int deltaHeight = parentRect.height - parentReferenceRect.height;
+
+ IFigure figure = phantom.getFigure();
+
+ Rectangle rect = figure.getBounds().getCopy();
+ rect.x += deltaX;
+ rect.y += deltaY;
+ rect.width += deltaWidth;
+ if (!(figure instanceof Polyline)) {
+ rect.height += deltaHeight;
+ }
+ figure.setBounds(rect);
+
+ if (figure instanceof Polyline) {
+
+ Point firstPoint = ((Polyline)figure).getPoints().getFirstPoint().getCopy();
+ Point lastPoint = ((Polyline)figure).getPoints().getLastPoint().getCopy();
+
+ firstPoint.x += deltaX;
+ firstPoint.y += deltaY;
+
+ lastPoint.x += deltaX + deltaWidth;
+ lastPoint.y += deltaY;
+
+ ((Polyline)figure).setEndpoints(firstPoint, lastPoint);
+
+ }
+ }
+ // CHECKSTYLE:ON
+ }
+ }
}
- return result;
}
- private List<Match> getDeepestMatches(Match match) {
+ /**
+ * Get all the ancestor matches from the given difference.
+ *
+ * @param difference
+ * The difference.
+ * @return the list of ancestor matches.
+ */
+ private List<Match> getMatchAncestors(Diff difference) {
List<Match> result = new ArrayList<Match>();
- Iterator<Match> subMatches = match.getAllSubmatches().iterator();
- if (!subMatches.hasNext()) {
- result.add(match);
- } else {
- while (subMatches.hasNext()) {
- Match subMatch = subMatches.next();
- if (subMatch.getSubmatches().isEmpty()) {
- result.add(subMatch);
- }
+ EObject match = difference.getMatch();
+ while (match != null) {
+ if (match instanceof Match) {
+ result.add((Match)match);
}
+ match = match.eContainer();
}
return result;
}
- private Map<MergeViewerSide, IFigure> getFigures(Comparison comparison, DiagramDiff diff) {
- Map<MergeViewerSide, IFigure> result = new HashMap<MergeViewerSide, IFigure>();
- View view = (View)diff.getView();
- Match match = comparison.getMatch(view);
- View origin = (View)match.getOrigin();
- result.putAll(getFigure(comparison, origin));
- View left = (View)match.getLeft();
- result.putAll(getFigure(comparison, left));
- View right = (View)match.getRight();
- result.putAll(getFigure(comparison, right));
+ /**
+ * Get all the differences above the given one.
+ *
+ * @param difference
+ * The difference.
+ * @return the list of parent differences.
+ */
+ private List<Diff> getDiffAncestors(Diff difference) {
+ List<Diff> result = new ArrayList<Diff>();
+ Iterator<Match> matches = getMatchAncestors(difference).iterator();
+ while (matches.hasNext()) {
+ Match match = matches.next();
+ result.addAll(match.getDifferences());
+ }
return result;
}
- private IFigure getFigure(ViewSide viewSide) {
- GraphicalEditPart originEditPart = (GraphicalEditPart)getViewer(viewSide.side).getEditPart(
- viewSide.view);
- return originEditPart.getFigure();
+ /**
+ * It checks that the given edge is linked to graphical objects subjected to coordinate changes, on
+ * the given side.
+ *
+ * @param edge
+ * The edge to check.
+ * @param targetSide
+ * The side to check extremities (side of the phantom).
+ * @return True if an extremity at least changed its location, False otherwise.
+ */
+ private boolean hasAnExtremityChange(Edge edge, MergeViewerSide targetSide) {
+ View referenceSource = edge.getSource();
+ View referenceTarget = edge.getTarget();
+ return hasChange(referenceSource, targetSide) || hasChange(referenceTarget, targetSide);
}
- private Map<MergeViewerSide, IFigure> getFigure(Comparison comparison, View view) {
- Map<MergeViewerSide, IFigure> result = new HashMap<MergeViewerSide, IFigure>();
- if (view != null) {
- MergeViewerSide side = getSide(comparison, view);
- GraphicalEditPart editPart = (GraphicalEditPart)getViewer(side).getEditPart(view);
- result.put(side, editPart.getFigure());
+ /**
+ * It checks that the coordinates of the given view changed between left and right, from the given
+ * side.
+ *
+ * @param referenceView
+ * The view to check.
+ * @param targetSide
+ * The side to focus.
+ * @return True if the view changed its location, False otherwise.
+ */
+ private boolean hasChange(View referenceView, MergeViewerSide targetSide) {
+ DifferenceKind lookup = DifferenceKind.MOVE; // FIXME: it will be change to CHANGE (change
+ // coordinates)
+ View extremity = (View)getMatchView(referenceView, targetSide);
+ // Look for a related change coordinates on the extremity of the edge reference.
+ Collection<Diff> diffs = Collections2.filter(getComparison().getDifferences(referenceView), and(
+ instanceOf(DiagramDiff.class), ofKind(lookup)));
+ if (diffs.isEmpty()) {
+ // Look for a related change coordinates on the matching extremity (other side) of the edge
+ // reference.
+ diffs = Collections2.filter(getComparison().getDifferences(extremity), and(
+ instanceOf(DiagramDiff.class), ofKind(lookup)));
}
- return result;
+ return !diffs.isEmpty();
}
- private MatchFigure createMatchFigure(Match match) {
-
- IFigure originFigure = null;
- IFigure leftFigure = null;
- IFigure rightFigure = null;
-
- if (match.getOrigin() != null) {
- originFigure = getFigure(new ViewSide(MergeViewerSide.ANCESTOR, (View)match.getOrigin()));
+ /**
+ * It creates and returns a new edit part from the given edge. This edit part listens the reference
+ * edge but is attached to the controllers of the target (phantom) side.
+ *
+ * @param referenceEdge
+ * The edge as base of the edit part.
+ * @param referenceSide
+ * The side of this edge.
+ * @param targetSide
+ * The side where the edit part has to be created to draw the related phantom.
+ * @return The new edit part.
+ */
+ private EditPart createEdgeEditPart(Edge referenceEdge, MergeViewerSide referenceSide,
+ MergeViewerSide targetSide) {
+ EditPart edgeEditPartReference = getViewer(referenceSide).getEditPart(referenceEdge);
+ EditPart edgeEditPart = null;
+ if (edgeEditPartReference instanceof ConnectionEditPart) {
+ edgeEditPart = createEditPartForPhantoms(referenceEdge, referenceSide, targetSide);
+ if (edgeEditPart instanceof ConnectionEditPart) {
+ View source = (View)((ConnectionEditPart)edgeEditPartReference).getSource().getModel();
+ if (source == null) {
+ source = referenceEdge.getSource();
+ }
+ View target = (View)((ConnectionEditPart)edgeEditPartReference).getTarget().getModel();
+ if (target == null) {
+ target = referenceEdge.getTarget();
+ }
+ EditPart sourceEp = createEditPartForPhantoms(source, referenceSide, targetSide);
+ ((AbstractGraphicalEditPart)sourceEp).activate();
+ ((AbstractGraphicalEditPart)sourceEp).getFigure();
+ ((ConnectionEditPart)edgeEditPart).setSource(sourceEp);
+ EditPart targetEp = createEditPartForPhantoms(target, referenceSide, targetSide);
+ ((AbstractGraphicalEditPart)targetEp).activate();
+ ((AbstractGraphicalEditPart)targetEp).getFigure();
+ ((ConnectionEditPart)edgeEditPart).setTarget(targetEp);
+ }
}
- if (match.getLeft() != null) {
- leftFigure = getFigure(new ViewSide(MergeViewerSide.LEFT, (View)match.getLeft()));
+ return edgeEditPart;
+ }
+ /**
+ * It creates and returns a new edit part from the given view. This edit part listens the reference
+ * view but is attached to the controllers of the target (phantom) side.
+ *
+ * @param referenceView
+ * The view as base of the edit part.
+ * @param referenceSide
+ * The side of this view.
+ * @param targetSide
+ * The side where the edit part has to be created to draw the related phantom.
+ * @return The new edit part.
+ */
+ private EditPart createEditPartForPhantoms(EObject referenceView, MergeViewerSide referenceSide,
+ MergeViewerSide targetSide) {
+ EditPart editPartParent = null;
+ EditPart editPart = null;
+ EditPart editPartReference = getViewer(referenceSide).getEditPart(referenceView);
+ EditPart editPartReferenceParent = editPartReference.getParent();
+ Object referenceViewParent = editPartReferenceParent.getModel();
+ if (!(referenceViewParent instanceof EObject)) {
+ referenceViewParent = referenceView.eContainer();
}
- if (match.getRight() != null) {
- rightFigure = getFigure(new ViewSide(MergeViewerSide.RIGHT, (View)match.getRight()));
+ View viewParent = (View)getMatchView((EObject)referenceViewParent, targetSide);
+ if (viewParent != null) {
+ editPartParent = getViewer(targetSide).getEditPart(viewParent);
}
+ if (editPartParent == null) {
+ editPartParent = createEditPartForPhantoms((EObject)referenceViewParent, referenceSide,
+ targetSide);
- MatchFigure matchFigure = createMatchFigure(originFigure, leftFigure, rightFigure);
- matchedFigures.add(matchFigure);
- matchFigure.match = match;
+ }
+ if (editPartParent != null) {
+ View view = (View)getMatchView(referenceView, targetSide);
+ if (view != null) {
+ editPart = getViewer(targetSide).getEditPart(view);
+ }
+ if (editPart == null) {
+ editPart = getViewer(targetSide).getGraphicalViewer().getEditPartFactory()
+ .createEditPart(editPartParent, referenceView);
+ editPart.setParent(editPartParent);
+ getViewer(targetSide).getGraphicalViewer().getEditPartRegistry().put(referenceView,
+ editPart);
+ }
- return matchFigure;
+ }
+ return editPart;
}
- private MatchFigure createMatchFigure(IFigure origin, IFigure left, IFigure right) {
- MatchFigure matchFigure = new MatchFigure(origin, left, right);
- if (origin != null) {
- relevantFigures.put(origin, matchFigure);
- }
- if (left != null) {
- relevantFigures.put(left, matchFigure);
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideAll()
+ */
+ public void hideAll() {
+ Iterator<Phantom> visiblePhantoms = Iterators.filter(fPhantomRegistry.values().iterator(),
+ new Predicate<Phantom>() {
+ public boolean apply(Phantom phantom) {
+ return phantom.getFigure().getParent() != null;
+ }
+ });
+ while (visiblePhantoms.hasNext()) {
+ Phantom phantom = (Phantom)visiblePhantoms.next();
+ handleDecorator(phantom, false, true);
}
- if (right != null) {
- relevantFigures.put(right, matchFigure);
+ }
+ }
+
+ /**
+ * Marker manager to create, hide or reveal marker figures related to deleted or added graphical objects.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ private class MarkerManager extends AbstractDecoratorManager {
+
+ /**
+ * Marker represented by a <code>figure</code> on a <code>layer</code>, from the given
+ * <code>side</code> of the merge viewer. An edit part may be linked to the <code>figure</code> in
+ * some cases.<br>
+ * The marker is related to a <code>difference</code> and it is binded with the reference view and
+ * figure.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ private class Marker extends AbstractDecorator {
+
+ /** Thickness of the marker. */
+ public static final int THICKNESS = 6;
+
+ /** The alpha number for the figure. */
+ public static final int ALPHA = 30;
+
+ /**
+ * Constructor.
+ *
+ * @param layer
+ * {@link Marker#fLayer}.
+ * @param side
+ * {@link Marker#fSide}.
+ * @param originView
+ * {@link Marker#fOriginView}.
+ * @param originFigure
+ * {@link Marker#fOriginFigure}.
+ * @param diff
+ * {@link Marker#fDifference}.
+ */
+ public Marker(IFigure layer, MergeViewerSide side, View originView, IFigure originFigure,
+ Diff diff) {
+ setLayer(layer);
+ setSide(side);
+ setOriginView(originView);
+ setOriginFigure(originFigure);
+ setDifference(diff);
}
- return matchFigure;
}
- private void createParentMatchFigures(MatchFigure matchFigure) {
- IFigure origin = matchFigure.origin;
- IFigure left = matchFigure.left;
- IFigure right = matchFigure.right;
- while (createParentMatchFigure(origin, left, right)) {
- if (origin != null) {
- origin = origin.getParent();
+ /** Registry of created markers, indexed by difference. */
+ private Map<Diff, List<Marker>> fMarkerRegistry = new HashMap<Diff, List<Marker>>();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getReferenceViews(org.eclipse.emf.compare.diagram.DiagramDiff)
+ */
+ @Override
+ protected List<View> getReferenceViews(DiagramDiff difference) {
+ List<View> result = new ArrayList<View>();
+ Match matchValue = getComparison().getMatch(difference.getView());
+ if (matchValue != null) {
+ if (matchValue.getLeft() != null) {
+ result.add((View)matchValue.getLeft());
}
- if (left != null) {
- left = left.getParent();
+ if (matchValue.getRight() != null) {
+ result.add((View)matchValue.getRight());
}
- if (right != null) {
- right = right.getParent();
+ if (getComparison().isThreeWay()) {
+ switch (difference.getKind()) {
+ case DELETE:
+ case CHANGE:
+ case MOVE:
+ result.add((View)matchValue.getOrigin());
+ break;
+ default:
+ break;
+ }
}
}
+ return result;
}
- private boolean createParentMatchFigure(IFigure origin, IFigure left, IFigure right) {
- IFigure originParent = null;
- IFigure leftParent = null;
- IFigure rightParent = null;
- if (left != null) {
- leftParent = left.getParent();
- if (leftParent == null || relevantFigures.get(leftParent) != null) {
- return false;
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getTargetSide(org.eclipse.emf.compare.Match,
+ * org.eclipse.gmf.runtime.notation.View)
+ */
+ @Override
+ protected MergeViewerSide getTargetSide(Match match, View referenceView) {
+ return getSide(referenceView);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#createAndRegisterDecorator(org.eclipse.emf.compare.Diff,
+ * org.eclipse.gmf.runtime.notation.View, org.eclipse.draw2d.IFigure,
+ * org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
+ */
+ @Override
+ protected Marker createAndRegisterDecorator(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide targetSide) {
+ Marker marker = createMarker(diff, referenceView, referenceFigure, targetSide);
+ List<Marker> markers = fMarkerRegistry.get(diff);
+ if (markers == null) {
+ markers = new ArrayList<Marker>();
+ fMarkerRegistry.put(diff, markers);
}
- if (right != null) {
- rightParent = right.getParent();
- if (rightParent == null || relevantFigures.get(rightParent) != null) {
- return false;
+ markers.add(marker);
+ return marker;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#getDecorators(org.eclipse.emf.compare.Diff)
+ */
+ @Override
+ protected List<Marker> getDecorators(Diff difference) {
+ return fMarkerRegistry.get(difference);
+ }
+
+ @Override
+ protected void handleAddDecorator(AbstractDecorator decorator, IFigure parent, IFigure toAdd,
+ boolean isMain) {
+ super.handleAddDecorator(decorator, parent, toAdd, isMain);
+ DiagramMergeViewer viewer = getViewer(decorator.getSide());
+ viewer.getGraphicalViewer().reveal(viewer.getEditPart(decorator.getOriginView()));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.AbstractDecoratorManager#goodCandidate()<br>
+ * All graphical differences are concerned.
+ */
+ @Override
+ protected Predicate<Diff> goodCandidate() {
+ return new Predicate<Diff>() {
+ public boolean apply(Diff difference) {
+ return instanceOf(DiagramDiff.class).apply(difference);
}
- }
- if (origin != null) {
- originParent = origin.getParent();
- if (originParent == null || relevantFigures.get(originParent) != null) {
- return false;
+ };
+ }
+
+ /**
+ * It creates a new marker from the given difference, view and figure.
+ *
+ * @param diff
+ * The related difference used as index for the main marker.
+ * @param referenceView
+ * The reference view as base for creation of the marker.
+ * @param referenceFigure
+ * The reference figure as base for creation of the marker.
+ * @param side
+ * The side where the marker has to be created.
+ * @return The phantom.
+ */
+ private Marker createMarker(Diff diff, View referenceView, IFigure referenceFigure,
+ MergeViewerSide side) {
+
+ Rectangle referenceBounds = referenceFigure.getBounds().getCopy();
+ IFigure referenceLayer = getLayer(referenceView, side);
+ translateCoordinates(referenceFigure, referenceLayer, referenceBounds);
+
+ IFigure markerFigure = null;
+
+ IFigure targetLayer = getLayer(referenceView, side);
+ Marker marker = new Marker(targetLayer, side, referenceView, referenceFigure, diff);
+
+ if (referenceView.eContainer() instanceof BasicCompartment) {
+
+ markerFigure = new RectangleFigure();
+ markerFigure.setBounds(referenceBounds);
+
+ } else if (referenceView instanceof Edge) {
+
+ if (referenceFigure instanceof PolylineConnection) {
+
+ markerFigure = new PolylineConnection();
+
+ markerFigure.setBounds(referenceBounds);
+
+ ((PolylineConnection)markerFigure).setPoints(((PolylineConnection)referenceFigure)
+ .getPoints().getCopy());
+
+ int oldWidth = ((Shape)referenceFigure).getLineWidth();
+ int newWidth = oldWidth + Marker.THICKNESS * 2;
+ ((PolylineConnection)markerFigure).setLineWidth(newWidth);
}
+
}
- createMatchFigure(originParent, leftParent, rightParent);
- return true;
+ // Default case: Nodes
+ if (markerFigure == null) {
+
+ markerFigure = new RectangleFigure();
+
+ referenceBounds.x -= Marker.THICKNESS;
+ referenceBounds.y -= Marker.THICKNESS;
+ referenceBounds.width += Marker.THICKNESS * 2;
+ referenceBounds.height += Marker.THICKNESS * 2;
+
+ markerFigure.setBounds(referenceBounds);
+ }
+
+ Color strokeColor = getCompareColor().getStrokeColor(diff, isThreeWay(), false, true);
+ markerFigure.setForegroundColor(strokeColor);
+ markerFigure.setBackgroundColor(strokeColor);
+ // markerFigure.setBorder(new FocusBorder());
+ ((Shape)markerFigure).setAlpha(Marker.ALPHA);
+
+ marker.setFigure(markerFigure);
+
+ return marker;
}
- private IFigure getFigure(MatchFigure matchFigure, MergeViewerSide side) {
- switch (side) {
- case LEFT:
- return matchFigure.left;
- case RIGHT:
- return matchFigure.right;
- case ANCESTOR:
- return matchFigure.origin;
- default:
- return null;
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideAll()
+ */
+ public void hideAll() {
+ Iterator<Marker> visibleMarkers = Iterators.filter(Iterables.concat(fMarkerRegistry.values())
+ .iterator(), new Predicate<Marker>() {
+ public boolean apply(Marker marker) {
+ return marker.getFigure().getParent() != null;
+ }
+ });
+ while (visibleMarkers.hasNext()) {
+ Marker marker = (Marker)visibleMarkers.next();
+ handleDecorator(marker, false, true);
}
}
- final class ViewSide {
- public MergeViewerSide side;
+ }
- public View view;
+ /**
+ * Decorator manager to create, hide or reveal all decorator figures related to graphical changes.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ private class DecoratorsManager implements IDecoratorManager {
+ /** Phantoms manager. */
+ private IDecoratorManager fPhantomManager = new PhantomManager();
- public ViewSide(MergeViewerSide side, View view) {
- this.side = side;
- this.view = view;
- }
+ /** Markers manager. */
+ private IDecoratorManager fMarkerManager = new MarkerManager();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideDecorators(org.eclipse.emf.compare.Diff)
+ */
+ public void hideDecorators(Diff difference) {
+ fMarkerManager.hideDecorators(difference);
+ fPhantomManager.hideDecorators(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#revealDecorators(org.eclipse.emf.compare.Diff)
+ */
+ public void revealDecorators(Diff difference) {
+ fMarkerManager.revealDecorators(difference);
+ fPhantomManager.revealDecorators(difference);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram.DiagramContentMergeViewer.IDecoratorManager#hideAll()
+ */
+ public void hideAll() {
+ fMarkerManager.hideAll();
+ fPhantomManager.hideAll();
}
- final class MatchFigure {
+ }
+
+ /**
+ * Bundle name of the property file containing all displayed strings.
+ */
+ private static final String BUNDLE_NAME = DiagramContentMergeViewer.class.getName();
+
+ /** The editing domain. */
+ private ICompareEditingDomain fEditingDomain;
- public IFigure origin;
+ /** Listener to manage the update of the decorators on events about the command stack. */
+ private CommandStackListener fDecoratorsCommandStackListener;
- public IFigure left;
+ /** The phantom manager to use in the context of this viewer. */
+ private final DecoratorsManager fDecoratorsManager = new DecoratorsManager();
- public IFigure right;
+ /** The current "opened" difference. */
+ private Diff fCurrentSelectedDiff;
+
+ /**
+ * The adapter factory used to create the content and label provider for ancestor, left and right
+ * {@link DiagramMergeViewer}.
+ */
+ private final ComposedAdapterFactory fAdapterFactory;
+
+ /**
+ * Creates a new {@link DiagramContentMergeViewer} by calling the super constructor with the given
+ * parameters.
+ * <p>
+ * It calls {@link #buildControl(Composite)} as stated in its javadoc.
+ * <p>
+ * {@link #setContentProvider(org.eclipse.jface.viewers.IContentProvider) content provider} to properly
+ * display ancestor, left and right parts.
+ *
+ * @param parent
+ * the parent composite to build the UI in
+ * @param config
+ * the {@link CompareConfiguration}
+ */
+ public DiagramContentMergeViewer(Composite parent, CompareConfiguration config) {
+ super(SWT.NONE, ResourceBundle.getBundle(BUNDLE_NAME), config);
+
+ fAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ fAdapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
+ fAdapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
+
+ buildControl(parent);
+ setContentProvider(new TreeContentMergeViewerContentProvider(config, getComparison()));
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
+ */
+ @Override
+ protected void handleDispose(DisposeEvent event) {
+ fEditingDomain.getCommandStack().removeCommandStackListener(fDecoratorsCommandStackListener);
+ fAdapterFactory.dispose();
+ super.handleDispose(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getAncestorMergeViewer()
+ */
+ @SuppressWarnings("unchecked")
+ // see createMergeViewer() to see it is safe
+ @Override
+ public DiagramMergeViewer getAncestorMergeViewer() {
+ return (DiagramMergeViewer)super.getAncestorMergeViewer();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getLeftMergeViewer()
+ */
+ @SuppressWarnings("unchecked")
+ // see createMergeViewer() to see it is safe
+ @Override
+ public DiagramMergeViewer getLeftMergeViewer() {
+ return (DiagramMergeViewer)super.getLeftMergeViewer();
+ }
- public Match match;
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getRightMergeViewer()
+ */
+ @SuppressWarnings("unchecked")
+ // see createMergeViewer() to see it is safe
+ @Override
+ public DiagramMergeViewer getRightMergeViewer() {
+ return (DiagramMergeViewer)super.getRightMergeViewer();
+ }
- public IFigure ghost;
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#copyDiff(boolean)
+ */
+ @Override
+ protected void copyDiff(boolean leftToRight) {
+ /*
+ * FIXME change this! For the moment we always do a new setInput() on the content viewer whenever we
+ * select a Diagram Difference. This is meant to change so that we use selection synchronization
+ * instead. This code will break whenever we implement that change.
+ */
+ if (fCurrentSelectedDiff != null) {
+ final Command command = getEditingDomain().createCopyCommand(fCurrentSelectedDiff, leftToRight,
+ EMFCompareIDEPlugin.getDefault().getMergerRegistry());
+ getEditingDomain().getCommandStack().execute(command);
- public MatchFigure(IFigure origin, IFigure left, IFigure right) {
- this.origin = origin;
- this.left = left;
- this.right = right;
+ if (leftToRight) {
+ setRightDirty(true);
+ } else {
+ setLeftDirty(true);
}
+ // refresh();
+ }
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.contentmergeviewer.ContentMergeViewer#getContents(boolean)
+ */
+ @Override
+ protected byte[] getContents(boolean left) {
+ return null;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.DiagramCompareContentMergeViewer#createMergeViewer(org.eclipse.swt.widgets.Composite,
+ * org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
+ */
+ @Override
+ protected IMergeViewer createMergeViewer(Composite parent, MergeViewerSide side) {
+ final DiagramMergeViewer diagramMergeViewer = new DiagramMergeViewer(parent, side);
+ return diagramMergeViewer;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.DiagramCompareContentMergeViewer#paintCenter(org.eclipse.swt.graphics.GC)
+ */
+ @Override
+ protected void paintCenter(GC g) {
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.DiagramCompareContentMergeViewer#updateContent(java.lang.Object,
+ * java.lang.Object, java.lang.Object)
+ */
+ @Override
+ protected void updateContent(Object ancestor, Object left, Object right) {
+ initStackListenerAndUpdateContent(ancestor, left, right);
+
+ getLeftMergeViewer().getGraphicalViewer().flush();
+ getRightMergeViewer().getGraphicalViewer().flush();
+ getAncestorMergeViewer().getGraphicalViewer().flush();
- public MatchFigure(IFigure origin, IFigure left, IFigure right, Match match) {
- this.origin = origin;
- this.left = left;
- this.right = right;
- this.match = match;
+ if (left instanceof IDiagramDiffAccessor) {
+ IDiagramDiffAccessor input = (IDiagramDiffAccessor)left;
+
+ // initialization: reset the current difference selection hiding potential visible phantoms
+ if (fCurrentSelectedDiff != null && fCurrentSelectedDiff.getState() != DifferenceState.MERGED) {
+ fDecoratorsManager.hideDecorators(fCurrentSelectedDiff);
}
- public void setGhost(MergeViewerSide side, IFigure ghost) {
- this.ghost = ghost;
- switch (side) {
- case ANCESTOR:
- origin = ghost;
- break;
- case LEFT:
- left = ghost;
- break;
- case RIGHT:
- right = ghost;
- break;
- }
+ Diff diff = input.getDiff(); // equivalent to getInput().getTarget()
+ fCurrentSelectedDiff = diff;
+
+ if (diff.getState() != DifferenceState.MERGED) {
+ fDecoratorsManager.revealDecorators(diff);
}
- public MergeViewerSide getSide(IFigure figure) {
- if (figure == origin) {
- return MergeViewerSide.ANCESTOR;
- } else if (figure == left) {
- return MergeViewerSide.LEFT;
- } else if (figure == right) {
- return MergeViewerSide.RIGHT;
- }
- return null;
+ // FIXME use the decorator manager to refresh decorators after a merge and using undo/redo
+ // actions.
+ } else if (left instanceof IDiagramNodeAccessor) {
+ if (fCurrentSelectedDiff != null && fCurrentSelectedDiff.getState() != DifferenceState.MERGED) {
+ fDecoratorsManager.hideDecorators(fCurrentSelectedDiff);
}
+ fCurrentSelectedDiff = null;
+ }
- public IFigure getFigure(MergeViewerSide side) {
- switch (side) {
- case ANCESTOR:
- return origin;
- case LEFT:
- return left;
- case RIGHT:
- return right;
+ updateToolItems();
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#installCommandStackListener(org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.UndoAction,
+ * org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.RedoAction)
+ */
+ @Override
+ protected CommandStackListener installCommandStackListener(UndoAction undoAction, RedoAction redoAction) {
+ CommandStackListener cmdStackListener = super.installCommandStackListener(undoAction, redoAction);
+ fEditingDomain = getEditingDomain();
+ fDecoratorsCommandStackListener = new CommandStackListener() {
+
+ public void commandStackChanged(EventObject event) {
+ Object source = event.getSource();
+ if (source instanceof TransactionalCommandStack) {
+ Command command = ((TransactionalCommandStack)source).getMostRecentCommand();
+ if (command instanceof CopyCommand) {
+ Iterator<DiagramDiff> diffs = Iterators.filter(command.getAffectedObjects()
+ .iterator(), DiagramDiff.class);
+ while (diffs.hasNext()) {
+ DiagramDiff diagramDiff = diffs.next();
+ if (diagramDiff.getState() != DifferenceState.UNRESOLVED) {
+ fDecoratorsManager.hideDecorators(diagramDiff);
+ }
+ }
+ }
}
- return null;
}
+ };
+ fEditingDomain.getCommandStack().addCommandStackListener(fDecoratorsCommandStackListener);
+ return cmdStackListener;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ // No selection synchronization (content to structure merge viewer).
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#getDiffFrom(org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer)
+ */
+ @Override
+ protected Diff getDiffFrom(IMergeViewer viewer) {
+ return fCurrentSelectedDiff;
+ }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.EMFCompareContentMergeViewer#createControls(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected void createControls(Composite composite) {
+ super.createControls(composite);
+ getAncestorMergeViewer().removeSelectionChangedListener(this);
+ getLeftMergeViewer().removeSelectionChangedListener(this);
+ getRightMergeViewer().removeSelectionChangedListener(this);
+ }
+
+ /**
+ * Utility method to retrieve the {@link DiagramMergeViewer} from the given side.
+ *
+ * @param side
+ * The side to focus.
+ * @return The viewer.
+ */
+ private DiagramMergeViewer getViewer(MergeViewerSide side) {
+ DiagramMergeViewer result = null;
+ switch (side) {
+ case LEFT:
+ result = getLeftMergeViewer();
+ break;
+ case RIGHT:
+ result = getRightMergeViewer();
+ break;
+ case ANCESTOR:
+ result = getAncestorMergeViewer();
+ break;
+ default:
}
+ return result;
+ }
+ /**
+ * Utility method to know the side where is located the given view.
+ *
+ * @param view
+ * The view.
+ * @return The side of the view.
+ */
+ private MergeViewerSide getSide(View view) {
+ MergeViewerSide result = null;
+ Match match = getComparison().getMatch(view);
+ if (match.getLeft() == view) {
+ result = MergeViewerSide.LEFT;
+ } else if (match.getRight() == view) {
+ result = MergeViewerSide.RIGHT;
+ } else if (match.getOrigin() == view) {
+ result = MergeViewerSide.ANCESTOR;
+ }
+ return result;
}
- // *** END alternative developing solution ***
+ /**
+ * Utility method to get the object matching with the given one, to the given side.
+ *
+ * @param object
+ * The object as base of the lookup.
+ * @param side
+ * The side where the potential matching object has to be retrieved.
+ * @return The matching object.
+ */
+ private EObject getMatchView(EObject object, MergeViewerSide side) {
+ Match match = getComparison().getMatch(object);
+ return getMatchView(match, side);
+ }
+
+ /**
+ * Utility method to get the object in the given side from the given match.
+ *
+ * @param match
+ * The match.
+ * @param side
+ * The side where the potential matching object has to be retrieved.
+ * @return The matching object.
+ */
+ private EObject getMatchView(Match match, MergeViewerSide side) {
+ EObject result = null;
+ switch (side) {
+ case LEFT:
+ result = match.getLeft();
+ break;
+ case RIGHT:
+ result = match.getRight();
+ break;
+ case ANCESTOR:
+ result = match.getOrigin();
+ break;
+ default:
+ }
+ return result;
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java
index 2ca90cc4a..e65769499 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/contentmergeviewer/diagram/DiagramMergeViewer.java
@@ -10,155 +10,210 @@
*******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.internal.contentmergeviewer.diagram;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.draw2d.ColorConstants;
+import org.eclipse.draw2d.FigureCanvas;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.EdgeChange;
-import org.eclipse.emf.compare.diagram.Hide;
-import org.eclipse.emf.compare.diagram.LabelChange;
-import org.eclipse.emf.compare.diagram.NodeChange;
-import org.eclipse.emf.compare.diagram.Show;
-import org.eclipse.emf.compare.diagram.ide.ui.AbstractGraphicalMergeViewer;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.DiffDecorationEditPolicy;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.provider.DiffDecoratorProvider;
-import org.eclipse.emf.compare.diagram.ide.ui.decoration.provider.SelectedDiffAdapter;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.AbstractGraphicalMergeViewer;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramDiffAccessor;
import org.eclipse.emf.compare.diagram.ide.ui.internal.accessor.IDiagramNodeAccessor;
-import org.eclipse.emf.compare.diagram.util.DiagramCompareSwitch;
-import org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide;
-import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EcoreFactory;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditDomain;
import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.MouseWheelHandler;
import org.eclipse.gef.MouseWheelZoomHandler;
+import org.eclipse.gef.SelectionManager;
import org.eclipse.gef.editparts.ZoomManager;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gef.ui.parts.DomainEventDispatcher;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramCommandStack;
+import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditDomain;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer;
import org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService;
import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
+ * The graphical viewer on each side of the compare viewer.
+ *
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
class DiagramMergeViewer extends AbstractGraphicalMergeViewer {
- private IDiagramNodeAccessor fInput;
+ /**
+ * Selection manager to forbid manual selections on graphical objects.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ protected class NonEditingManager extends SelectionManager {
+
+ @Override
+ public void appendSelection(EditPart editpart) {
+ // needed to disable manual selection on every objects.
+ }
+ }
+
+ /**
+ * Event dispatcher to forbid external mouse actions on diagrams.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+ protected class NonEditingEventDispatcher extends DomainEventDispatcher {
+
+ /**
+ * Constructor.
+ *
+ * @param d
+ * The edit domain.
+ * @param v
+ * The edit part viewer.
+ */
+ public NonEditingEventDispatcher(EditDomain d, EditPartViewer v) {
+ super(d, v);
+ }
+
+ @Override
+ public void dispatchMousePressed(MouseEvent me) {
+ // needed not to get a change of the cursor releasing from a connector.
+ }
+
+ @Override
+ public void dispatchMouseReleased(MouseEvent me) {
+ // needed not to get a change of the cursor releasing from a connector.
+ }
- private DiagramGraphicalViewer fGraphicalViewer;
+ @Override
+ public void dispatchMouseDoubleClicked(MouseEvent me) {
+ // needed not to get a change of the cursor double-clicking on a connector.
+ }
+
+ @Override
+ public void dispatchMouseHover(MouseEvent me) {
+ // needed not to get a change of the cursor hovering a connector.
+ }
+
+ @Override
+ public void dispatchMouseMoved(MouseEvent me) {
+ // needed not to get a change of the cursor hovering a connector.
+ }
+
+ }
/** the zoom factor of displayed diagrams. */
private static final double ZOOM_FACTOR = 1;
+ /** The graphical viewer. */
+ private DiagramGraphicalViewerForCompare fGraphicalViewer;
+
/** the current diagram used. */
private Diagram currentDiag;
+ /** The diagram edit domain. */
+ private DiagramEditDomain editDomain;
+
/**
+ * Constructor.
+ *
* @param parent
+ * The parent composite.
+ * @param side
+ * The side having to be managed by this viewer.
*/
public DiagramMergeViewer(Composite parent, MergeViewerSide side) {
super(parent, side);
+ ((FigureCanvas)fGraphicalViewer.getControl()).getLightweightSystem().setEventDispatcher(
+ new NonEditingEventDispatcher(editDomain, fGraphicalViewer));
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.rcp.ui.mergeviewer.MergeViewer#createControl(org.eclipse.swt.widgets.Composite)
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.AbstractGraphicalMergeViewer#createControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public Control createControl(Composite parent) {
+ editDomain = new DiagramEditDomain(null);
+ editDomain.setCommandStack(new DiagramCommandStack(editDomain));
createDiagramGraphicalViewer(parent);
return fGraphicalViewer.getControl();
}
+ /**
+ * It creates and initialize the graphical viewer.
+ *
+ * @param composite
+ * The composite.
+ */
private void createDiagramGraphicalViewer(Composite composite) {
- fGraphicalViewer = new DiagramGraphicalViewer();
+ fGraphicalViewer = new DiagramGraphicalViewerForCompare();
fGraphicalViewer.createControl(composite);
fGraphicalViewer.setEditDomain(editDomain);
fGraphicalViewer.setEditPartFactory(EditPartService.getInstance());
fGraphicalViewer.getControl().setBackground(ColorConstants.listBackground);
fGraphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL),
MouseWheelZoomHandler.SINGLETON);
+
+ fGraphicalViewer.setSelectionManager(new NonEditingManager());
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.internal.AbstractGraphicalMergeViewer#getGraphicalViewer()
+ */
@Override
- public DiagramGraphicalViewer getGraphicalViewer() {
+ public DiagramGraphicalViewerForCompare getGraphicalViewer() {
return fGraphicalViewer;
}
- private void installDecoratorPolicy(EditPart editPart) {
- editPart.removeEditPolicy(EditPolicyRoles.DECORATION_ROLE);
- editPart.installEditPolicy(EditPolicyRoles.DECORATION_ROLE, new DiffDecorationEditPolicy());
- }
-
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.diagram.ide.ui.AbstractEditPartMergeViewer#setInput(java.lang.Object)
+ */
@Override
public void setInput(final Object input) {
if (input instanceof IDiagramNodeAccessor) {
- fInput = (IDiagramNodeAccessor)input;
Diagram diagram = ((IDiagramNodeAccessor)input).getOwnedDiagram();
- View view = ((IDiagramNodeAccessor)input).getOwnedView();
-
initEditingDomain(diagram);
-
- if (diagram != null) {
- Iterator<EObject> contents = diagram.eAllContents();
- while (contents.hasNext()) {
- EObject obj = contents.next();
- if (obj instanceof View) {
- for (Diff diff : ((IDiagramNodeAccessor)input).getComparison().getDifferences(obj)) {
- if (diff instanceof DiagramDiff) {
- if (diff.getKind() != DifferenceKind.DELETE) {
- obj.eAdapters().add(new SelectedDiffAdapter((DiagramDiff)diff));
- EditPart editPart = getEditPart((View)obj);
- if (editPart != null) {
- installDecoratorPolicy(editPart);
- editPart.refresh();
- }
- }
- }
- }
- }
- }
+ EditPart editPart = null;
+ View view = ((IDiagramNodeAccessor)input).getOwnedView();
+ if (view != null) {
+ editPart = getEditPart(view);
}
-
- // Selection
fGraphicalViewer.deselectAll();
- if (view != null) {
-
- EditPart viewPart = getEditPart(view);
-
- if (viewPart != null) {
-
- while (!viewPart.isSelectable()) {
- viewPart = viewPart.getParent();
- }
-
- setSelection(new StructuredSelection(viewPart));
- getGraphicalViewer().reveal(viewPart);
-
+ // Selection only on matches.
+ if (!(input instanceof IDiagramDiffAccessor) && editPart != null) {
+ while (editPart != null && !editPart.isSelectable()) {
+ editPart = editPart.getParent();
}
+ if (editPart != null) {
+ setSelection(new StructuredSelection(editPart));
+ fGraphicalViewer.reveal(editPart);
+ }
}
+
}
}
+ /**
+ * It creates an editing domain for this diagram.
+ *
+ * @param diagram
+ * The diagram.
+ */
private void initEditingDomain(Diagram diagram) {
ResourceSet resourceSet = null;
if (diagram != null) {
@@ -170,23 +225,21 @@ class DiagramMergeViewer extends AbstractGraphicalMergeViewer {
}
}
- public Object getInput() {
- return fInput;
- }
-
- public EditPart findObjectAtExcluding(Point location, Collection exclusionSet, Conditional conditional) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public EditPart getEditPart(final View view) {
+ /**
+ * Get the editpart from the given view.
+ *
+ * @param view
+ * The view.
+ * @return The editpart.
+ */
+ public EditPart getEditPart(final EObject view) {
final EditPart editPart = (EditPart)fGraphicalViewer.getEditPartRegistry().get(view);
if (editPart == null) {
Diagram diagram = null;
if (view instanceof Diagram) {
diagram = (Diagram)view;
- } else {
- diagram = view.getDiagram();
+ } else if (view instanceof View) {
+ diagram = ((View)view).getDiagram();
}
if (diagram != null && !diagram.equals(currentDiag)) {
currentDiag = diagram;
@@ -194,206 +247,76 @@ class DiagramMergeViewer extends AbstractGraphicalMergeViewer {
final DiagramRootEditPart rootEditPart = new DiagramRootEditPart(diagram.getMeasurementUnit());
fGraphicalViewer.setRootEditPart(rootEditPart);
fGraphicalViewer.setContents(diagram);
- disableEditMode((DiagramEditPart)fGraphicalViewer.getContents());
rootEditPart.getZoomManager().setZoomAnimationStyle(ZoomManager.ANIMATE_NEVER);
rootEditPart.getZoomManager().setZoom(ZOOM_FACTOR);
+
}
}
return (EditPart)fGraphicalViewer.getEditPartRegistry().get(view);
}
- public EditPart findEditPart(final EObject eobj) {
- // check viewer
- if (eobj instanceof View) {
- final Diagram d = ((View)eobj).getDiagram();
- checkAndDisplayDiagram(d);
- }
- return (EditPart)fGraphicalViewer.getEditPartRegistry().get(eobj);
- }
-
- private void checkAndDisplayDiagram(final Diagram d) {
- if (d != null && !d.equals(currentDiag)) {
- currentDiag = d;
- displayDiagram(d);
- }
- }
-
- protected final void displayDiagram(final Diagram diag) {
- if (diag == null) {
- return;
- }
- currentDiag = diag;
- // be sure the viewer will be correctly refreshed ( connections )
- fGraphicalViewer.getEditPartRegistry().clear();
- final DiagramRootEditPart rootEditPart = new DiagramRootEditPart(diag.getMeasurementUnit());
- fGraphicalViewer.setRootEditPart(rootEditPart);
- fGraphicalViewer.setContents(diag);
- disableEditMode((DiagramEditPart)fGraphicalViewer.getContents());
- rootEditPart.getZoomManager().setZoomAnimationStyle(ZoomManager.ANIMATE_NEVER);
- rootEditPart.getZoomManager().setZoom(ZOOM_FACTOR);
- }
-
- private void disableEditMode(DiagramEditPart diagEditPart) {
- diagEditPart.disableEditMode();
- for (Object obj : diagEditPart.getPrimaryEditParts()) {
- if (obj instanceof IGraphicalEditPart) {
- disableEditMode((IGraphicalEditPart)obj);
- }
- }
- }
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#refresh()
+ */
+ @Override
+ public void refresh() {
- private void disableEditMode(IGraphicalEditPart obj) {
- obj.disableEditMode();
- obj.removeEditPolicy(EditPolicyRoles.OPEN_ROLE);
- for (Object child : obj.getChildren()) {
- if (child instanceof IGraphicalEditPart) {
- disableEditMode((IGraphicalEditPart)child);
- }
- }
}
/**
- * Inner class for visit dagramDiffs.
+ * {@link DiagramGraphicalViewer} which enables to make a reveal on a given figure, without editpart.
*
- * @author <a href="mailto:stephane.bouchet@obeo.fr">Stephane Bouchet</a>
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
- private class DiagramdiffSwitchVisitor extends DiagramCompareSwitch<IStatus> {
-
- private View view;
-
- private boolean annotate;
-
- public DiagramdiffSwitchVisitor(View view, boolean annotate) {
- this.view = view;
- this.annotate = annotate;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.diagramdiff.util.DiagramdiffSwitch#caseDiagramLabelChange(org.eclipse.emf.compare.diagram.diagramdiff.DiagramLabelChange)
- */
- @Override
- public IStatus caseLabelChange(LabelChange diff) {
- return checkResult(annotateNotation(view, DiffDecoratorProvider.DIFF_LABEL_MODIFIED));
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.diagramdiff.util.DiagramdiffSwitch#caseDiagramShowElement(org.eclipse.emf.compare.diagram.diagramdiff.DiagramShowElement)
- */
- @Override
- public IStatus caseShow(Show diff) {
- return checkResult(annotateNotation(view, DiffDecoratorProvider.DIFF_SHOWED));
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.diagramdiff.util.DiagramdiffSwitch#caseDiagramHideElement(org.eclipse.emf.compare.diagram.diagramdiff.DiagramHideElement)
- */
- @Override
- public IStatus caseHide(Hide diff) {
- return checkResult(annotateNotation(view, DiffDecoratorProvider.DIFF_SHOWED));
- }
+ public class DiagramGraphicalViewerForCompare extends DiagramGraphicalViewer {
/**
- * {@inheritDoc}
+ * It reveals the given figure. It is a partial copy of
+ * {@link DiagramGraphicalViewer#reveal(EditPart)}.<br>
+ * FIXME: Find a better solution to make the reveal.
*
- * @see org.eclipse.emf.compare.diagram.diagramdiff.util.DiagramdiffSwitch#caseDiagramMoveNode(org.eclipse.emf.compare.diagram.diagramdiff.DiagramMoveNode)
+ * @param figure
+ * The figure.
*/
- @Override
- public IStatus caseNodeChange(NodeChange diff) {
- boolean result = true;
- if (diff.getKind() == DifferenceKind.MOVE) {
- return checkResult(annotateNotation(view, DiffDecoratorProvider.DIFF_MOVED));
- } else if (diff.getKind() == DifferenceKind.ADD) {
- return checkResult(annotateNotation(view, DiffDecoratorProvider.DIFF_ADDED));
- } else if (diff.getKind() == DifferenceKind.DELETE) {
- return checkResult(annotateNotation(view, DiffDecoratorProvider.DIFF_REMOVED));
+ public void reveal(IFigure figure) {
+ IFigure target = figure;
+ Viewport port = getFigureCanvas().getViewport();
+ Rectangle exposeRegion = target.getBounds().getCopy();
+ target = target.getParent();
+ while (target != null && target != port) {
+ target.translateToParent(exposeRegion);
+ target = target.getParent();
}
- return checkResult(result);
- }
+ exposeRegion.expand(5, 5);
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.diagramdiff.util.DiagramdiffSwitch#caseDiagramEdgeChange(org.eclipse.emf.compare.diagram.diagramdiff.DiagramEdgeChange)
- */
- @Override
- public IStatus caseEdgeChange(EdgeChange diff) {
- return checkResult(annotateNotation(view, DiffDecoratorProvider.DIFF_MOVED));
- }
+ Dimension viewportSize = port.getClientArea().getSize();
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.diagramdiff.util.DiagramdiffSwitch#defaultCase(org.eclipse.emf.ecore.EObject)
- */
- @Override
- public IStatus defaultCase(EObject diff) {
- // we don't care about generic diffs
- return Status.OK_STATUS;
- }
-
- /**
- * Set the given annotation to the given notation element.
- *
- * @param element
- * the notation element to annotate
- * @param annotation
- * the diff annotation
- * @return true if annotation has been added to the view
- */
- protected boolean annotateNotation(View element, String annotation) {
- boolean result = false;
- if (annotate) {
- EAnnotation diffAnnotation = null;
- if (element.getEAnnotation(DiffDecoratorProvider.DIFF) == null) {
- diffAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
- diffAnnotation.setSource(DiffDecoratorProvider.DIFF);
- result = element.getEAnnotations().add(diffAnnotation);
- } else {
- diffAnnotation = element.getEAnnotation(DiffDecoratorProvider.DIFF);
- }
- // FIXME should this string be externalized?
- diffAnnotation.getDetails().put(annotation, "diffDetail"); //$NON-NLS-1$
- result = true;
+ Point topLeft = exposeRegion.getTopLeft();
+ Point bottomRight = exposeRegion.getBottomRight().translate(viewportSize.getNegated());
+ Point finalLocation = new Point();
+ if (viewportSize.width < exposeRegion.width) {
+ finalLocation.x = Math.min(bottomRight.x, Math.max(topLeft.x, port.getViewLocation().x));
} else {
- if (element.getEAnnotation(DiffDecoratorProvider.DIFF) != null) {
- final EAnnotation diffAnnotation = element.getEAnnotation(DiffDecoratorProvider.DIFF);
- result = element.getEAnnotations().remove(diffAnnotation);
- }
+ finalLocation.x = Math.min(topLeft.x, Math.max(bottomRight.x, port.getViewLocation().x));
}
- return result;
- }
- /**
- * Utility method to transform a boolean result into status.
- *
- * @param ok
- * the boolean state
- * @return a status corresponding to the state of the boolean
- */
- protected IStatus checkResult(boolean ok) {
- if (ok) {
- return Status.OK_STATUS;
+ if (viewportSize.height < exposeRegion.height) {
+ finalLocation.y = Math.min(bottomRight.y, Math.max(topLeft.y, port.getViewLocation().y));
+ } else {
+ finalLocation.y = Math.min(topLeft.y, Math.max(bottomRight.y, port.getViewLocation().y));
}
- return Status.CANCEL_STATUS;
- }
- }
+ getFigureCanvas().scrollSmoothTo(finalLocation.x, finalLocation.y);
- private boolean hasSelectedDiffAdapter(View view) {
- Iterator<Adapter> adapters = view.eAdapters().iterator();
- while (adapters.hasNext()) {
- Adapter adapter = adapters.next();
- if (adapter.isAdapterForType(DiagramDiff.class)) {
- return true;
- }
}
- return false;
+
+ @Override
+ protected DomainEventDispatcher getEventDispatcher() {
+ return new NonEditingEventDispatcher(editDomain, this);
+ }
+
}
}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/diagram_ide_ui_messages.properties b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/diagram_ide_ui_messages.properties
index d04add314..34885779b 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/diagram_ide_ui_messages.properties
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/diagram_ide_ui_messages.properties
@@ -1,5 +1,5 @@
################################################################################
-# Copyright (c) 2012 Obeo.
+# Copyright (c) 2013 Obeo.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -9,5 +9,3 @@
# Obeo - initial API and implementation
################################################################################
## ! note ! double the apostrophes if you need one in the printed String
-
-DiffDecoratorProvider.UnknownView = Unable to decorate target view : {0}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/preferences/DiagramComparePreferencesPage.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/preferences/DiagramComparePreferencesPage.java
index 8c48084be..c8daf09bd 100644
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/preferences/DiagramComparePreferencesPage.java
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/internal/preferences/DiagramComparePreferencesPage.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.emf.compare.diagram.ide.ui.internal.preferences;
-import org.eclipse.emf.compare.diagram.diff.util.DiagramCompareConstants;
-import org.eclipse.emf.compare.diagram.diff.util.DiagramCompareUIMessages;
-import org.eclipse.emf.compare.diagram.ide.GMFCompareIDEPlugin;
+import org.eclipse.emf.compare.diagram.ide.ui.internal.CompareDiagramIDEUIPlugin;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramConstants;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramUIMessages;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IntegerFieldEditor;
import org.eclipse.swt.SWT;
@@ -34,8 +34,8 @@ public class DiagramComparePreferencesPage extends FieldEditorPreferencePage imp
*/
public DiagramComparePreferencesPage() {
super(GRID);
- setPreferenceStore(GMFCompareIDEPlugin.getDefault().getPreferenceStore());
- setDescription(DiagramCompareUIMessages.getString("DiagramComparePreferencesPage.description")); //$NON-NLS-1$
+ setPreferenceStore(CompareDiagramIDEUIPlugin.getDefault().getPreferenceStore());
+ setDescription(CompareDiagramUIMessages.getString("DiagramComparePreferencesPage.description")); //$NON-NLS-1$
}
/**
@@ -43,7 +43,7 @@ public class DiagramComparePreferencesPage extends FieldEditorPreferencePage imp
*/
public void createDiagramComparisonGroup() {
final Group diagramGroup = new Group(getFieldEditorParent(), SWT.SHADOW_ETCHED_IN);
- diagramGroup.setText(DiagramCompareUIMessages
+ diagramGroup.setText(CompareDiagramUIMessages
.getString("DiagramComparePreferencesPage.diagramComparisonGroupTitle")); //$NON-NLS-1$
diagramGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -53,8 +53,8 @@ public class DiagramComparePreferencesPage extends FieldEditorPreferencePage imp
diagramGroup.setLayout(diagramLayout);
diagramGroup.setFont(getFieldEditorParent().getFont());
- addField(new IntegerFieldEditor(DiagramCompareConstants.PREFERENCES_KEY_MOVE_THRESHOLD,
- DiagramCompareConstants.PREFERENCES_DESCRIPTION_MOVE_THRESHOLD, diagramGroup, 3) {
+ addField(new IntegerFieldEditor(CompareDiagramConstants.PREFERENCES_KEY_MOVE_THRESHOLD,
+ CompareDiagramConstants.PREFERENCES_DESCRIPTION_MOVE_THRESHOLD, diagramGroup, 3) {
@Override
protected void adjustForNumColumns(int numColumns) {
// do nothing
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/mergeviewer/EditingDomainUtils.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/mergeviewer/EditingDomainUtils.java
deleted file mode 100644
index 01111351a..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/mergeviewer/EditingDomainUtils.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.ui.mergeviewer;
-
-import java.util.List;
-
-import org.eclipse.emf.compare.rcp.ui.mergeviewer.accessor.IEObjectAccessor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.edit.provider.IWrapperItemProvider;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gmf.runtime.diagram.core.DiagramEditingDomainFactory;
-
-/**
- * Utility Class to retrieve an editing domain.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
-public final class EditingDomainUtils {
-
- /**
- * Constructor.
- */
- private EditingDomainUtils() {
- // no-op
- }
-
- /**
- * Get or create an editing domain to handle the given object.
- *
- * @param object
- * The object.
- * @return The editing domain.
- */
- public static TransactionalEditingDomain getOrCreateEditingDomain(Object object) {
- EditingDomain editingDomain = getEditingDomainFor(object);
- if (editingDomain == null || !(editingDomain instanceof TransactionalEditingDomain)) {
- if (object instanceof EObject) {
- editingDomain = registerEditingDomain((EObject)object);
- } else if (object instanceof List<?>) {
- final List<?> list = (List<?>)object;
- for (Object object2 : list) {
- editingDomain = getOrCreateEditingDomain(object2);
- if (editingDomain != null) {
- break;
- }
- }
- } else if (object instanceof Resource) {
- editingDomain = registerEditingDomain((Resource)object);
- } else if (object instanceof ResourceSet) {
- editingDomain = registerEditingDomain((ResourceSet)object);
- } else {
- // XXX: fix this case
- }
- }
- return (TransactionalEditingDomain)editingDomain;
- }
-
- /**
- * Retrieve the editing domain for the given object.
- *
- * @param object
- * the object.
- * @return the editing domain.
- */
- private static EditingDomain getEditingDomainFor(Object object) {
- EditingDomain editingDomain = null;
- if (object instanceof IEditingDomainProvider) {
- editingDomain = ((IEditingDomainProvider)object).getEditingDomain();
- } else if (object instanceof EObject) {
- editingDomain = getEditingDomainFor((EObject)object);
- } else if (object instanceof FeatureMap.Entry) {
- editingDomain = getEditingDomainFor(((FeatureMap.Entry)object).getValue());
- } else if (object instanceof IWrapperItemProvider) {
- editingDomain = getEditingDomainFor(((IWrapperItemProvider)object).getValue());
- } else if (object instanceof IEObjectAccessor) {
- editingDomain = getEditingDomainFor(((IEObjectAccessor)object).getEObject());
- }
- return editingDomain;
-
- }
-
- /**
- * Retrieve the editing domain for the given {@link EObject}.
- *
- * @param object
- * The {@link EObject}
- * @return The editing domain.
- */
- private static EditingDomain getEditingDomainFor(EObject object) {
- final Resource resource = object.eResource();
- if (resource != null) {
- return getEditingDomainFor(resource);
- }
-
- return null;
- }
-
- /**
- * Retrieve the editing domain for the given {@link Resource}.
- *
- * @param resource
- * The {@link Resource}
- * @return The editing domain.
- */
- private static EditingDomain getEditingDomainFor(Resource resource) {
- EditingDomain editingDomain = null;
- final IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider)EcoreUtil
- .getExistingAdapter(resource, IEditingDomainProvider.class);
- if (editingDomainProvider != null) {
- editingDomain = editingDomainProvider.getEditingDomain();
- } else {
- final ResourceSet resourceSet = resource.getResourceSet();
- editingDomain = getEditingDomainFor(resourceSet);
- }
- return editingDomain;
- }
-
- /**
- * Retrieve the editing domain for the given {@link ResourceSet}.
- *
- * @param resourceSet
- * The {@link ResourceSet}
- * @return The editing domain.
- */
- private static EditingDomain getEditingDomainFor(ResourceSet resourceSet) {
- EditingDomain editingDomain = null;
- if (resourceSet instanceof IEditingDomainProvider) {
- editingDomain = ((IEditingDomainProvider)resourceSet).getEditingDomain();
- } else if (resourceSet != null) {
- final IEditingDomainProvider editingDomainProvider = (IEditingDomainProvider)EcoreUtil
- .getExistingAdapter(resourceSet, IEditingDomainProvider.class);
- if (editingDomainProvider != null) {
- editingDomain = editingDomainProvider.getEditingDomain();
- }
- }
- return editingDomain;
- }
-
- /**
- * Register the editing domain from the given {@link EObject}.
- *
- * @param eObject
- * The {@link EObject}
- * @return The editing domain.
- */
- private static TransactionalEditingDomain registerEditingDomain(EObject eObject) {
- TransactionalEditingDomain editingDomain = null;
- final Resource eResource = eObject.eResource();
- if (eResource != null) {
- editingDomain = registerEditingDomain(eResource);
- } else {
- // XXX: fix this case
- }
- return editingDomain;
- }
-
- /**
- * Register the editing domain from the given {@link Resource}.
- *
- * @param eResource
- * The {@link Resource}
- * @return The editing domain.
- */
- private static TransactionalEditingDomain registerEditingDomain(Resource eResource) {
- TransactionalEditingDomain editingDomain = null;
- final ResourceSet resourceSet = eResource.getResourceSet();
- if (resourceSet != null) {
- editingDomain = registerEditingDomain(resourceSet);
- } else {
- // XXX: fix this case
- }
- return editingDomain;
- }
-
- /**
- * Register the editing domain from the given {@link ResourceSet}.
- *
- * @param resourceSet
- * The {@link ResourceSet}
- * @return The editing domain.
- */
- private static TransactionalEditingDomain registerEditingDomain(ResourceSet resourceSet) {
- return DiagramEditingDomainFactory.getInstance().createEditingDomain(resourceSet);
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/structuremergeviewer/filters/GMFRefinedElementsFilter.java b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/structuremergeviewer/filters/GMFRefinedElementsFilter.java
new file mode 100644
index 000000000..8f56df68a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram.ide.ui/src/org/eclipse/emf/compare/diagram/ide/ui/structuremergeviewer/filters/GMFRefinedElementsFilter.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.ide.ui.structuremergeviewer.filters;
+
+import static com.google.common.base.Predicates.instanceOf;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.AbstractDifferenceFilter;
+import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A filter used by default that filtered out refined GMF differences.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
+ */
+public class GMFRefinedElementsFilter extends AbstractDifferenceFilter {
+
+ /**
+ * The predicate use by this filter when it is selected.
+ */
+ private static final Predicate<? super EObject> predicateWhenSelected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ if (input instanceof Diff) {
+ Diff diff = (Diff)input;
+ return Iterables.any(diff.getRefines(), instanceOf(DiagramDiff.class));
+ }
+ return false;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
+ * org.eclipse.emf.compare.Comparison)
+ */
+ @Override
+ public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
+ if (scope != null) {
+ for (String nsURI : scope.getNsURIs()) {
+ if (nsURI.startsWith("http://www\\.eclipse\\.org/gmf/")) { //$NON-NLS-1$
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
+ */
+ @Override
+ public Predicate<? super EObject> getPredicateWhenSelected() {
+ return predicateWhenSelected;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/.classpath b/plugins/org.eclipse.emf.compare.diagram.ide/.classpath
deleted file mode 100644
index 2d1a4302f..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/.project b/plugins/org.eclipse.emf.compare.diagram.ide/.project
deleted file mode 100644
index bd7c02531..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.emf.compare.diagram.ide</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
- </natures>
-</projectDescription>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 44217f8c0..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,7 +0,0 @@
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.pde.api.tools.prefs b/plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.pde.api.tools.prefs
deleted file mode 100644
index c2991f347..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/.settings/org.eclipse.pde.api.tools.prefs
+++ /dev/null
@@ -1,97 +0,0 @@
-ANNOTATION_ELEMENT_TYPE_ADDED_METHOD_WITHOUT_DEFAULT_VALUE=Warning
-ANNOTATION_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_FIELD=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_METHOD=Warning
-ANNOTATION_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_API_TYPE=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_API_TYPE=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_REEXPORTED_TYPE=Warning
-API_COMPONENT_ELEMENT_TYPE_REMOVED_TYPE=Warning
-API_USE_SCAN_FIELD_SEVERITY=Error
-API_USE_SCAN_METHOD_SEVERITY=Error
-API_USE_SCAN_TYPE_SEVERITY=Error
-CLASS_ELEMENT_TYPE_ADDED_METHOD=Warning
-CLASS_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
-CLASS_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-CLASS_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
-CLASS_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-CLASS_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
-CLASS_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
-CLASS_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-CLASS_ELEMENT_TYPE_REMOVED_CONSTRUCTOR=Warning
-CLASS_ELEMENT_TYPE_REMOVED_FIELD=Warning
-CLASS_ELEMENT_TYPE_REMOVED_METHOD=Warning
-CLASS_ELEMENT_TYPE_REMOVED_SUPERCLASS=Warning
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-CLASS_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-CONSTRUCTOR_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-CONSTRUCTOR_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
-CONSTRUCTOR_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-ENUM_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
-ENUM_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-ENUM_ELEMENT_TYPE_REMOVED_ENUM_CONSTANT=Warning
-ENUM_ELEMENT_TYPE_REMOVED_FIELD=Warning
-ENUM_ELEMENT_TYPE_REMOVED_METHOD=Warning
-ENUM_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-FIELD_ELEMENT_TYPE_ADDED_VALUE=Warning
-FIELD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-FIELD_ELEMENT_TYPE_CHANGED_FINAL_TO_NON_FINAL_STATIC_CONSTANT=Warning
-FIELD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
-FIELD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
-FIELD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
-FIELD_ELEMENT_TYPE_CHANGED_TYPE=Warning
-FIELD_ELEMENT_TYPE_CHANGED_VALUE=Warning
-FIELD_ELEMENT_TYPE_REMOVED_TYPE_ARGUMENT=Warning
-FIELD_ELEMENT_TYPE_REMOVED_VALUE=Warning
-ILLEGAL_EXTEND=Warning
-ILLEGAL_IMPLEMENT=Warning
-ILLEGAL_INSTANTIATE=Warning
-ILLEGAL_OVERRIDE=Warning
-ILLEGAL_REFERENCE=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_FIELD=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_METHOD=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_SUPER_INTERFACE_WITH_METHODS=Warning
-INTERFACE_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_CONTRACTED_SUPERINTERFACES_SET=Warning
-INTERFACE_ELEMENT_TYPE_CHANGED_TYPE_CONVERSION=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_FIELD=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_METHOD=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_MEMBER=Warning
-INTERFACE_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-INVALID_JAVADOC_TAG=Ignore
-INVALID_REFERENCE_IN_SYSTEM_LIBRARIES=Ignore
-LEAK_EXTEND=Warning
-LEAK_FIELD_DECL=Warning
-LEAK_IMPLEMENT=Warning
-LEAK_METHOD_PARAM=Warning
-LEAK_METHOD_RETURN_TYPE=Warning
-METHOD_ELEMENT_TYPE_ADDED_RESTRICTIONS=Warning
-METHOD_ELEMENT_TYPE_ADDED_TYPE_PARAMETER=Warning
-METHOD_ELEMENT_TYPE_CHANGED_DECREASE_ACCESS=Warning
-METHOD_ELEMENT_TYPE_CHANGED_NON_ABSTRACT_TO_ABSTRACT=Warning
-METHOD_ELEMENT_TYPE_CHANGED_NON_FINAL_TO_FINAL=Warning
-METHOD_ELEMENT_TYPE_CHANGED_NON_STATIC_TO_STATIC=Warning
-METHOD_ELEMENT_TYPE_CHANGED_STATIC_TO_NON_STATIC=Warning
-METHOD_ELEMENT_TYPE_CHANGED_VARARGS_TO_ARRAY=Warning
-METHOD_ELEMENT_TYPE_REMOVED_ANNOTATION_DEFAULT_VALUE=Warning
-METHOD_ELEMENT_TYPE_REMOVED_TYPE_PARAMETER=Warning
-MISSING_EE_DESCRIPTIONS=Error
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_CLASS_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_ADDED_INTERFACE_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_CLASS_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_CHANGED_INTERFACE_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_CLASS_BOUND=Warning
-TYPE_PARAMETER_ELEMENT_TYPE_REMOVED_INTERFACE_BOUND=Warning
-UNUSED_PROBLEM_FILTERS=Warning
-automatically_removed_unused_problem_filters=false
-eclipse.preferences.version=1
-incompatible_api_component_version=Warning
-incompatible_api_component_version_include_major_without_breaking_change=Disabled
-incompatible_api_component_version_include_minor_without_api_change=Disabled
-invalid_since_tag_version=Warning
-malformed_since_tag=Warning
-missing_since_tag=Warning
-report_api_breakage_when_major_version_incremented=Disabled
-report_resolution_errors_api_component=Warning
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram.ide/META-INF/MANIFEST.MF
deleted file mode 100644
index 2e4e56042..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,18 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.emf.compare.diagram.ide;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Activator: org.eclipse.emf.compare.diagram.ide.GMFCompareIDEPlugin
-Require-Bundle: org.eclipse.emf.compare;bundle-version="2.0.0",
- org.eclipse.emf.compare.diagram;bundle-version="2.0.0",
- org.eclipse.gmf.runtime.notation;bundle-version="1.2.0",
- org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.3.0",
- org.eclipse.emf.compare.ide;bundle-version="3.0.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Bundle-Vendor: %providerName
-Bundle-Localization: plugin
-Import-Package: com.google.common.base;version="10.0.1"
-Export-Package: org.eclipse.emf.compare.diagram.ide,
- org.eclipse.emf.compare.diagram.ide.diff
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/about.html b/plugins/org.eclipse.emf.compare.diagram.ide/about.html
deleted file mode 100644
index 670d10856..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/about.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
-<title>Eclipse Foundation Software User Agreement</title>
-</head>
-
-<body lang="EN-US">
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>April 14, 2010</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code
- repository (&quot;Repository&quot;) in software modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-
-<h3>Use of Provisioning Technology</h3>
-
-<p>The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse
- Update Manager (&quot;Provisioning Technology&quot;) for the purpose of allowing users to install software, documentation, information and/or
- other materials (collectively &quot;Installable Software&quot;). This capability is provided with the intent of allowing such users to
- install, extend and update Eclipse-based products. Information about packaging Installable Software is available at <a
- href="http://eclipse.org/equinox/p2/repository_packaging.html">http://eclipse.org/equinox/p2/repository_packaging.html</a>
- (&quot;Specification&quot;).</p>
-
-<p>You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the
- applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology
- in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the
- Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:</p>
-
-<ol>
- <li>A series of actions may occur (&quot;Provisioning Process&quot;) in which a user may execute the Provisioning Technology
- on a machine (&quot;Target Machine&quot;) with the intent of installing, extending or updating the functionality of an Eclipse-based
- product.</li>
- <li>During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be
- accessed and copied to the Target Machine.</li>
- <li>Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable
- Software (&quot;Installable Software Agreement&quot;) and such Installable Software Agreement shall be accessed from the Target
- Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern
- the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such
- indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.</li>
-</ol>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<p><small>Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.</small></p>
-</body>
-</html> \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/build.properties b/plugins/org.eclipse.emf.compare.diagram.ide/build.properties
deleted file mode 100644
index 31298fbcf..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/build.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.properties,\
- schema/,\
- src/,\
- about.html
-src.includes = about.html,\
- schema/
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/plugin.xml b/plugins/org.eclipse.emf.compare.diagram.ide/plugin.xml
deleted file mode 100644
index 3deebc005..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/plugin.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
- <extension-point id="org.eclipse.emf.compare.diagram.ide.viewLabelProvider" name="View Label Provider" schema="schema/viewLabelProvider.exsd"/>
- <extension
- point="org.eclipse.emf.compare.postProcessor">
- <postProcessor
- class="org.eclipse.emf.compare.diagram.ide.diff.DiagramDiffIDEExtensionPostProcessor">
- <nsURI
- value="http://www.eclipse.org/gmf/runtime/\d.\d.\d/notation">
- </nsURI>
- </postProcessor>
- </extension>
-</plugin>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/pom.xml b/plugins/org.eclipse.emf.compare.diagram.ide/pom.xml
deleted file mode 100644
index b7119f841..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/pom.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>emf.compare-parent</artifactId>
- <groupId>org.eclipse.emf.compare</groupId>
- <version>2.1.0-SNAPSHOT</version>
- <relativePath>../../org.eclipse.emf.compare-parent</relativePath>
- </parent>
- <groupId>org.eclipse.emf.compare</groupId>
- <artifactId>org.eclipse.emf.compare.diagram.ide</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.eclipse.tycho</groupId>
- <artifactId>tycho-source-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/schema/viewLabelProvider.exsd b/plugins/org.eclipse.emf.compare.diagram.ide/schema/viewLabelProvider.exsd
deleted file mode 100644
index d1db61a66..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/schema/viewLabelProvider.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.emf.compare.diagram.ide" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.emf.compare.diagram.ide" id="viewLabelProvider" name="View Label Provider"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="viewLabelProvider" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="viewLabelProvider">
- <complexType>
- <attribute name="diagramType" type="string" use="required">
- <annotation>
- <documentation>
- The supported diagram type
- </documentation>
- </annotation>
- </attribute>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- The fully qualified Java class name of an view label type provider.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.emf.compare.diagram.provider.IViewLabelProvider"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- [Enter the first release in which this extension point appears.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/GMFCompareIDEPlugin.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/GMFCompareIDEPlugin.java
deleted file mode 100644
index 9dbbea0f0..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/GMFCompareIDEPlugin.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.eclipse.emf.compare.diagram.ide;
-
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.compare.diagram.diff.DiagramComparisonConfiguration;
-import org.eclipse.emf.compare.diagram.diff.DiagramDiffExtensionPostProcessor;
-import org.eclipse.emf.compare.diagram.diff.util.DiagramCompareConstants;
-import org.eclipse.emf.compare.diagram.provider.ViewLabelProviderExtensionRegistry;
-import org.eclipse.emf.compare.diagram.provider.internal.ViewLabelProviderRegistryListener;
-import org.eclipse.emf.compare.extension.PostProcessorDescriptor;
-import org.eclipse.emf.compare.extension.PostProcessorRegistry;
-import org.eclipse.emf.compare.ide.EMFCompareIDEPlugin;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-public class GMFCompareIDEPlugin extends AbstractUIPlugin {
-
- /** The plug-in ID. */
- public static final String PLUGIN_ID = "org.eclipse.emf.compare.diagram.ide"; //$NON-NLS-1$
-
- /** This plugin's shared instance. */
- private static GMFCompareIDEPlugin plugin;
-
- /** The registry listener that will be used to listen to extension changes. */
- private ViewLabelProviderRegistryListener registryListener = new ViewLabelProviderRegistryListener();
-
- private DiagramComparisonConfiguration configuration;
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext context) throws Exception {
- plugin = this;
- super.start(context);
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
- registry.addListener(registryListener, ViewLabelProviderRegistryListener.VIEW_LABELPROVIDER_EXTENSION_POINT);
- registryListener.parseInitialContributions();
-
- configuration = new DiagramComparisonConfiguration();
- getPreferenceStore().addPropertyChangeListener(new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- // XXX: does it work ?
-
- if (DiagramCompareConstants.PREFERENCES_KEY_MOVE_THRESHOLD.equals(event.getProperty())) {
- Object newValue = event.getNewValue();
- if (newValue != null) {
- configuration.setMoveThreshold((Integer)newValue);
- } else {
- configuration.setMoveThreshold(0);
- }
- }
- }
- });
- configuration.setMoveThreshold(getPreferenceStore().getInt(DiagramCompareConstants.PREFERENCES_KEY_MOVE_THRESHOLD));
-
- PostProcessorRegistry postProcessorRegistry = EMFCompareIDEPlugin.getDefault().getPostProcessorRegistry();
- for (PostProcessorDescriptor descriptor : postProcessorRegistry.getRegisteredPostProcessors()) {
- if (descriptor.getExtensionClassName().equals(DiagramDiffExtensionPostProcessor.class.getName())) {
- DiagramDiffExtensionPostProcessor postProcessor = (DiagramDiffExtensionPostProcessor)descriptor.getPostProcessor();
- postProcessor.setConfiguration(configuration);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext context) throws Exception {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
- registry.removeListener(registryListener);
- ViewLabelProviderExtensionRegistry.clearRegistry();
-
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- *
- * @return the shared instance
- */
- public static GMFCompareIDEPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffIDEExtensionPostProcessor.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffIDEExtensionPostProcessor.java
deleted file mode 100644
index 95cb8805c..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/DiagramDiffIDEExtensionPostProcessor.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package org.eclipse.emf.compare.diagram.ide.diff;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.common.util.Monitor;
-import org.eclipse.emf.compare.CompareFactory;
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Conflict;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.DifferenceSource;
-import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.diagram.DiagramCompareFactory;
-import org.eclipse.emf.compare.diagram.LabelChange;
-import org.eclipse.emf.compare.diagram.diff.util.GMFLabelUtil;
-import org.eclipse.emf.compare.diagram.ide.GMFCompareIDEPlugin;
-import org.eclipse.emf.compare.diagram.ide.diff.internal.extension.IDiffExtensionFactory;
-import org.eclipse.emf.compare.diagram.provider.IViewLabelProvider;
-import org.eclipse.emf.compare.diagram.provider.ViewLabelProviderExtensionRegistry;
-import org.eclipse.emf.compare.extension.IPostProcessor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-
-public class DiagramDiffIDEExtensionPostProcessor implements IPostProcessor {
-
- private Set<IDiffExtensionFactory> diagramExtensionFactories;
-
- public DiagramDiffIDEExtensionPostProcessor() {
- // TODO Auto-generated constructor stub
- }
-
- public void postMatch(Comparison comparison, Monitor monitor) {
- // TODO Auto-generated method stub
-
- }
-
- public void postDiff(Comparison comparison, Monitor monitor) {
- // TODO Auto-generated method stub
-
- }
-
- public void postRequirements(Comparison comparison, Monitor monitor) {
- // computeLabels
- computeLabels(comparison);
- }
-
- public void postEquivalences(Comparison comparison, Monitor monitor) {
- // TODO Auto-generated method stub
-
- }
-
- public void postConflicts(Comparison comparison, Monitor monitor) {
- // TODO Auto-generated method stub
-
- }
-
- private void computeLabels(Comparison comparison) {
- final Iterator<Match> matches = getAllMatches(comparison).iterator();
- while (matches.hasNext()) {
- final Match match = (Match)matches.next();
-
- final EObject leftElement = match.getLeft();
-
- if (leftElement instanceof View) {
- LabelChange diff = null;
- final EObject rightElement = match.getRight();
- final View view = (View)leftElement;
- final Diagram diagram = view.getDiagram();
-
- if (diagram != null) {
- final String diagramType = diagram.getType();
-
- IViewLabelProvider extensionForType = ViewLabelProviderExtensionRegistry.getExtensionForType(diagramType);
-
- if (extensionForType == null) { // no extension registered for handling label in this
- // diagram,
- // use the default one
- GMFCompareIDEPlugin.getDefault().getLog().log(
- new Status(IStatus.INFO, GMFCompareIDEPlugin.PLUGIN_ID,
- "No IViewLabelProvider registered for diagram " + diagramType)); //$NON-NLS-1$
- extensionForType = IViewLabelProvider.DEFAULT_INSTANCE;
- }
- if (rightElement instanceof View && extensionForType.isManaged(view) && isVisible(view)
- && isVisible((View)rightElement)) {
- final String leftLabel = extensionForType.elementLabel(view);
- final String rightLabel = extensionForType.elementLabel((View)rightElement);
- if (!leftLabel.equals(rightLabel)) {
- diff = DiagramCompareFactory.eINSTANCE.createLabelChange();
- diff.setKind(DifferenceKind.CHANGE);
- diff.setLeft(leftLabel);
- diff.setRight(rightLabel);
- diff.setView(leftElement);
- if (match.eContainer() instanceof Match) {
- ((Match) match.eContainer()).getDifferences().add(diff);
- } else {
- match.getDifferences().add(diff);
- }
- }
- }
- }
-
- if (comparison.isThreeWay() && diff != null) {
- final EObject ancestor = match.getOrigin();
- if (ancestor instanceof View) {
- final ITextAwareEditPart ancestorEp = GMFLabelUtil.getTextEditPart((View)ancestor);
- if (ancestorEp != null) {
- final String ancestorLabel = ancestorEp.getEditText();
- final String leftLabel = diff.getLeft();
- final String rightLabel = diff.getRight();
- if (ancestorLabel.equals(leftLabel)) {
- diff.setSource(DifferenceSource.RIGHT);
- diff.setView(rightElement);
- } else if (!ancestorLabel.equals(rightLabel)) {
- diff.setView(leftElement);
- final Conflict conflict = CompareFactory.eINSTANCE.createConflict();
- conflict.getDifferences().add(diff);
- comparison.getConflicts().add(conflict);
- }
- }
-
- }
- }
- }
- }
- GMFLabelUtil.cleanup();
- }
-
- /**
- * Checks if the view is visible.
- *
- * @param view
- * The tested view.
- * @return True if visible.
- */
- public static boolean isVisible(View view) {
- boolean result = view.isVisible();
- if (result) {
- final View container = getNextParent(view);
- if (container != null) {
- result = isVisible(container);
- }
- }
- return result;
- }
-
- /**
- * Get the closest parent view.
- *
- * @param obj
- * The current view.
- * @return The parent view.
- */
- private static View getNextParent(EObject obj) {
- View result = null;
- if (obj != null) {
- final EObject parent = obj.eContainer();
- if (parent instanceof View) {
- result = (View)parent;
- } else {
- result = getNextParent(parent);
- }
- }
- return result;
- }
-
- private List<Match> getAllMatches(Comparison comparison) {
- final List<Match> result = new ArrayList<Match>();
- final Iterator<Match> matches = comparison.getMatches().iterator();
- while (matches.hasNext()) {
- final Match match = (Match)matches.next();
- result.add(match);
- final Iterator<Match> subMatches = match.getAllSubmatches().iterator();
- while (subMatches.hasNext()) {
- Match match2 = (Match)subMatches.next();
- result.add(match2);
- }
- }
- return result;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/AbstractDiffExtensionFactory.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/AbstractDiffExtensionFactory.java
deleted file mode 100644
index c539bdfa4..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/AbstractDiffExtensionFactory.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.diff.internal.extension;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.compare.AttributeChange;
-import org.eclipse.emf.compare.CompareFactory;
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.ResourceAttachmentChange;
-import org.eclipse.emf.compare.util.CompareSwitch;
-import org.eclipse.emf.ecore.EObject;
-
-import com.google.common.base.Predicate;
-
-/**
- * Factory for the difference extensions.
- */
-public abstract class AbstractDiffExtensionFactory implements IDiffExtensionFactory {
-
- private final Predicate<Diff> REFINING_PREDICATE = new Predicate<Diff>() {
- public boolean apply(Diff diff) {
- return isPartOfRefiningDifference(diff);
- }
- };
-
- private CompareSwitch<DifferenceKind> differenceKindCompareSwitch = new CompareSwitch<DifferenceKind>() {
-
- @Override
- public DifferenceKind caseAttributeChange(AttributeChange object) {
- if (isRelatedToAnExtensionAdd(object)) {
- return DifferenceKind.ADD;
- } else if (isRelatedToAnExtensionDelete(object)) {
- return DifferenceKind.DELETE;
- } else if (isRelatedToAnExtensionChange(object)) {
- return DifferenceKind.CHANGE;
- } else if (isRelatedToAnExtensionMove(object)) {
- return DifferenceKind.MOVE;
- } else {
- return super.caseAttributeChange(object);
- }
- }
-
- @Override
- public DifferenceKind caseReferenceChange(ReferenceChange object) {
- if (isRelatedToAnExtensionAdd(object)) {
- return DifferenceKind.ADD;
- } else if (isRelatedToAnExtensionDelete(object)) {
- return DifferenceKind.DELETE;
- } else if (isRelatedToAnExtensionChange(object)) {
- return DifferenceKind.CHANGE;
- } else if (isRelatedToAnExtensionMove(object)) {
- return DifferenceKind.MOVE;
- } else {
- return super.caseReferenceChange(object);
- }
- }
-
- @Override
- public DifferenceKind caseResourceAttachmentChange(ResourceAttachmentChange object) {
- if (isRelatedToAnExtensionAdd(object)) {
- return DifferenceKind.ADD;
- } else if (isRelatedToAnExtensionDelete(object)) {
- return DifferenceKind.DELETE;
- } else if (isRelatedToAnExtensionChange(object)) {
- return DifferenceKind.CHANGE;
- } else if (isRelatedToAnExtensionMove(object)) {
- return DifferenceKind.MOVE;
- } else {
- return super.caseResourceAttachmentChange(object);
- }
- }
- };
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.uml2.diff.internal.extension.IDiffExtensionFactory#handles(org.eclipse.emf.compare.diff.metamodel.DiffElement)
- */
- public boolean handles(Diff input) {
- return getRelatedExtensionKind(input) != null && !isExtensionAlreadyExist(input)
- && !isChangeOnAddOrDelete(input);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.uml2.diff.internal.extension.IDiffExtensionFactory#create(org.eclipse.emf.
- * compare.diff.metamodel.DiffElement)
- */
- public Diff create(Diff input) {
-
- final Diff ret = createExtension();
-
- final EObject discriminant = getDiscriminantFromDiff(input);
-
- final DifferenceKind extensionKind = getRelatedExtensionKind(input);
-
- if (discriminant != null) {
- if (extensionKind == DifferenceKind.DELETE) {
- ret.getRefinedBy().add(input);
- } else {
- fillRefiningDifferences(input.getMatch().getComparison(), ret, discriminant);
- }
- }
-
- // ret.setDiscriminant(discriminant);
- ret.setKind(extensionKind);
- if (extensionKind == DifferenceKind.ADD || extensionKind == DifferenceKind.DELETE) {
- if (input instanceof ReferenceChange) {
- // ret.setEReference(((ReferenceChange)input).getReference());
- }
- }
-
- ret.setSource(input.getSource());
-
- return ret;
- }
-
- protected void fillRefiningDifferences(final Comparison comparison, final Diff diffExtension,
- final EObject discriminant) {
- // Find Diffs through ComparePackage.Literals.REFERENCE_CHANGE__VALUE
- for (EObject elt : getPotentialChangedValuesFromDiscriminant(discriminant)) {
- beRefinedByCrossReferences(comparison, elt, diffExtension, REFINING_PREDICATE);
- }
- }
-
- public void fillRequiredDifferences(Comparison comparison, Diff extension) {
- if (getExtensionKind().isInstance(extension)) {
- // final EObject discriminant = extension.getDiscriminant();
- // if (discriminant != null) {
- // if (extension.getKind().equals(DifferenceKind.CHANGE)) {
- // extension.getRequires()
- // .addAll(findCrossReferences(comparison, discriminant,
- // REQUIRES_ADD_DISCRIMINANT_PREDICATE));
- // } else if (extension.getKind().equals(DifferenceKind.DELETE)) {
- // extension.getRequires().addAll(
- // findCrossReferences(comparison, discriminant,
- // REQUIRES_CHANGE_DISCRIMINANT_PREDICATE));
- // }
- // }
- }
- }
-
- public Match getParentMatch(Diff input) {
- return input.getMatch();
- }
-
- protected Diff createExtension() {
- return CompareFactory.eINSTANCE.createDiff();
- }
-
- protected boolean isPartOfRefiningDifference(Diff diff) {
- return diff instanceof ReferenceChange && getRelatedExtensionKind(diff) == DifferenceKind.CHANGE;
- }
-
- private boolean isExtensionAlreadyExist(Diff input) {
- return false;
- }
-
- private boolean isChangeOnAddOrDelete(Diff input) {
- if (getRelatedExtensionKind(input) == DifferenceKind.CHANGE) {
- final List<Diff> differences = input.getMatch().getComparison().getDifferences();
- differences.remove(input);
- for (Diff diff : differences) {
- if ((getRelatedExtensionKind(diff) == DifferenceKind.ADD || getRelatedExtensionKind(diff) == DifferenceKind.DELETE)
- && getDiscriminantFromDiff(diff) == getDiscriminantFromDiff(input)) {
- return true;
- }
- }
- }
- return false;
- }
-
- protected EObject getDiscriminantFromDiff(Diff input) {
- return null;
- }
-
- protected List<EObject> getPotentialChangedValuesFromDiscriminant(EObject discriminant) {
- return Collections.EMPTY_LIST;
- }
-
- protected DifferenceKind getRelatedExtensionKind(Diff input) {
- return differenceKindCompareSwitch.doSwitch(input);
- }
-
- protected boolean isRelatedToAnExtensionAdd(ReferenceChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionDelete(ReferenceChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionChange(ReferenceChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionMove(ReferenceChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionAdd(AttributeChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionDelete(AttributeChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionChange(AttributeChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionMove(AttributeChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionAdd(ResourceAttachmentChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionDelete(ResourceAttachmentChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionChange(ResourceAttachmentChange input) {
- return false;
- }
-
- protected boolean isRelatedToAnExtensionMove(ResourceAttachmentChange input) {
- return false;
- }
-
- /**
- * Find the cross references of the given model object, through the specified feature, with a cross
- * referencer and a predicate.
- *
- * @param comparison
- * The comparison.
- * @param lookup
- * The model object.
- * @param inFeature
- * The feature.
- * @param p
- * The predicate.
- * @param crossReferencer
- * The cross referencer.
- * @return The cross references.
- */
- protected final List<Diff> findCrossReferences(Comparison comparison, EObject lookup, Predicate<Diff> p) {
- final List<Diff> result = new ArrayList<Diff>();
- for (Diff diff : comparison.getDifferences(lookup)) {
- if (p.apply(diff)) {
- result.add(diff);
- }
- }
- return result;
- }
-
- /**
- * Hide the difference elements from the given extension, from the specified model object, the feature and
- * cross referencer, with a predicate.
- *
- * @param lookup
- * The model object.
- * @param inFeature
- * The feature.
- * @param hiddingExtension
- * The extension
- * @param p
- * The predicate
- * @param crossReferencer
- * The cross referencer.
- */
- protected final void beRefinedByCrossReferences(Comparison comparison, EObject lookup,
- Diff refinedExtension, Predicate<Diff> p) {
- for (Diff diffElement : findCrossReferences(comparison, lookup, p)) {
- refinedExtension.getRefinedBy().add(diffElement);
- }
- }
-
- public Class<? extends Diff> getExtensionKind() {
- return Diff.class;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/DiffExtensionFactoryRegistry.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/DiffExtensionFactoryRegistry.java
deleted file mode 100644
index cb1aeb52c..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/DiffExtensionFactoryRegistry.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.diff.internal.extension;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.compare.Diff;
-
-/**
- * Registry of all {@link IDiffExtensionFactory}.
- */
-public final class DiffExtensionFactoryRegistry {
-
- /**
- * Constructor.
- */
- private DiffExtensionFactoryRegistry() {
- // TODO Auto-generated constructor stub
- }
-
- /**
- * Creates and returns all {@link IDiffExtensionFactory} available in this plugin. The returned Set in
- * unmodifiable.
- *
- * @param engine
- * The UML2 difference engine.
- * @return an unmodifiable set of all {@link IDiffExtensionFactory}.
- */
- public static Map<Class<? extends Diff>, IDiffExtensionFactory> createExtensionFactories() {
- final Map<Class<? extends Diff>, IDiffExtensionFactory> dataset = new HashMap<Class<? extends Diff>, IDiffExtensionFactory>();
-
- List<IDiffExtensionFactory> factories = new ArrayList<IDiffExtensionFactory>();
-
- for (IDiffExtensionFactory iDiffExtensionFactory : factories) {
- dataset.put(iDiffExtensionFactory.getExtensionKind(), iDiffExtensionFactory);
- }
-
- return Collections.unmodifiableMap(dataset);
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/IDiffExtensionFactory.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/IDiffExtensionFactory.java
deleted file mode 100644
index 5a824ad7b..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/ide/diff/internal/extension/IDiffExtensionFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.ide.diff.internal.extension;
-
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.Match;
-
-/**
- * An {@link IDiffExtensionFactory} is a factory capable to create an {@link AbstractDiffExtension} from a
- * {@link DiffElement} if and only if this factory can {@link #handles(DiffElement) handle} the given
- * {@link DiffElement}.
- * <p>
- * A factory must be able to say in which parent a {@link AbstractDiffExtension} must be attached if it
- * handles the {@link DiffElement} from which it has been {@link #create(DiffElement) created}.
- */
-public interface IDiffExtensionFactory {
-
- Class<? extends Diff> getExtensionKind();
-
- /**
- * Returns true if this factory handles the given kind of DiffElement, i.e., if it can create an
- * {@link AbstractDiffExtension}.
- * <p>
- * <b>Performance note: </b> this method should return as quickly as possible as it will called on every
- * {@link DiffElement} of the DiffModel.
- *
- * @param input
- * the element to test
- * @return true if this factory handles the given input, false otherwise.
- */
- boolean handles(Diff input);
-
- /**
- * Creates and returns an {@link AbstractDiffExtension} from the given {@link DiffElement}. The returned
- * element MUST NOT be added to its parent, it will be done by the UML2DiffEngine.
- *
- * @param input
- * The input difference element.
- * @return The difference extension.
- */
- Diff create(Diff input);
-
- /**
- * Returns the {@link DiffElement} in which the {@link #create(DiffElement) created}
- * {@link AbstractDiffExtension} will be added as a sub diff element. This {@link DiffElement} can be from
- * the model or newly created.
- *
- * @param input
- * The input difference element.
- * @return The difference extension.
- */
- Match getParentMatch(Diff input);
-
- /**
- * Sets the required link of the difference extension created by the related factory.
- *
- * @param diff
- * The difference extension.
- * @param comaprison
- * The comparison.
- */
- void fillRequiredDifferences(Comparison comparison, Diff extension);
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderIDEExtensionDescriptor.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderIDEExtensionDescriptor.java
deleted file mode 100644
index 3b6fdf042..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderIDEExtensionDescriptor.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.emf.compare.diagram.ide.GMFCompareIDEPlugin;
-import org.eclipse.emf.compare.diagram.provider.IViewLabelProvider;
-import org.eclipse.emf.compare.diagram.provider.ViewLabelProviderExtensionDescriptor;
-
-/**
- * Describes a extension as contributed to the "" extension point.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class ViewLabelProviderIDEExtensionDescriptor extends ViewLabelProviderExtensionDescriptor{
- /** Names of the extension point's attributes. */
- public static final String ATTRIBUTE_CLASS = "class"; //$NON-NLS-1$
-
- /** Name of the type of diagram. */
- public static final String ATTRIBUTE_DIAGRAM_TYPE = "diagramType"; //$NON-NLS-1$
-
- /** Configuration element of this descriptor. */
- private final IConfigurationElement element;
-
- /**
- * Instantiates a descriptor with all information.
- *
- * @param configuration
- * Configuration element from which to create this descriptor.
- */
- public ViewLabelProviderIDEExtensionDescriptor(IConfigurationElement configuration) {
- super();
- this.element = configuration;
- className = element.getAttribute(ATTRIBUTE_CLASS);
- diagramType = element.getAttribute(ATTRIBUTE_DIAGRAM_TYPE);
- }
-
- /**
- * Returns this descriptor's "extension" class name.
- *
- * @return This descriptor's "extension" class name.
- */
- public String getExtensionClassName() {
- return className;
- }
-
- public String getDiagramType() {
- return diagramType;
- }
-
- /**
- * Creates an instance of this descriptor's {@link IViewLabelProvider}.
- *
- * @return A new instance of this descriptor's {@link IViewLabelProvider}.
- */
- public IViewLabelProvider getViewLabelTypeProviderExtension() {
- if (extension == null) {
- try {
- extension = (IViewLabelProvider)element.createExecutableExtension(ATTRIBUTE_CLASS);
- } catch (CoreException e) {
- GMFCompareIDEPlugin.getDefault().getLog()
- .log(new Status(IStatus.ERROR, GMFCompareIDEPlugin.PLUGIN_ID, e.getMessage(), e));
- }
- }
- return extension;
- }
-
- @Override
- public IViewLabelProvider getExtension() {
- return getViewLabelTypeProviderExtension();
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderRegistryListener.java b/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderRegistryListener.java
deleted file mode 100644
index d8f4c977f..000000000
--- a/plugins/org.eclipse.emf.compare.diagram.ide/src/org/eclipse/emf/compare/diagram/provider/internal/ViewLabelProviderRegistryListener.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider.internal;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.IRegistryEventListener;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.compare.diagram.provider.ViewLabelProviderExtensionRegistry;
-
-/**
- * This listener will allow us to be aware of contribution changes against the extension point.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class ViewLabelProviderRegistryListener implements IRegistryEventListener {
-
- /** Name of the extension point's tag. */
- public static final String VIEW_LABELPROVIDER_EXTENSION_POINT = "org.eclipse.emf.compare.diagram.ide.viewLabelProvider"; //$NON-NLS-1$
-
- /** Name of the extension tag point's tag. */
- private static final String VIEW_LABELPROVIDER_TAG = "viewLabelProvider"; //$NON-NLS-1$
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#added(org.eclipse.core.runtime.IExtension[])
- */
- public void added(IExtension[] extensions) {
- for (IExtension extension : extensions) {
- parseExtension(extension);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#added(org.eclipse.core.runtime.IExtensionPoint[])
- */
- public void added(IExtensionPoint[] extensionPoints) {
- // no need to listen to this event
- }
-
- /**
- * Though this listener reacts to the extension point changes, there could have been contributions before
- * it's been registered. This will parse these initial contributions.
- */
- public void parseInitialContributions() {
- final IExtensionRegistry registry = Platform.getExtensionRegistry();
-
- final IExtensionPoint extensionPoint = registry.getExtensionPoint(VIEW_LABELPROVIDER_EXTENSION_POINT);
- if (extensionPoint != null) {
- for (IExtension extension :extensionPoint.getExtensions()) {
- parseExtension(extension);
- }
- }
-
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#removed(org.eclipse.core.runtime.IExtension[])
- */
- public void removed(IExtension[] extensions) {
- for (IExtension extension : extensions) {
- final IConfigurationElement[] configElements = extension.getConfigurationElements();
- for (IConfigurationElement elem : configElements) {
- if (VIEW_LABELPROVIDER_TAG.equals(elem.getName())) {
- final String extensionClassName = elem
- .getAttribute(ViewLabelProviderIDEExtensionDescriptor.ATTRIBUTE_CLASS);
- ViewLabelProviderExtensionRegistry.removeExtension(extensionClassName);
- }
- }
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.core.runtime.IRegistryEventListener#removed(org.eclipse.core.runtime.IExtensionPoint[])
- */
- public void removed(IExtensionPoint[] extensionPoints) {
- // no need to listen to this event
- }
-
- /**
- * Parses a single extension contribution.
- *
- * @param extension
- * Parses the given extension and adds its contribution to the registry.
- */
- private static void parseExtension(IExtension extension) {
- final IConfigurationElement[] configElements = extension.getConfigurationElements();
- for (IConfigurationElement elem : configElements) {
- if (VIEW_LABELPROVIDER_TAG.equals(elem.getName())) {
- ViewLabelProviderExtensionRegistry.addViewLabelProvider(new ViewLabelProviderIDEExtensionDescriptor(elem));
- }
- }
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF
index 224332ea4..c11d679da 100644
--- a/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.diagram/META-INF/MANIFEST.MF
@@ -7,12 +7,6 @@ Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.emf.compare.diagram,
- org.eclipse.emf.compare.diagram.diff,
- org.eclipse.emf.compare.diagram.diff.util,
- org.eclipse.emf.compare.diagram.merge,
- org.eclipse.emf.compare.diagram.provider,
- org.eclipse.emf.compare.diagram.util
Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.gmf.runtime.notation,
org.eclipse.gmf.runtime.diagram.ui,
@@ -21,4 +15,11 @@ Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
Import-Package: com.google.common.base;version="10.0.1",
com.google.common.collect;version="10.0.1"
Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.emf.compare.diagram.DiagramDiffEnginePlugin
+Bundle-Activator: org.eclipse.emf.compare.diagram.internal.CompareDiagramPlugin
+Export-Package: org.eclipse.emf.compare.diagram.internal;x-internal:=true,
+ org.eclipse.emf.compare.diagram.internal.extensions;x-internal:=true,
+ org.eclipse.emf.compare.diagram.internal.extensions.impl;x-internal:=true,
+ org.eclipse.emf.compare.diagram.internal.extensions.util;x-internal:=true,
+ org.eclipse.emf.compare.diagram.internal.factories;x-internal:=true,
+ org.eclipse.emf.compare.diagram.internal.factories.extensions;x-internal:=true,
+ org.eclipse.emf.compare.diagram.internal.merge;x-internal:=true
diff --git a/plugins/org.eclipse.emf.compare.diagram/about.ini b/plugins/org.eclipse.emf.compare.diagram/about.ini
new file mode 100644
index 000000000..eec22440e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
diff --git a/plugins/org.eclipse.emf.compare.diagram/about.properties b/plugins/org.eclipse.emf.compare.diagram/about.properties
new file mode 100644
index 000000000..f733cb679
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram/about.properties
@@ -0,0 +1,26 @@
+# /**
+# * <copyright>
+# *
+# * Copyright (c) 2006, 2012 Obeo and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Obeo - Initial API and implementation
+# *
+# * </copyright>
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=EMF Compare GMF Integration
+
+featureText=EMF Compare - GMF Integration\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright Obeo and others. 2006, 2012. All rights reserved.\n\
+\n\
+EMF Compare brings comparison to the Eclipse Modeling Framework\n\
+Visit http://www.eclipse.org/emf/compare
diff --git a/plugins/org.eclipse.emf.compare.diagram/build.properties b/plugins/org.eclipse.emf.compare.diagram/build.properties
index f74ea1c6b..7c1e9e5d1 100644
--- a/plugins/org.eclipse.emf.compare.diagram/build.properties
+++ b/plugins/org.eclipse.emf.compare.diagram/build.properties
@@ -1,5 +1,5 @@
#*******************************************************************************
- # Copyright (c) 2006, 2012 Obeo.
+ # Copyright (c) 2013 Obeo.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -13,10 +13,16 @@ bin.includes = .,\
META-INF/,\
plugin.xml,\
plugin.properties,\
- about.html
+ about.html,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
jars.compile.order = .
source.. = src-gen/,\
src/
output.. = bin/
src.includes = about.html,\
- model/
+ model/,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
diff --git a/plugins/org.eclipse.emf.compare.diagram/model/diagramdiff.ecore b/plugins/org.eclipse.emf.compare.diagram/model/diagramCompare.ecore
index b294fa119..53bac7b05 100644
--- a/plugins/org.eclipse.emf.compare.diagram/model/diagramdiff.ecore
+++ b/plugins/org.eclipse.emf.compare.diagram/model/diagramCompare.ecore
@@ -1,16 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="diagram" nsURI="http://www.eclipse.org/emf/compare/diagram/2.0"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="extensions" nsURI="http://www.eclipse.org/emf/compare/diagram/2.0"
nsPrefix="diagramcompare">
<eClassifiers xsi:type="ecore:EClass" name="Show" eSuperTypes="#//DiagramDiff"/>
<eClassifiers xsi:type="ecore:EClass" name="Hide" eSuperTypes="#//DiagramDiff"/>
<eClassifiers xsi:type="ecore:EClass" name="NodeChange" eSuperTypes="#//DiagramDiff"/>
<eClassifiers xsi:type="ecore:EClass" name="EdgeChange" eSuperTypes="#//DiagramDiff"/>
- <eClassifiers xsi:type="ecore:EClass" name="LabelChange" eSuperTypes="#//DiagramDiff">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="left" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="right" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="origin" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- </eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DiagramDiff" abstract="true" eSuperTypes="../../org.eclipse.emf.compare/model/compare.ecore#//Diff">
<eStructuralFeatures xsi:type="ecore:EReference" name="semanticDiff" eType="ecore:EClass ../../org.eclipse.emf.compare/model/compare.ecore#//Diff"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="view" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EObject"/>
diff --git a/plugins/org.eclipse.emf.compare.diagram/model/diagramCompare.genmodel b/plugins/org.eclipse.emf.compare.diagram/model/diagramCompare.genmodel
new file mode 100644
index 000000000..d6cbbd75e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram/model/diagramCompare.genmodel
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2013 Obeo.&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;&#xD;&#xA;Contributors:&#xD;&#xA; Obeo - initial API and implementation"
+ modelDirectory="/org.eclipse.emf.compare.diagram/src-gen" editDirectory="/org.eclipse.emf.compare.diagram.edit/src-gen"
+ editorDirectory="/org.eclipse.emf.compare.diagram.editor/src-gen" modelPluginID="org.eclipse.emf.compare.diagram"
+ modelName="Extensions" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0"
+ copyrightFields="false" colorProviders="true" fontProviders="true" usedGenPackages="../../org.eclipse.emf.compare/model/compare.genmodel#//compare platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
+ <foreignModel>diagramCompare.ecore</foreignModel>
+ <genPackages prefix="Extensions" basePackage="org.eclipse.emf.compare.diagram.internal"
+ disposableProviderFactory="true" ecorePackage="diagramCompare.ecore#/">
+ <genClasses ecoreClass="diagramCompare.ecore#//Show"/>
+ <genClasses ecoreClass="diagramCompare.ecore#//Hide"/>
+ <genClasses ecoreClass="diagramCompare.ecore#//NodeChange"/>
+ <genClasses ecoreClass="diagramCompare.ecore#//EdgeChange"/>
+ <genClasses image="false" ecoreClass="diagramCompare.ecore#//DiagramDiff">
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference diagramCompare.ecore#//DiagramDiff/semanticDiff"/>
+ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference diagramCompare.ecore#//DiagramDiff/view"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.compare.diagram/model/diagramdiff.genmodel b/plugins/org.eclipse.emf.compare.diagram/model/diagramdiff.genmodel
deleted file mode 100644
index 7da410baf..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/model/diagramdiff.genmodel
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2012 Obeo.&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;&#xD;&#xA;Contributors:&#xD;&#xA; Obeo - initial API and implementation"
- modelDirectory="/org.eclipse.emf.compare.diagram/src-gen" editDirectory="/org.eclipse.emf.compare.diagram.edit/src-gen"
- editorDirectory="/org.eclipse.emf.compare.diagram.editor/src-gen" modelPluginID="org.eclipse.emf.compare.diagram"
- modelName="Diagram" importerID="org.eclipse.emf.importer.ecore" complianceLevel="5.0"
- copyrightFields="false" colorProviders="true" fontProviders="true" usedGenPackages="../../org.eclipse.emf.compare/model/compare.genmodel#//compare platform:/plugin/org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore">
- <foreignModel>diagramdiff.ecore</foreignModel>
- <genPackages prefix="DiagramCompare" basePackage="org.eclipse.emf.compare" disposableProviderFactory="true"
- ecorePackage="diagramdiff.ecore#/">
- <genClasses ecoreClass="diagramdiff.ecore#//Show"/>
- <genClasses ecoreClass="diagramdiff.ecore#//Hide"/>
- <genClasses ecoreClass="diagramdiff.ecore#//NodeChange"/>
- <genClasses ecoreClass="diagramdiff.ecore#//EdgeChange"/>
- <genClasses ecoreClass="diagramdiff.ecore#//LabelChange">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute diagramdiff.ecore#//LabelChange/left"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute diagramdiff.ecore#//LabelChange/right"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute diagramdiff.ecore#//LabelChange/origin"/>
- </genClasses>
- <genClasses image="false" ecoreClass="diagramdiff.ecore#//DiagramDiff">
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference diagramdiff.ecore#//DiagramDiff/semanticDiff"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference diagramdiff.ecore#//DiagramDiff/view"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
diff --git a/plugins/org.eclipse.emf.compare.diagram/modeling32.png b/plugins/org.eclipse.emf.compare.diagram/modeling32.png
new file mode 100644
index 000000000..6b08de2ad
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.diagram/plugin.xml b/plugins/org.eclipse.emf.compare.diagram/plugin.xml
index ed00bb47a..8718557ef 100644
--- a/plugins/org.eclipse.emf.compare.diagram/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.diagram/plugin.xml
@@ -2,10 +2,14 @@
<?eclipse version="3.0"?>
<!--
- <copyright>
- </copyright>
-
- $Id$
+ Copyright (c) 2013 Obeo.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Obeo - initial API and implementation
-->
<plugin>
@@ -13,15 +17,15 @@
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri="http://www.eclipse.org/emf/compare/diagram/2.0"
- class="org.eclipse.emf.compare.diagram.DiagramComparePackage"
- genModel="model/diagramdiff.genmodel"/>
+ class="org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage"
+ genModel="model/diagramCompare.genmodel"/>
</extension>
<extension
point="org.eclipse.emf.compare.postProcessor">
<postProcessor
- class="org.eclipse.emf.compare.diagram.diff.DiagramDiffExtensionPostProcessor">
+ class="org.eclipse.emf.compare.diagram.internal.CompareDiagramPostProcessor">
<nsURI
value="http://www.eclipse.org/gmf/runtime/\d.\d.\d/notation">
</nsURI>
@@ -30,7 +34,7 @@
<extension
point="org.eclipse.emf.compare.ide.mergerExtension">
<merger
- class="org.eclipse.emf.compare.diagram.merge.DiagramDiffMerger"
+ class="org.eclipse.emf.compare.diagram.internal.merge.CompareDiagramMerger"
ranking="11">
</merger>
</extension>
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/LabelChange.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/LabelChange.java
deleted file mode 100644
index b0df69f81..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/LabelChange.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- */
-package org.eclipse.emf.compare.diagram;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Label Change</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.emf.compare.diagram.LabelChange#getLeft <em>Left</em>}</li>
- * <li>{@link org.eclipse.emf.compare.diagram.LabelChange#getRight <em>Right</em>}</li>
- * <li>{@link org.eclipse.emf.compare.diagram.LabelChange#getOrigin <em>Origin</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getLabelChange()
- * @model
- * @generated
- */
-public interface LabelChange extends DiagramDiff {
-
- /**
- * Returns the value of the '<em><b>Left</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Left</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Left</em>' attribute.
- * @see #setLeft(String)
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getLabelChange_Left()
- * @model
- * @generated
- */
- String getLeft();
-
- /**
- * Sets the value of the '{@link org.eclipse.emf.compare.diagram.LabelChange#getLeft <em>Left</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Left</em>' attribute.
- * @see #getLeft()
- * @generated
- */
- void setLeft(String value);
-
- /**
- * Returns the value of the '<em><b>Right</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Right</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Right</em>' attribute.
- * @see #setRight(String)
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getLabelChange_Right()
- * @model
- * @generated
- */
- String getRight();
-
- /**
- * Sets the value of the '{@link org.eclipse.emf.compare.diagram.LabelChange#getRight <em>Right</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Right</em>' attribute.
- * @see #getRight()
- * @generated
- */
- void setRight(String value);
-
- /**
- * Returns the value of the '<em><b>Origin</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Origin</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Origin</em>' attribute.
- * @see #setOrigin(String)
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getLabelChange_Origin()
- * @model
- * @generated
- */
- String getOrigin();
-
- /**
- * Sets the value of the '{@link org.eclipse.emf.compare.diagram.LabelChange#getOrigin <em>Origin</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Origin</em>' attribute.
- * @see #getOrigin()
- * @generated
- */
- void setOrigin(String value);
-} // LabelChange
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramDiffImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramDiffImpl.java
deleted file mode 100644
index f9549e73b..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramDiffImpl.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/**
- * Copyright (c) 2012, 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- */
-package org.eclipse.emf.compare.diagram.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.BasicMonitor;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.impl.DiffImpl;
-import org.eclipse.emf.compare.merge.IMerger;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Diagram Diff</b></em>'. <!--
- * end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.emf.compare.diagram.impl.DiagramDiffImpl#getSemanticDiff <em>Semantic Diff</em>}</li>
- * <li>{@link org.eclipse.emf.compare.diagram.impl.DiagramDiffImpl#getView <em>View</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public abstract class DiagramDiffImpl extends DiffImpl implements DiagramDiff {
- /**
- * The cached value of the '{@link #getSemanticDiff() <em>Semantic Diff</em>}' reference. <!--
- * begin-user-doc --> <!-- end-user-doc -->
- *
- * @see #getSemanticDiff()
- * @generated
- * @ordered
- */
- protected Diff semanticDiff;
-
- /**
- * The cached value of the '{@link #getView() <em>View</em>}' reference. <!-- begin-user-doc --> <!--
- * end-user-doc -->
- *
- * @see #getView()
- * @generated
- * @ordered
- */
- protected EObject view;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- protected DiagramDiffImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DiagramComparePackage.Literals.DIAGRAM_DIFF;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Diff getSemanticDiff() {
- if (semanticDiff != null && semanticDiff.eIsProxy()) {
- InternalEObject oldSemanticDiff = (InternalEObject)semanticDiff;
- semanticDiff = (Diff)eResolveProxy(oldSemanticDiff);
- if (semanticDiff != oldSemanticDiff) {
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.RESOLVE,
- DiagramComparePackage.DIAGRAM_DIFF__SEMANTIC_DIFF, oldSemanticDiff, semanticDiff));
- }
- }
- }
- return semanticDiff;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public Diff basicGetSemanticDiff() {
- return semanticDiff;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setSemanticDiff(Diff newSemanticDiff) {
- Diff oldSemanticDiff = semanticDiff;
- semanticDiff = newSemanticDiff;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET,
- DiagramComparePackage.DIAGRAM_DIFF__SEMANTIC_DIFF, oldSemanticDiff, semanticDiff));
- }
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject getView() {
- if (view != null && view.eIsProxy()) {
- InternalEObject oldView = (InternalEObject)view;
- view = eResolveProxy(oldView);
- if (view != oldView) {
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.RESOLVE,
- DiagramComparePackage.DIAGRAM_DIFF__VIEW, oldView, view));
- }
- }
- }
- return view;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject basicGetView() {
- return view;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- public void setView(EObject newView) {
- EObject oldView = view;
- view = newView;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramComparePackage.DIAGRAM_DIFF__VIEW,
- oldView, view));
- }
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DiagramComparePackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
- if (resolve) {
- return getSemanticDiff();
- }
- return basicGetSemanticDiff();
- case DiagramComparePackage.DIAGRAM_DIFF__VIEW:
- if (resolve) {
- return getView();
- }
- return basicGetView();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DiagramComparePackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
- setSemanticDiff((Diff)newValue);
- return;
- case DiagramComparePackage.DIAGRAM_DIFF__VIEW:
- setView((EObject)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DiagramComparePackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
- setSemanticDiff((Diff)null);
- return;
- case DiagramComparePackage.DIAGRAM_DIFF__VIEW:
- setView((EObject)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DiagramComparePackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
- return semanticDiff != null;
- case DiagramComparePackage.DIAGRAM_DIFF__VIEW:
- return view != null;
- }
- return super.eIsSet(featureID);
- }
-
- @Deprecated
- @Override
- public void copyLeftToRight() {
- final IMerger merger = IMerger.RegistryImpl.createStandaloneInstance().getHighestRankingMerger(this);
- merger.copyLeftToRight(this, new BasicMonitor());
- }
-
- @Deprecated
- @Override
- public void copyRightToLeft() {
- final IMerger merger = IMerger.RegistryImpl.createStandaloneInstance().getHighestRankingMerger(this);
- merger.copyRightToLeft(this, new BasicMonitor());
- }
-} // DiagramDiffImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/LabelChangeImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/LabelChangeImpl.java
deleted file mode 100644
index 2cd03c18d..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/LabelChangeImpl.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/**
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- */
-package org.eclipse.emf.compare.diagram.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.LabelChange;
-import org.eclipse.emf.compare.diagram.diff.util.GMFLabelUtil;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * <!-- begin-user-doc --> An implementation of the model object '<em><b>Label Change</b></em>'. <!--
- * end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.emf.compare.diagram.impl.LabelChangeImpl#getLeft <em>Left</em>}</li>
- * <li>{@link org.eclipse.emf.compare.diagram.impl.LabelChangeImpl#getRight <em>Right</em>}</li>
- * <li>{@link org.eclipse.emf.compare.diagram.impl.LabelChangeImpl#getOrigin <em>Origin</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class LabelChangeImpl extends DiagramDiffImpl implements LabelChange {
- /**
- * The default value of the '{@link #getLeft() <em>Left</em>}' attribute.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @see #getLeft()
- * @generated
- * @ordered
- */
- protected static final String LEFT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLeft() <em>Left</em>}' attribute.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @see #getLeft()
- * @generated
- * @ordered
- */
- protected String left = LEFT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getRight() <em>Right</em>}' attribute.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @see #getRight()
- * @generated
- * @ordered
- */
- protected static final String RIGHT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getRight() <em>Right</em>}' attribute.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @see #getRight()
- * @generated
- * @ordered
- */
- protected String right = RIGHT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getOrigin() <em>Origin</em>}' attribute.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @see #getOrigin()
- * @generated
- * @ordered
- */
- protected static final String ORIGIN_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getOrigin() <em>Origin</em>}' attribute.
- * <!-- begin-user-doc --> <!--
- * end-user-doc -->
- * @see #getOrigin()
- * @generated
- * @ordered
- */
- protected String origin = ORIGIN_EDEFAULT;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- protected LabelChangeImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DiagramComparePackage.Literals.LABEL_CHANGE;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public String getLeft() {
- return left;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void setLeft(String newLeft) {
- String oldLeft = left;
- left = newLeft;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramComparePackage.LABEL_CHANGE__LEFT, oldLeft, left));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public String getRight() {
- return right;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void setRight(String newRight) {
- String oldRight = right;
- right = newRight;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramComparePackage.LABEL_CHANGE__RIGHT, oldRight, right));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public String getOrigin() {
- return origin;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public void setOrigin(String newOrigin) {
- String oldOrigin = origin;
- origin = newOrigin;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramComparePackage.LABEL_CHANGE__ORIGIN, oldOrigin, origin));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DiagramComparePackage.LABEL_CHANGE__LEFT:
- return getLeft();
- case DiagramComparePackage.LABEL_CHANGE__RIGHT:
- return getRight();
- case DiagramComparePackage.LABEL_CHANGE__ORIGIN:
- return getOrigin();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DiagramComparePackage.LABEL_CHANGE__LEFT:
- setLeft((String)newValue);
- return;
- case DiagramComparePackage.LABEL_CHANGE__RIGHT:
- setRight((String)newValue);
- return;
- case DiagramComparePackage.LABEL_CHANGE__ORIGIN:
- setOrigin((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DiagramComparePackage.LABEL_CHANGE__LEFT:
- setLeft(LEFT_EDEFAULT);
- return;
- case DiagramComparePackage.LABEL_CHANGE__RIGHT:
- setRight(RIGHT_EDEFAULT);
- return;
- case DiagramComparePackage.LABEL_CHANGE__ORIGIN:
- setOrigin(ORIGIN_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DiagramComparePackage.LABEL_CHANGE__LEFT:
- return LEFT_EDEFAULT == null ? left != null : !LEFT_EDEFAULT.equals(left);
- case DiagramComparePackage.LABEL_CHANGE__RIGHT:
- return RIGHT_EDEFAULT == null ? right != null : !RIGHT_EDEFAULT.equals(right);
- case DiagramComparePackage.LABEL_CHANGE__ORIGIN:
- return ORIGIN_EDEFAULT == null ? origin != null : !ORIGIN_EDEFAULT.equals(origin);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString() {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (left: ");
- result.append(left);
- result.append(", right: ");
- result.append(right);
- result.append(", origin: ");
- result.append(origin);
- result.append(')');
- return result.toString();
- }
-
- @Override
- public void copyLeftToRight() {
- doMerge(this, true);
- }
-
- @Override
- public void copyRightToLeft() {
- doMerge(this, false);
- }
-
- /**
- * Make the merge of the specified difference according to the direction (applyInOrigin or undoInTarget).
- * If the difference is an extension, only hidden differences will be merged. Otherwise, it is the
- * difference itself which is merged.
- *
- * @param pDiff
- * The difference.
- * @param inOrigin
- * The direction of the merge.
- */
- private void doMerge(LabelChange pDiff, boolean inOrigin) {
- final EObject element = pDiff.getMatch().getRight();
- final EObject origin = pDiff.getMatch().getLeft();
- if (element instanceof View && origin instanceof View) {
- final View vElement = (View)element;
- final View vOrigin = (View)origin;
- if (inOrigin) {
- GMFLabelUtil.setLabel(vOrigin, pDiff.getRight());
- } else {
- GMFLabelUtil.setLabel(vElement, pDiff.getLeft());
- }
- }
- }
-
-} // LabelChangeImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramDiff.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/DiagramDiff.java
index 1cb15650b..f920be343 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramDiff.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/DiagramDiff.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,24 +8,26 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal.extensions;
import org.eclipse.emf.compare.Diff;
+
import org.eclipse.emf.ecore.EObject;
/**
- * <!-- begin-user-doc --> A representation of the model object '<em><b>Diagram Diff</b></em>'. <!--
- * end-user-doc -->
+ * <!-- begin-user-doc -->
+ * A representation of the model object '<em><b>Diagram Diff</b></em>'.
+ * <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
- * <li>{@link org.eclipse.emf.compare.diagram.DiagramDiff#getSemanticDiff <em>Semantic Diff</em>}</li>
- * <li>{@link org.eclipse.emf.compare.diagram.DiagramDiff#getView <em>View</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getSemanticDiff <em>Semantic Diff</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getView <em>View</em>}</li>
* </ul>
* </p>
*
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getDiagramDiff()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#getDiagramDiff()
* @model abstract="true"
* @generated
*/
@@ -34,21 +36,22 @@ public interface DiagramDiff extends Diff {
* Returns the value of the '<em><b>Semantic Diff</b></em>' reference.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Semantic Diff</em>' reference isn't clear, there really should be more of a
- * description here...
+ * If the meaning of the '<em>Semantic Diff</em>' reference isn't clear,
+ * there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Semantic Diff</em>' reference.
* @see #setSemanticDiff(Diff)
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getDiagramDiff_SemanticDiff()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#getDiagramDiff_SemanticDiff()
* @model
* @generated
*/
Diff getSemanticDiff();
/**
- * Sets the value of the '{@link org.eclipse.emf.compare.diagram.DiagramDiff#getSemanticDiff <em>Semantic Diff</em>}' reference.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * Sets the value of the '{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getSemanticDiff <em>Semantic Diff</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @param value the new value of the '<em>Semantic Diff</em>' reference.
* @see #getSemanticDiff()
* @generated
@@ -65,14 +68,14 @@ public interface DiagramDiff extends Diff {
* <!-- end-user-doc -->
* @return the value of the '<em>View</em>' reference.
* @see #setView(EObject)
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getDiagramDiff_View()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#getDiagramDiff_View()
* @model
* @generated
*/
EObject getView();
/**
- * Sets the value of the '{@link org.eclipse.emf.compare.diagram.DiagramDiff#getView <em>View</em>}' reference.
+ * Sets the value of the '{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getView <em>View</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>View</em>' reference.
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/EdgeChange.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/EdgeChange.java
index 90f6b187c..9538fa222 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/EdgeChange.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/EdgeChange.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal.extensions;
/**
@@ -17,7 +17,7 @@ package org.eclipse.emf.compare.diagram;
* <!-- end-user-doc -->
*
*
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getEdgeChange()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#getEdgeChange()
* @model
* @generated
*/
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramCompareFactory.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/ExtensionsFactory.java
index 2e2756f22..58a251ed4 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramCompareFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/ExtensionsFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal.extensions;
import org.eclipse.emf.ecore.EFactory;
@@ -17,17 +17,17 @@ import org.eclipse.emf.ecore.EFactory;
* The <b>Factory</b> for the model.
* It provides a create method for each non-abstract class of the model.
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage
* @generated
*/
-public interface DiagramCompareFactory extends EFactory {
+public interface ExtensionsFactory extends EFactory {
/**
* The singleton instance of the factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- DiagramCompareFactory eINSTANCE = org.eclipse.emf.compare.diagram.impl.DiagramCompareFactoryImpl.init();
+ ExtensionsFactory eINSTANCE = org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsFactoryImpl.init();
/**
* Returns a new object of class '<em>Show</em>'.
@@ -66,21 +66,12 @@ public interface DiagramCompareFactory extends EFactory {
EdgeChange createEdgeChange();
/**
- * Returns a new object of class '<em>Label Change</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return a new object of class '<em>Label Change</em>'.
- * @generated
- */
- LabelChange createLabelChange();
-
- /**
* Returns the package supported by this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the package supported by this factory.
* @generated
*/
- DiagramComparePackage getDiagramComparePackage();
+ ExtensionsPackage getExtensionsPackage();
-} //DiagramCompareFactory
+} //ExtensionsFactory
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramComparePackage.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/ExtensionsPackage.java
index 84b9b817f..47682ac63 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/DiagramComparePackage.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/ExtensionsPackage.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,11 +8,10 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal.extensions;
import org.eclipse.emf.compare.ComparePackage;
-import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
@@ -28,18 +27,18 @@ import org.eclipse.emf.ecore.EReference;
* <li>and each data type</li>
* </ul>
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.DiagramCompareFactory
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsFactory
* @model kind="package"
* @generated
*/
-public interface DiagramComparePackage extends EPackage {
+public interface ExtensionsPackage extends EPackage {
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- String eNAME = "diagram";
+ String eNAME = "extensions";
/**
* The package namespace URI.
@@ -63,17 +62,17 @@ public interface DiagramComparePackage extends EPackage {
* <!-- end-user-doc -->
* @generated
*/
- DiagramComparePackage eINSTANCE = org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl.init();
+ ExtensionsPackage eINSTANCE = org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl.init();
/**
- * The meta object id for the '{@link org.eclipse.emf.compare.diagram.impl.DiagramDiffImpl <em>Diagram Diff</em>}' class.
+ * The meta object id for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.DiagramDiffImpl <em>Diagram Diff</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.DiagramDiffImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getDiagramDiff()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.DiagramDiffImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getDiagramDiff()
* @generated
*/
- int DIAGRAM_DIFF = 5;
+ int DIAGRAM_DIFF = 4;
/**
* The feature id for the '<em><b>Match</b></em>' container reference.
@@ -193,11 +192,11 @@ public interface DiagramComparePackage extends EPackage {
int DIAGRAM_DIFF_FEATURE_COUNT = ComparePackage.DIFF_FEATURE_COUNT + 2;
/**
- * The meta object id for the '{@link org.eclipse.emf.compare.diagram.impl.ShowImpl <em>Show</em>}' class.
+ * The meta object id for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.ShowImpl <em>Show</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.ShowImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getShow()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ShowImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getShow()
* @generated
*/
int SHOW = 0;
@@ -320,11 +319,11 @@ public interface DiagramComparePackage extends EPackage {
int SHOW_FEATURE_COUNT = DIAGRAM_DIFF_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.emf.compare.diagram.impl.HideImpl <em>Hide</em>}' class.
+ * The meta object id for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.HideImpl <em>Hide</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.HideImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getHide()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.HideImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getHide()
* @generated
*/
int HIDE = 1;
@@ -447,11 +446,11 @@ public interface DiagramComparePackage extends EPackage {
int HIDE_FEATURE_COUNT = DIAGRAM_DIFF_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.emf.compare.diagram.impl.NodeChangeImpl <em>Node Change</em>}' class.
+ * The meta object id for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.NodeChangeImpl <em>Node Change</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.NodeChangeImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getNodeChange()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.NodeChangeImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getNodeChange()
* @generated
*/
int NODE_CHANGE = 2;
@@ -574,11 +573,11 @@ public interface DiagramComparePackage extends EPackage {
int NODE_CHANGE_FEATURE_COUNT = DIAGRAM_DIFF_FEATURE_COUNT + 0;
/**
- * The meta object id for the '{@link org.eclipse.emf.compare.diagram.impl.EdgeChangeImpl <em>Edge Change</em>}' class.
+ * The meta object id for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.EdgeChangeImpl <em>Edge Change</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.EdgeChangeImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getEdgeChange()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.EdgeChangeImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getEdgeChange()
* @generated
*/
int EDGE_CHANGE = 3;
@@ -702,270 +701,72 @@ public interface DiagramComparePackage extends EPackage {
/**
- * The meta object id for the '{@link org.eclipse.emf.compare.diagram.impl.LabelChangeImpl <em>Label Change</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.LabelChangeImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getLabelChange()
- * @generated
- */
- int LABEL_CHANGE = 4;
-
- /**
- * The feature id for the '<em><b>Match</b></em>' container reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__MATCH = DIAGRAM_DIFF__MATCH;
-
- /**
- * The feature id for the '<em><b>Requires</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__REQUIRES = DIAGRAM_DIFF__REQUIRES;
-
- /**
- * The feature id for the '<em><b>Required By</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__REQUIRED_BY = DIAGRAM_DIFF__REQUIRED_BY;
-
- /**
- * The feature id for the '<em><b>Refines</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__REFINES = DIAGRAM_DIFF__REFINES;
-
- /**
- * The feature id for the '<em><b>Refined By</b></em>' reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__REFINED_BY = DIAGRAM_DIFF__REFINED_BY;
-
- /**
- * The feature id for the '<em><b>Kind</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__KIND = DIAGRAM_DIFF__KIND;
-
- /**
- * The feature id for the '<em><b>Source</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__SOURCE = DIAGRAM_DIFF__SOURCE;
-
- /**
- * The feature id for the '<em><b>State</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__STATE = DIAGRAM_DIFF__STATE;
-
- /**
- * The feature id for the '<em><b>Equivalence</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__EQUIVALENCE = DIAGRAM_DIFF__EQUIVALENCE;
-
- /**
- * The feature id for the '<em><b>Conflict</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__CONFLICT = DIAGRAM_DIFF__CONFLICT;
-
- /**
- * The feature id for the '<em><b>Semantic Diff</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__SEMANTIC_DIFF = DIAGRAM_DIFF__SEMANTIC_DIFF;
-
- /**
- * The feature id for the '<em><b>View</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__VIEW = DIAGRAM_DIFF__VIEW;
-
- /**
- * The feature id for the '<em><b>Left</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__LEFT = DIAGRAM_DIFF_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Right</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__RIGHT = DIAGRAM_DIFF_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Origin</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE__ORIGIN = DIAGRAM_DIFF_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Label Change</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- int LABEL_CHANGE_FEATURE_COUNT = DIAGRAM_DIFF_FEATURE_COUNT + 3;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.Show <em>Show</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.internal.extensions.Show <em>Show</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Show</em>'.
- * @see org.eclipse.emf.compare.diagram.Show
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.Show
* @generated
*/
EClass getShow();
/**
- * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.Hide <em>Hide</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.internal.extensions.Hide <em>Hide</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Hide</em>'.
- * @see org.eclipse.emf.compare.diagram.Hide
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.Hide
* @generated
*/
EClass getHide();
/**
- * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.NodeChange <em>Node Change</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.internal.extensions.NodeChange <em>Node Change</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Node Change</em>'.
- * @see org.eclipse.emf.compare.diagram.NodeChange
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.NodeChange
* @generated
*/
EClass getNodeChange();
/**
- * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.EdgeChange <em>Edge Change</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange <em>Edge Change</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Edge Change</em>'.
- * @see org.eclipse.emf.compare.diagram.EdgeChange
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange
* @generated
*/
EClass getEdgeChange();
/**
- * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.LabelChange <em>Label Change</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Label Change</em>'.
- * @see org.eclipse.emf.compare.diagram.LabelChange
- * @generated
- */
- EClass getLabelChange();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.diagram.LabelChange#getLeft <em>Left</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Left</em>'.
- * @see org.eclipse.emf.compare.diagram.LabelChange#getLeft()
- * @see #getLabelChange()
- * @generated
- */
- EAttribute getLabelChange_Left();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.diagram.LabelChange#getRight <em>Right</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Right</em>'.
- * @see org.eclipse.emf.compare.diagram.LabelChange#getRight()
- * @see #getLabelChange()
- * @generated
- */
- EAttribute getLabelChange_Right();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.emf.compare.diagram.LabelChange#getOrigin <em>Origin</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Origin</em>'.
- * @see org.eclipse.emf.compare.diagram.LabelChange#getOrigin()
- * @see #getLabelChange()
- * @generated
- */
- EAttribute getLabelChange_Origin();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.DiagramDiff <em>Diagram Diff</em>}'.
+ * Returns the meta object for class '{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff <em>Diagram Diff</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Diagram Diff</em>'.
- * @see org.eclipse.emf.compare.diagram.DiagramDiff
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff
* @generated
*/
EClass getDiagramDiff();
/**
- * Returns the meta object for the reference '{@link org.eclipse.emf.compare.diagram.DiagramDiff#getSemanticDiff <em>Semantic Diff</em>}'.
+ * Returns the meta object for the reference '{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getSemanticDiff <em>Semantic Diff</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>Semantic Diff</em>'.
- * @see org.eclipse.emf.compare.diagram.DiagramDiff#getSemanticDiff()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getSemanticDiff()
* @see #getDiagramDiff()
* @generated
*/
EReference getDiagramDiff_SemanticDiff();
/**
- * Returns the meta object for the reference '{@link org.eclipse.emf.compare.diagram.DiagramDiff#getView <em>View</em>}'.
+ * Returns the meta object for the reference '{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getView <em>View</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the reference '<em>View</em>'.
- * @see org.eclipse.emf.compare.diagram.DiagramDiff#getView()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff#getView()
* @see #getDiagramDiff()
* @generated
*/
@@ -978,7 +779,7 @@ public interface DiagramComparePackage extends EPackage {
* @return the factory that creates the instances of the model.
* @generated
*/
- DiagramCompareFactory getDiagramCompareFactory();
+ ExtensionsFactory getExtensionsFactory();
/**
* <!-- begin-user-doc -->
@@ -994,85 +795,51 @@ public interface DiagramComparePackage extends EPackage {
*/
interface Literals {
/**
- * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.impl.ShowImpl <em>Show</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.ShowImpl <em>Show</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.ShowImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getShow()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ShowImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getShow()
* @generated
*/
EClass SHOW = eINSTANCE.getShow();
/**
- * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.impl.HideImpl <em>Hide</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.HideImpl <em>Hide</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.HideImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getHide()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.HideImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getHide()
* @generated
*/
EClass HIDE = eINSTANCE.getHide();
/**
- * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.impl.NodeChangeImpl <em>Node Change</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.NodeChangeImpl <em>Node Change</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.NodeChangeImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getNodeChange()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.NodeChangeImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getNodeChange()
* @generated
*/
EClass NODE_CHANGE = eINSTANCE.getNodeChange();
/**
- * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.impl.EdgeChangeImpl <em>Edge Change</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.EdgeChangeImpl <em>Edge Change</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.EdgeChangeImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getEdgeChange()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.EdgeChangeImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getEdgeChange()
* @generated
*/
EClass EDGE_CHANGE = eINSTANCE.getEdgeChange();
/**
- * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.impl.LabelChangeImpl <em>Label Change</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.LabelChangeImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getLabelChange()
- * @generated
- */
- EClass LABEL_CHANGE = eINSTANCE.getLabelChange();
-
- /**
- * The meta object literal for the '<em><b>Left</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute LABEL_CHANGE__LEFT = eINSTANCE.getLabelChange_Left();
-
- /**
- * The meta object literal for the '<em><b>Right</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute LABEL_CHANGE__RIGHT = eINSTANCE.getLabelChange_Right();
-
- /**
- * The meta object literal for the '<em><b>Origin</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- EAttribute LABEL_CHANGE__ORIGIN = eINSTANCE.getLabelChange_Origin();
-
- /**
- * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.impl.DiagramDiffImpl <em>Diagram Diff</em>}' class.
+ * The meta object literal for the '{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.DiagramDiffImpl <em>Diagram Diff</em>}' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.impl.DiagramDiffImpl
- * @see org.eclipse.emf.compare.diagram.impl.DiagramComparePackageImpl#getDiagramDiff()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.DiagramDiffImpl
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.impl.ExtensionsPackageImpl#getDiagramDiff()
* @generated
*/
EClass DIAGRAM_DIFF = eINSTANCE.getDiagramDiff();
@@ -1095,4 +862,4 @@ public interface DiagramComparePackage extends EPackage {
}
-} //DiagramComparePackage
+} //ExtensionsPackage
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/Hide.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/Hide.java
index 853007be2..0791d3db4 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/Hide.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/Hide.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal.extensions;
/**
@@ -17,7 +17,7 @@ package org.eclipse.emf.compare.diagram;
* <!-- end-user-doc -->
*
*
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getHide()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#getHide()
* @model
* @generated
*/
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/NodeChange.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/NodeChange.java
index 0a348b7d1..1dc191f9f 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/NodeChange.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/NodeChange.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal.extensions;
/**
@@ -17,7 +17,7 @@ package org.eclipse.emf.compare.diagram;
* <!-- end-user-doc -->
*
*
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getNodeChange()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#getNodeChange()
* @model
* @generated
*/
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/Show.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/Show.java
index ed0e27250..ae7500c2d 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/Show.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/Show.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal.extensions;
/**
@@ -17,7 +17,7 @@ package org.eclipse.emf.compare.diagram;
* <!-- end-user-doc -->
*
*
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#getShow()
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#getShow()
* @model
* @generated
*/
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/DiagramDiffImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/DiagramDiffImpl.java
new file mode 100644
index 000000000..38f2be0e1
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/DiagramDiffImpl.java
@@ -0,0 +1,228 @@
+/**
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ */
+package org.eclipse.emf.compare.diagram.internal.extensions.impl;
+
+import org.eclipse.emf.common.notify.Notification;
+
+import org.eclipse.emf.compare.Diff;
+
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
+
+import org.eclipse.emf.compare.impl.DiffImpl;
+
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.InternalEObject;
+
+import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+/**
+ * <!-- begin-user-doc -->
+ * An implementation of the model object '<em><b>Diagram Diff</b></em>'.
+ * <!-- end-user-doc -->
+ * <p>
+ * The following features are implemented:
+ * <ul>
+ * <li>{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.DiagramDiffImpl#getSemanticDiff <em>Semantic Diff</em>}</li>
+ * <li>{@link org.eclipse.emf.compare.diagram.internal.extensions.impl.DiagramDiffImpl#getView <em>View</em>}</li>
+ * </ul>
+ * </p>
+ *
+ * @generated
+ */
+public abstract class DiagramDiffImpl extends DiffImpl implements DiagramDiff {
+ /**
+ * The cached value of the '{@link #getSemanticDiff() <em>Semantic Diff</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getSemanticDiff()
+ * @generated
+ * @ordered
+ */
+ protected Diff semanticDiff;
+
+ /**
+ * The cached value of the '{@link #getView() <em>View</em>}' reference.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getView()
+ * @generated
+ * @ordered
+ */
+ protected EObject view;
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected DiagramDiffImpl() {
+ super();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return ExtensionsPackage.Literals.DIAGRAM_DIFF;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diff getSemanticDiff() {
+ if (semanticDiff != null && semanticDiff.eIsProxy()) {
+ InternalEObject oldSemanticDiff = (InternalEObject)semanticDiff;
+ semanticDiff = (Diff)eResolveProxy(oldSemanticDiff);
+ if (semanticDiff != oldSemanticDiff) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExtensionsPackage.DIAGRAM_DIFF__SEMANTIC_DIFF, oldSemanticDiff, semanticDiff));
+ }
+ }
+ return semanticDiff;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public Diff basicGetSemanticDiff() {
+ return semanticDiff;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setSemanticDiff(Diff newSemanticDiff) {
+ Diff oldSemanticDiff = semanticDiff;
+ semanticDiff = newSemanticDiff;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ExtensionsPackage.DIAGRAM_DIFF__SEMANTIC_DIFF, oldSemanticDiff, semanticDiff));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject getView() {
+ if (view != null && view.eIsProxy()) {
+ InternalEObject oldView = (InternalEObject)view;
+ view = eResolveProxy(oldView);
+ if (view != oldView) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExtensionsPackage.DIAGRAM_DIFF__VIEW, oldView, view));
+ }
+ }
+ return view;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public EObject basicGetView() {
+ return view;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public void setView(EObject newView) {
+ EObject oldView = view;
+ view = newView;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, ExtensionsPackage.DIAGRAM_DIFF__VIEW, oldView, view));
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public Object eGet(int featureID, boolean resolve, boolean coreType) {
+ switch (featureID) {
+ case ExtensionsPackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
+ if (resolve) return getSemanticDiff();
+ return basicGetSemanticDiff();
+ case ExtensionsPackage.DIAGRAM_DIFF__VIEW:
+ if (resolve) return getView();
+ return basicGetView();
+ }
+ return super.eGet(featureID, resolve, coreType);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eSet(int featureID, Object newValue) {
+ switch (featureID) {
+ case ExtensionsPackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
+ setSemanticDiff((Diff)newValue);
+ return;
+ case ExtensionsPackage.DIAGRAM_DIFF__VIEW:
+ setView((EObject)newValue);
+ return;
+ }
+ super.eSet(featureID, newValue);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public void eUnset(int featureID) {
+ switch (featureID) {
+ case ExtensionsPackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
+ setSemanticDiff((Diff)null);
+ return;
+ case ExtensionsPackage.DIAGRAM_DIFF__VIEW:
+ setView((EObject)null);
+ return;
+ }
+ super.eUnset(featureID);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ public boolean eIsSet(int featureID) {
+ switch (featureID) {
+ case ExtensionsPackage.DIAGRAM_DIFF__SEMANTIC_DIFF:
+ return semanticDiff != null;
+ case ExtensionsPackage.DIAGRAM_DIFF__VIEW:
+ return view != null;
+ }
+ return super.eIsSet(featureID);
+ }
+
+} //DiagramDiffImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/EdgeChangeImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/EdgeChangeImpl.java
index 467f257b7..af0668ed0 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/EdgeChangeImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/EdgeChangeImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,10 +8,10 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.impl;
+package org.eclipse.emf.compare.diagram.internal.extensions.impl;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.EdgeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
import org.eclipse.emf.ecore.EClass;
@@ -41,7 +41,7 @@ public class EdgeChangeImpl extends DiagramDiffImpl implements EdgeChange {
*/
@Override
protected EClass eStaticClass() {
- return DiagramComparePackage.Literals.EDGE_CHANGE;
+ return ExtensionsPackage.Literals.EDGE_CHANGE;
}
} //EdgeChangeImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramCompareFactoryImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ExtensionsFactoryImpl.java
index b66efaf1b..d6c59927d 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramCompareFactoryImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ExtensionsFactoryImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,9 +8,9 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.impl;
+package org.eclipse.emf.compare.diagram.internal.extensions.impl;
-import org.eclipse.emf.compare.diagram.*;
+import org.eclipse.emf.compare.diagram.internal.extensions.*;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -26,24 +26,24 @@ import org.eclipse.emf.ecore.plugin.EcorePlugin;
* <!-- end-user-doc -->
* @generated
*/
-public class DiagramCompareFactoryImpl extends EFactoryImpl implements DiagramCompareFactory {
+public class ExtensionsFactoryImpl extends EFactoryImpl implements ExtensionsFactory {
/**
* Creates the default factory implementation.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public static DiagramCompareFactory init() {
+ public static ExtensionsFactory init() {
try {
- DiagramCompareFactory theDiagramCompareFactory = (DiagramCompareFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/emf/compare/diagram/2.0");
- if (theDiagramCompareFactory != null) {
- return theDiagramCompareFactory;
+ ExtensionsFactory theExtensionsFactory = (ExtensionsFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/emf/compare/diagram/2.0");
+ if (theExtensionsFactory != null) {
+ return theExtensionsFactory;
}
}
catch (Exception exception) {
EcorePlugin.INSTANCE.log(exception);
}
- return new DiagramCompareFactoryImpl();
+ return new ExtensionsFactoryImpl();
}
/**
@@ -52,7 +52,7 @@ public class DiagramCompareFactoryImpl extends EFactoryImpl implements DiagramCo
* <!-- end-user-doc -->
* @generated
*/
- public DiagramCompareFactoryImpl() {
+ public ExtensionsFactoryImpl() {
super();
}
@@ -64,11 +64,10 @@ public class DiagramCompareFactoryImpl extends EFactoryImpl implements DiagramCo
@Override
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
- case DiagramComparePackage.SHOW: return createShow();
- case DiagramComparePackage.HIDE: return createHide();
- case DiagramComparePackage.NODE_CHANGE: return createNodeChange();
- case DiagramComparePackage.EDGE_CHANGE: return createEdgeChange();
- case DiagramComparePackage.LABEL_CHANGE: return createLabelChange();
+ case ExtensionsPackage.SHOW: return createShow();
+ case ExtensionsPackage.HIDE: return createHide();
+ case ExtensionsPackage.NODE_CHANGE: return createNodeChange();
+ case ExtensionsPackage.EDGE_CHANGE: return createEdgeChange();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -119,18 +118,8 @@ public class DiagramCompareFactoryImpl extends EFactoryImpl implements DiagramCo
* <!-- end-user-doc -->
* @generated
*/
- public LabelChange createLabelChange() {
- LabelChangeImpl labelChange = new LabelChangeImpl();
- return labelChange;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DiagramComparePackage getDiagramComparePackage() {
- return (DiagramComparePackage)getEPackage();
+ public ExtensionsPackage getExtensionsPackage() {
+ return (ExtensionsPackage)getEPackage();
}
/**
@@ -140,8 +129,8 @@ public class DiagramCompareFactoryImpl extends EFactoryImpl implements DiagramCo
* @generated
*/
@Deprecated
- public static DiagramComparePackage getPackage() {
- return DiagramComparePackage.eINSTANCE;
+ public static ExtensionsPackage getPackage() {
+ return ExtensionsPackage.eINSTANCE;
}
-} //DiagramCompareFactoryImpl
+} //ExtensionsFactoryImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramComparePackageImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ExtensionsPackageImpl.java
index 577f9c7cc..3a93a4d17 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/DiagramComparePackageImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ExtensionsPackageImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,49 +8,56 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.impl;
+package org.eclipse.emf.compare.diagram.internal.extensions.impl;
import org.eclipse.emf.compare.ComparePackage;
-import org.eclipse.emf.compare.diagram.DiagramCompareFactory;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.EdgeChange;
-import org.eclipse.emf.compare.diagram.Hide;
-import org.eclipse.emf.compare.diagram.LabelChange;
-import org.eclipse.emf.compare.diagram.NodeChange;
-import org.eclipse.emf.compare.diagram.Show;
-import org.eclipse.emf.ecore.EAttribute;
+
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
+import org.eclipse.emf.compare.diagram.internal.extensions.Hide;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.Show;
+
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EcorePackage;
+
import org.eclipse.emf.ecore.impl.EPackageImpl;
/**
- * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * An implementation of the model <b>Package</b>.
+ * <!-- end-user-doc -->
* @generated
*/
-public class DiagramComparePackageImpl extends EPackageImpl implements DiagramComparePackage {
+public class ExtensionsPackageImpl extends EPackageImpl implements ExtensionsPackage {
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass showEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass hideEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass nodeChangeEClass = null;
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private EClass edgeChangeEClass = null;
@@ -60,12 +67,6 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
* <!-- end-user-doc -->
* @generated
*/
- private EClass labelChangeEClass = null;
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
private EClass diagramDiffEClass = null;
/**
@@ -76,18 +77,20 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
* factory method {@link #init init()}, which also performs
* initialization of the package, or returns the registered package,
* if one already exists.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage#eNS_URI
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage#eNS_URI
* @see #init()
* @generated
*/
- private DiagramComparePackageImpl() {
- super(eNS_URI, DiagramCompareFactory.eINSTANCE);
+ private ExtensionsPackageImpl() {
+ super(eNS_URI, ExtensionsFactory.eINSTANCE);
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private static boolean isInited = false;
@@ -95,19 +98,20 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
/**
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
*
- * <p>This method is used to initialize {@link DiagramComparePackage#eINSTANCE} when that field is accessed.
+ * <p>This method is used to initialize {@link ExtensionsPackage#eINSTANCE} when that field is accessed.
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @see #eNS_URI
* @see #createPackageContents()
* @see #initializePackageContents()
* @generated
*/
- public static DiagramComparePackage init() {
- if (isInited) return (DiagramComparePackage)EPackage.Registry.INSTANCE.getEPackage(DiagramComparePackage.eNS_URI);
+ public static ExtensionsPackage init() {
+ if (isInited) return (ExtensionsPackage)EPackage.Registry.INSTANCE.getEPackage(ExtensionsPackage.eNS_URI);
// Obtain or create and register package
- DiagramComparePackageImpl theDiagramComparePackage = (DiagramComparePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DiagramComparePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DiagramComparePackageImpl());
+ ExtensionsPackageImpl theExtensionsPackage = (ExtensionsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ExtensionsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ExtensionsPackageImpl());
isInited = true;
@@ -115,22 +119,23 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
ComparePackage.eINSTANCE.eClass();
// Create package meta-data objects
- theDiagramComparePackage.createPackageContents();
+ theExtensionsPackage.createPackageContents();
// Initialize created meta-data
- theDiagramComparePackage.initializePackageContents();
+ theExtensionsPackage.initializePackageContents();
// Mark meta-data to indicate it can't be changed
- theDiagramComparePackage.freeze();
+ theExtensionsPackage.freeze();
// Update the registry and return the package
- EPackage.Registry.INSTANCE.put(DiagramComparePackage.eNS_URI, theDiagramComparePackage);
- return theDiagramComparePackage;
+ EPackage.Registry.INSTANCE.put(ExtensionsPackage.eNS_URI, theExtensionsPackage);
+ return theExtensionsPackage;
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EClass getShow() {
@@ -138,36 +143,12 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EClass getHide() {
- return hideEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EClass getNodeChange() {
- return nodeChangeEClass;
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
- public EClass getEdgeChange() {
- return edgeChangeEClass;
- }
-
- /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- public EClass getLabelChange() {
- return labelChangeEClass;
+ public EClass getHide() {
+ return hideEClass;
}
/**
@@ -175,8 +156,8 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getLabelChange_Left() {
- return (EAttribute)labelChangeEClass.getEStructuralFeatures().get(0);
+ public EClass getNodeChange() {
+ return nodeChangeEClass;
}
/**
@@ -184,8 +165,8 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getLabelChange_Right() {
- return (EAttribute)labelChangeEClass.getEStructuralFeatures().get(1);
+ public EClass getEdgeChange() {
+ return edgeChangeEClass;
}
/**
@@ -193,20 +174,13 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getLabelChange_Origin() {
- return (EAttribute)labelChangeEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- * @generated
- */
public EClass getDiagramDiff() {
return diagramDiffEClass;
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public EReference getDiagramDiff_SemanticDiff() {
@@ -223,15 +197,17 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
- public DiagramCompareFactory getDiagramCompareFactory() {
- return (DiagramCompareFactory)getEFactoryInstance();
+ public ExtensionsFactory getExtensionsFactory() {
+ return (ExtensionsFactory)getEFactoryInstance();
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private boolean isCreated = false;
@@ -239,7 +215,8 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
/**
* Creates the meta-model objects for the package. This method is
* guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public void createPackageContents() {
@@ -255,18 +232,14 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
edgeChangeEClass = createEClass(EDGE_CHANGE);
- labelChangeEClass = createEClass(LABEL_CHANGE);
- createEAttribute(labelChangeEClass, LABEL_CHANGE__LEFT);
- createEAttribute(labelChangeEClass, LABEL_CHANGE__RIGHT);
- createEAttribute(labelChangeEClass, LABEL_CHANGE__ORIGIN);
-
diagramDiffEClass = createEClass(DIAGRAM_DIFF);
createEReference(diagramDiffEClass, DIAGRAM_DIFF__SEMANTIC_DIFF);
createEReference(diagramDiffEClass, DIAGRAM_DIFF__VIEW);
}
/**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
private boolean isInitialized = false;
@@ -274,7 +247,8 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
/**
* Complete the initialization of the package and its meta-model. This
* method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc --> <!-- end-user-doc -->
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public void initializePackageContents() {
@@ -299,7 +273,6 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
hideEClass.getESuperTypes().add(this.getDiagramDiff());
nodeChangeEClass.getESuperTypes().add(this.getDiagramDiff());
edgeChangeEClass.getESuperTypes().add(this.getDiagramDiff());
- labelChangeEClass.getESuperTypes().add(this.getDiagramDiff());
diagramDiffEClass.getESuperTypes().add(theComparePackage.getDiff());
// Initialize classes and features; add operations and parameters
@@ -311,11 +284,6 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
initEClass(edgeChangeEClass, EdgeChange.class, "EdgeChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEClass(labelChangeEClass, LabelChange.class, "LabelChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getLabelChange_Left(), ecorePackage.getEString(), "left", null, 0, 1, LabelChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getLabelChange_Right(), ecorePackage.getEString(), "right", null, 0, 1, LabelChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getLabelChange_Origin(), ecorePackage.getEString(), "origin", null, 0, 1, LabelChange.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
initEClass(diagramDiffEClass, DiagramDiff.class, "DiagramDiff", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getDiagramDiff_SemanticDiff(), theComparePackage.getDiff(), null, "semanticDiff", null, 0, 1, DiagramDiff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getDiagramDiff_View(), theEcorePackage.getEObject(), null, "view", null, 0, 1, DiagramDiff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -324,4 +292,4 @@ public class DiagramComparePackageImpl extends EPackageImpl implements DiagramCo
createResource(eNS_URI);
}
-} // DiagramComparePackageImpl
+} //ExtensionsPackageImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/HideImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/HideImpl.java
index 9bbefde5b..00df9f474 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/HideImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/HideImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,10 +8,10 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.impl;
+package org.eclipse.emf.compare.diagram.internal.extensions.impl;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.Hide;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
+import org.eclipse.emf.compare.diagram.internal.extensions.Hide;
import org.eclipse.emf.ecore.EClass;
@@ -41,7 +41,7 @@ public class HideImpl extends DiagramDiffImpl implements Hide {
*/
@Override
protected EClass eStaticClass() {
- return DiagramComparePackage.Literals.HIDE;
+ return ExtensionsPackage.Literals.HIDE;
}
} //HideImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/NodeChangeImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/NodeChangeImpl.java
index 83d97ccce..15c4fcc88 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/NodeChangeImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/NodeChangeImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,10 +8,10 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.impl;
+package org.eclipse.emf.compare.diagram.internal.extensions.impl;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.NodeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
import org.eclipse.emf.ecore.EClass;
@@ -41,7 +41,7 @@ public class NodeChangeImpl extends DiagramDiffImpl implements NodeChange {
*/
@Override
protected EClass eStaticClass() {
- return DiagramComparePackage.Literals.NODE_CHANGE;
+ return ExtensionsPackage.Literals.NODE_CHANGE;
}
} //NodeChangeImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/ShowImpl.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ShowImpl.java
index 57001208a..425d28ae5 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/impl/ShowImpl.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/impl/ShowImpl.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,10 +8,10 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.impl;
+package org.eclipse.emf.compare.diagram.internal.extensions.impl;
-import org.eclipse.emf.compare.diagram.DiagramComparePackage;
-import org.eclipse.emf.compare.diagram.Show;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage;
+import org.eclipse.emf.compare.diagram.internal.extensions.Show;
import org.eclipse.emf.ecore.EClass;
@@ -41,7 +41,7 @@ public class ShowImpl extends DiagramDiffImpl implements Show {
*/
@Override
protected EClass eStaticClass() {
- return DiagramComparePackage.Literals.SHOW;
+ return ExtensionsPackage.Literals.SHOW;
}
} //ShowImpl
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/util/DiagramCompareAdapterFactory.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/util/ExtensionsAdapterFactory.java
index f6806528f..211e8450e 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/util/DiagramCompareAdapterFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/util/ExtensionsAdapterFactory.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.util;
+package org.eclipse.emf.compare.diagram.internal.extensions.util;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
@@ -17,7 +17,7 @@ import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.diagram.*;
+import org.eclipse.emf.compare.diagram.internal.extensions.*;
import org.eclipse.emf.ecore.EObject;
@@ -26,17 +26,17 @@ import org.eclipse.emf.ecore.EObject;
* The <b>Adapter Factory</b> for the model.
* It provides an adapter <code>createXXX</code> method for each class of the model.
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage
* @generated
*/
-public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
+public class ExtensionsAdapterFactory extends AdapterFactoryImpl {
/**
* The cached model package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected static DiagramComparePackage modelPackage;
+ protected static ExtensionsPackage modelPackage;
/**
* Creates an instance of the adapter factory.
@@ -44,9 +44,9 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
* <!-- end-user-doc -->
* @generated
*/
- public DiagramCompareAdapterFactory() {
+ public ExtensionsAdapterFactory() {
if (modelPackage == null) {
- modelPackage = DiagramComparePackage.eINSTANCE;
+ modelPackage = ExtensionsPackage.eINSTANCE;
}
}
@@ -75,8 +75,8 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
* <!-- end-user-doc -->
* @generated
*/
- protected DiagramCompareSwitch<Adapter> modelSwitch =
- new DiagramCompareSwitch<Adapter>() {
+ protected ExtensionsSwitch<Adapter> modelSwitch =
+ new ExtensionsSwitch<Adapter>() {
@Override
public Adapter caseShow(Show object) {
return createShowAdapter();
@@ -94,10 +94,6 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
return createEdgeChangeAdapter();
}
@Override
- public Adapter caseLabelChange(LabelChange object) {
- return createLabelChangeAdapter();
- }
- @Override
public Adapter caseDiagramDiff(DiagramDiff object) {
return createDiagramDiffAdapter();
}
@@ -126,13 +122,13 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.Show <em>Show</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.internal.extensions.Show <em>Show</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
- * @see org.eclipse.emf.compare.diagram.Show
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.Show
* @generated
*/
public Adapter createShowAdapter() {
@@ -140,13 +136,13 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.Hide <em>Hide</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.internal.extensions.Hide <em>Hide</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
- * @see org.eclipse.emf.compare.diagram.Hide
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.Hide
* @generated
*/
public Adapter createHideAdapter() {
@@ -154,13 +150,13 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.NodeChange <em>Node Change</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.internal.extensions.NodeChange <em>Node Change</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
- * @see org.eclipse.emf.compare.diagram.NodeChange
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.NodeChange
* @generated
*/
public Adapter createNodeChangeAdapter() {
@@ -168,13 +164,13 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.EdgeChange <em>Edge Change</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange <em>Edge Change</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
- * @see org.eclipse.emf.compare.diagram.EdgeChange
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange
* @generated
*/
public Adapter createEdgeChangeAdapter() {
@@ -182,27 +178,13 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
}
/**
- * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.LabelChange <em>Label Change</em>}'.
- * <!-- begin-user-doc -->
- * This default implementation returns null so that we can easily ignore cases;
- * it's useful to ignore a case when inheritance will catch all the cases anyway.
- * <!-- end-user-doc -->
- * @return the new adapter.
- * @see org.eclipse.emf.compare.diagram.LabelChange
- * @generated
- */
- public Adapter createLabelChangeAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.DiagramDiff <em>Diagram Diff</em>}'.
+ * Creates a new adapter for an object of class '{@link org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff <em>Diagram Diff</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
* @return the new adapter.
- * @see org.eclipse.emf.compare.diagram.DiagramDiff
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff
* @generated
*/
public Adapter createDiagramDiffAdapter() {
@@ -235,4 +217,4 @@ public class DiagramCompareAdapterFactory extends AdapterFactoryImpl {
return null;
}
-} //DiagramCompareAdapterFactory
+} //ExtensionsAdapterFactory
diff --git a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/util/DiagramCompareSwitch.java b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/util/ExtensionsSwitch.java
index 60178da25..22997ef59 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/util/DiagramCompareSwitch.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src-gen/org/eclipse/emf/compare/diagram/internal/extensions/util/ExtensionsSwitch.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,16 +8,16 @@
* Contributors:
* Obeo - initial API and implementation
*/
-package org.eclipse.emf.compare.diagram.util;
-
-import java.util.List;
+package org.eclipse.emf.compare.diagram.internal.extensions.util;
import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.diagram.*;
+import org.eclipse.emf.compare.diagram.internal.extensions.*;
-import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+import org.eclipse.emf.ecore.util.Switch;
/**
* <!-- begin-user-doc -->
@@ -29,17 +29,17 @@ import org.eclipse.emf.ecore.EObject;
* until a non-null result is returned,
* which is the result of the switch.
* <!-- end-user-doc -->
- * @see org.eclipse.emf.compare.diagram.DiagramComparePackage
+ * @see org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsPackage
* @generated
*/
-public class DiagramCompareSwitch<T> {
+public class ExtensionsSwitch<T> extends Switch<T> {
/**
* The cached model package
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- protected static DiagramComparePackage modelPackage;
+ protected static ExtensionsPackage modelPackage;
/**
* Creates an instance of the switch.
@@ -47,41 +47,23 @@ public class DiagramCompareSwitch<T> {
* <!-- end-user-doc -->
* @generated
*/
- public DiagramCompareSwitch() {
+ public ExtensionsSwitch() {
if (modelPackage == null) {
- modelPackage = DiagramComparePackage.eINSTANCE;
+ modelPackage = ExtensionsPackage.eINSTANCE;
}
}
/**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
+ * Checks whether this is a switch for the given package.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
+ * @parameter ePackage the package in question.
+ * @return whether this is a switch for the given package.
* @generated
*/
- public T doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the first non-null result returned by a <code>caseXXX</code> call.
- * @generated
- */
- protected T doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- }
- else {
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return
- eSuperTypes.isEmpty() ?
- defaultCase(theEObject) :
- doSwitch(eSuperTypes.get(0), theEObject);
- }
+ @Override
+ protected boolean isSwitchFor(EPackage ePackage) {
+ return ePackage == modelPackage;
}
/**
@@ -91,9 +73,10 @@ public class DiagramCompareSwitch<T> {
* @return the first non-null result returned by a <code>caseXXX</code> call.
* @generated
*/
+ @Override
protected T doSwitch(int classifierID, EObject theEObject) {
switch (classifierID) {
- case DiagramComparePackage.SHOW: {
+ case ExtensionsPackage.SHOW: {
Show show = (Show)theEObject;
T result = caseShow(show);
if (result == null) result = caseDiagramDiff(show);
@@ -101,7 +84,7 @@ public class DiagramCompareSwitch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
- case DiagramComparePackage.HIDE: {
+ case ExtensionsPackage.HIDE: {
Hide hide = (Hide)theEObject;
T result = caseHide(hide);
if (result == null) result = caseDiagramDiff(hide);
@@ -109,7 +92,7 @@ public class DiagramCompareSwitch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
- case DiagramComparePackage.NODE_CHANGE: {
+ case ExtensionsPackage.NODE_CHANGE: {
NodeChange nodeChange = (NodeChange)theEObject;
T result = caseNodeChange(nodeChange);
if (result == null) result = caseDiagramDiff(nodeChange);
@@ -117,7 +100,7 @@ public class DiagramCompareSwitch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
- case DiagramComparePackage.EDGE_CHANGE: {
+ case ExtensionsPackage.EDGE_CHANGE: {
EdgeChange edgeChange = (EdgeChange)theEObject;
T result = caseEdgeChange(edgeChange);
if (result == null) result = caseDiagramDiff(edgeChange);
@@ -125,15 +108,7 @@ public class DiagramCompareSwitch<T> {
if (result == null) result = defaultCase(theEObject);
return result;
}
- case DiagramComparePackage.LABEL_CHANGE: {
- LabelChange labelChange = (LabelChange)theEObject;
- T result = caseLabelChange(labelChange);
- if (result == null) result = caseDiagramDiff(labelChange);
- if (result == null) result = caseDiff(labelChange);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
- case DiagramComparePackage.DIAGRAM_DIFF: {
+ case ExtensionsPackage.DIAGRAM_DIFF: {
DiagramDiff diagramDiff = (DiagramDiff)theEObject;
T result = caseDiagramDiff(diagramDiff);
if (result == null) result = caseDiff(diagramDiff);
@@ -205,21 +180,6 @@ public class DiagramCompareSwitch<T> {
}
/**
- * Returns the result of interpreting the object as an instance of '<em>Label Change</em>'.
- * <!-- begin-user-doc -->
- * This implementation returns null;
- * returning a non-null result will terminate the switch.
- * <!-- end-user-doc -->
- * @param object the target of the switch.
- * @return the result of interpreting the object as an instance of '<em>Label Change</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseLabelChange(LabelChange object) {
- return null;
- }
-
- /**
* Returns the result of interpreting the object as an instance of '<em>Diagram Diff</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
@@ -260,8 +220,9 @@ public class DiagramCompareSwitch<T> {
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
* @generated
*/
+ @Override
public T defaultCase(EObject object) {
return null;
}
-} //DiagramCompareSwitch
+} //ExtensionsSwitch
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/DiffExtensionFactoryRegistry.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/DiffExtensionFactoryRegistry.java
deleted file mode 100644
index 4e9943915..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/DiffExtensionFactoryRegistry.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.internal.extension;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.diagram.diff.DiagramComparisonConfiguration;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.factories.EdgeChangeFactory;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.factories.HideFactory;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.factories.NodeChangeFactory;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.factories.ShowFactory;
-
-/**
- * Registry of all {@link IDiffExtensionFactory}.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- */
-public final class DiffExtensionFactoryRegistry {
-
- /**
- * Constructor.
- */
- private DiffExtensionFactoryRegistry() {
- }
-
- /**
- * Creates and returns all {@link IDiffExtensionFactory} available in this plugin. The returned Set in
- * unmodifiable.
- *
- * @param configuration
- * The diagram comparison configuration.
- * @return an unmodifiable set of all {@link IDiffExtensionFactory}.
- */
- public static Map<Class<? extends Diff>, IDiffExtensionFactory> createExtensionFactories(
- DiagramComparisonConfiguration configuration) {
- final Map<Class<? extends Diff>, IDiffExtensionFactory> dataset = new HashMap<Class<? extends Diff>, IDiffExtensionFactory>();
-
- List<IDiffExtensionFactory> factories = new ArrayList<IDiffExtensionFactory>();
- factories.add(new HideFactory());
- factories.add(new ShowFactory());
- factories.add(new NodeChangeFactory(configuration));
- factories.add(new EdgeChangeFactory());
-
- for (IDiffExtensionFactory iDiffExtensionFactory : factories) {
- dataset.put(iDiffExtensionFactory.getExtensionKind(), iDiffExtensionFactory);
- }
-
- return Collections.unmodifiableMap(dataset);
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/GMFLabelUtil.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/GMFLabelUtil.java
deleted file mode 100644
index 78fa47bfb..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/GMFLabelUtil.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.util;
-
-import com.google.common.collect.Maps;
-
-import java.util.Map;
-
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.commands.CommandStack;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
-import org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory;
-import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This utility class will be used to request and set labels on GMF views.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
-public final class GMFLabelUtil {
- // CHECKSTYLE:OFF
- // FIXME this is dangerous (potential memory leaks) and crappy (singleton), but was made to avoid creating
- // thousands of Diagrams.
- private static Map<Diagram, DiagramEditPart> DIAGRAM_EDIT_PARTS = Maps.newHashMap();
-
- // CHECKSTYLE:ON
-
- /**
- * Constructor.
- */
- private GMFLabelUtil() {
- // Hides default constructor
- }
-
- /**
- * Retrieve the {@link ITextAwareEditPart} related to a view.
- *
- * @param view
- * The view.
- * @return The text editpart.
- */
- public static ITextAwareEditPart getTextEditPart(View view) {
- final LabelRequestor labelRequestor = new LabelRequestor(view);
- Display.getDefault().syncExec(labelRequestor);
- return labelRequestor.getTextEditPart();
- }
-
- /**
- * Retrieve the GMF parser from the specified view.
- *
- * @param view
- * The view.
- * @return The parser.
- */
- public static IParser getParser(View view) {
- final ParserRequestor parserRequestor = new ParserRequestor(view);
- Display.getDefault().syncExec(parserRequestor);
- return parserRequestor.getParser();
- }
-
- /**
- * Set the GMF label of the specified view with the specified label.
- *
- * @param view
- * The view.
- * @param label
- * The label.
- */
- public static void setLabel(View view, String label) {
- final LabelSetter labelSetter = new LabelSetter(view, label);
- Display.getDefault().syncExec(labelSetter);
- }
-
- /**
- * Clean edit parts and registry.
- */
- public static void cleanup() {
- for (Map.Entry<Diagram, DiagramEditPart> entry : DIAGRAM_EDIT_PARTS.entrySet()) {
- entry.getValue().deactivate();
- }
- DIAGRAM_EDIT_PARTS.clear();
- }
-
- /**
- * Retrieve the {@link ITextAwareEditPart} related to the specified {@link IGraphicalEditPart}.
- *
- * @param parent
- * The {@link IGraphicalEditPart}
- * @return The {@link ITextAwareEditPart}
- */
- private static ITextAwareEditPart findTextAwareEditPart(IGraphicalEditPart parent) {
- ITextAwareEditPart result = null;
- if (parent instanceof ITextAwareEditPart) {
- result = (ITextAwareEditPart)parent;
- } else {
- final EditPart primaryChildEditPart = parent.getPrimaryChildEditPart();
- if (primaryChildEditPart instanceof ITextAwareEditPart) {
- return (ITextAwareEditPart)primaryChildEditPart;
- }
- for (Object obj : parent.getChildren()) {
- if (obj instanceof ITextAwareEditPart) {
- result = (ITextAwareEditPart)obj;
- break;
- }
- }
- }
- return result;
- }
-
- /**
- * Utility Class to handle labels on GMF views.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
- public abstract static class AbstractLabelHandling implements Runnable {
-
- /**
- * The view to deal with.
- */
- protected View view;
-
- /**
- * The result of the operation of getting and setting label.
- */
- protected String label = ""; //$NON-NLS-1$
-
- /**
- * The editpart of the label.
- */
- protected ITextAwareEditPart mTextEp;
-
- /**
- * Constructor.
- *
- * @param pView
- * The view.
- */
- public AbstractLabelHandling(View pView) {
- this.view = pView;
- }
-
- /**
- * Constructor.
- *
- * @param pView
- * The view.
- * @param pLabel
- * The label.
- */
- public AbstractLabelHandling(View pView, String pLabel) {
- this.view = pView;
- this.label = pLabel;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- final Diagram diagram = view.getDiagram();
-
- final ResourceSet resourceSet = diagram.eResource().getResourceSet();
- final TransactionalEditingDomain ted = TransactionalEditingDomain.Factory.INSTANCE
- .getEditingDomain(resourceSet);
- if (ted == null) {
- TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(resourceSet);
- }
-
- DiagramEditPart diagramEditPart = DIAGRAM_EDIT_PARTS.get(diagram);
- if (diagramEditPart == null) {
- Shell shell = null;
- try {
- shell = new Shell();
- diagramEditPart = OffscreenEditPartFactory.getInstance().createDiagramEditPart(diagram,
- shell);
- DIAGRAM_EDIT_PARTS.put(diagram, diagramEditPart);
- } finally {
- if (shell != null) {
- shell.dispose();
- }
- }
- }
-
- if (diagramEditPart != null) {
- final Object viewEp = diagramEditPart.getViewer().getEditPartRegistry().get(view);
-
- if (viewEp instanceof IGraphicalEditPart) {
- final ITextAwareEditPart textEp = findTextAwareEditPart((IGraphicalEditPart)viewEp);
-
- if (textEp != null) {
- this.mTextEp = textEp;
- handle(textEp);
- }
- }
- }
- }
-
- /**
- * Deals with the specified label editpart.
- *
- * @param editPart
- * The editpart.
- */
- abstract void handle(ITextAwareEditPart editPart);
-
- public ITextAwareEditPart getTextEditPart() {
- return mTextEp;
- }
-
- }
-
- /**
- * Utility Class to retrieve the label from a GMF view.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
- public static final class LabelRequestor extends AbstractLabelHandling {
-
- /**
- * Constructor.
- *
- * @param pView
- * The view.
- */
- public LabelRequestor(View pView) {
- super(pView);
- }
-
- /**
- * Get the label.
- *
- * @return the label;
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.diff.util.GMFLabelUtil.LabelHandling#handle(org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart)
- */
- @Override
- void handle(ITextAwareEditPart editPart) {
- label = editPart.getEditText();
- }
-
- }
-
- /**
- * Utility Class to retrieve the parser from a GMF view.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
- public static final class ParserRequestor extends AbstractLabelHandling {
-
- /**
- * The parser.
- */
- private IParser parser;
-
- /**
- * Constructor.
- *
- * @param pView
- * The view.
- */
- public ParserRequestor(View pView) {
- super(pView);
- }
-
- /**
- * Get the parser.
- *
- * @return the parser;
- */
- public IParser getParser() {
- return parser;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- void handle(ITextAwareEditPart editPart) {
- parser = editPart.getParser();
- }
-
- }
-
- /**
- * Utility Class to set the label from a GMF view (and to impact on the semantic objects).
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
- public static final class LabelSetter extends AbstractLabelHandling {
-
- /**
- * Constructor.
- *
- * @param pView
- * The view.
- * @param pLabel
- * The label.
- */
- public LabelSetter(View pView, String pLabel) {
- super(pView, pLabel);
- }
-
- @Override
- void handle(ITextAwareEditPart editPart) {
- final ICommand iCommand = getDirectEditCommand(editPart);
-
- final CommandStack stack = editPart.getViewer().getEditDomain().getCommandStack();
- stack.execute(new ICommandProxy(iCommand));
- }
-
- /**
- * Get the GMF Command from the text edit part. It is inspired from @see
- * LabelDirectEditPolicy#getDirectEditCommand(DirectEditRequest).
- *
- * @param textEp
- * The text edit part.
- * @return the command.
- */
- private ICommand getDirectEditCommand(ITextAwareEditPart textEp) {
- final EObject model = (EObject)textEp.getModel();
- EObjectAdapter elementAdapter = null;
- if (model instanceof View) {
- final View lview = (View)model;
- elementAdapter = new EObjectAdapterEx(ViewUtil.resolveSemanticElement(lview), lview);
- } else {
- elementAdapter = new EObjectAdapterEx(model, null);
- }
-
- return textEp.getParser().getParseCommand(elementAdapter, label, 0);
- }
-
- /**
- * Class inspired from @see LabelDirectEditPolicy.
- *
- * @author Cedric Notot <a href="mailto:cedric.notot@obeo.fr">cedric.notot@obeo.fr</a>
- */
- class EObjectAdapterEx extends EObjectAdapter {
-
- /**
- * The view.
- */
- private View mView;
-
- /**
- * constructor.
- *
- * @param element
- * element to be wrapped
- * @param pView
- * view to be wrapped
- */
- public EObjectAdapterEx(EObject element, View pView) {
- super(element);
- this.mView = pView;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter#getAdapter(java.lang.Class)
- */
- @Override
- public Object getAdapter(Class adapter) {
- Object result = null;
- final Object o = super.getAdapter(adapter);
- if (o != null) {
- result = o;
- } else if (adapter.equals(View.class)) {
- result = mView;
- }
- return result;
- }
- }
-
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramComparisonConfiguration.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramConfiguration.java
index 48fa40a6e..9fd48cb3c 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramComparisonConfiguration.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramConfiguration.java
@@ -8,14 +8,14 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff;
+package org.eclipse.emf.compare.diagram.internal;
/**
* Configuration of the diagram comparison.
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class DiagramComparisonConfiguration {
+public class CompareDiagramConfiguration {
/** Detection threshold value for the move of a graphical object. */
private int moveThreshold;
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/DiagramCompareConstants.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramConstants.java
index 9986fb963..584ef8282 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/DiagramCompareConstants.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramConstants.java
@@ -8,17 +8,17 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.util;
+package org.eclipse.emf.compare.diagram.internal;
/**
* Defines constants used throughout EMF Compare's UI.
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
-public interface DiagramCompareConstants {
+public interface CompareDiagramConstants {
/** Preferences description for the move threshold. */
- String PREFERENCES_DESCRIPTION_MOVE_THRESHOLD = DiagramCompareUIMessages
+ String PREFERENCES_DESCRIPTION_MOVE_THRESHOLD = CompareDiagramUIMessages
.getString("DiagramCompareConstants.preferences.moveThresholdLabel") + ':'; //$NON-NLS-1$
/** Preferences key for the move threshold. */
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/DiagramDiffEnginePlugin.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPlugin.java
index f70e2a0bc..f26c9b69e 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/DiagramDiffEnginePlugin.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPlugin.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram;
+package org.eclipse.emf.compare.diagram.internal;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
@@ -18,18 +18,18 @@ import org.osgi.framework.BundleContext;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class DiagramDiffEnginePlugin extends Plugin {
+public class CompareDiagramPlugin extends Plugin {
/** The plugin ID. */
public static final String PLUGIN_ID = "org.eclipse.emf.compare.diagram"; //$NON-NLS-1$
/** This plug-in's shared instance. */
- private static DiagramDiffEnginePlugin plugin;
+ private static CompareDiagramPlugin plugin;
/**
* Default constructor.
*/
- public DiagramDiffEnginePlugin() {
+ public CompareDiagramPlugin() {
plugin = this;
}
@@ -38,7 +38,7 @@ public class DiagramDiffEnginePlugin extends Plugin {
*
* @return the shared instance
*/
- public static DiagramDiffEnginePlugin getDefault() {
+ public static CompareDiagramPlugin getDefault() {
return plugin;
}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java
index 1e7ad231f..acdf4b467 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/DiagramDiffExtensionPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramPostProcessor.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff;
+package org.eclipse.emf.compare.diagram.internal;
import java.util.HashSet;
import java.util.Map;
@@ -18,9 +18,9 @@ import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.DiffExtensionFactoryRegistry;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.factories.DiagramExtensionFactoryRegistry;
+import org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory;
import org.eclipse.emf.compare.extension.IPostProcessor;
/**
@@ -28,18 +28,18 @@ import org.eclipse.emf.compare.extension.IPostProcessor;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
+public class CompareDiagramPostProcessor implements IPostProcessor {
/** Registry of diagram difference extension factories. */
- private Set<IDiffExtensionFactory> diagramExtensionFactories;
+ private Set<IDiagramExtensionFactory> diagramExtensionFactories;
/** Diagram comparison configuration. */
- private DiagramComparisonConfiguration configuration;
+ private CompareDiagramConfiguration configuration;
/**
* Constructor.
*/
- public DiagramDiffExtensionPostProcessor() {
+ public CompareDiagramPostProcessor() {
}
@@ -49,7 +49,7 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
* @param configuration
* The diagram comparison configuration.
*/
- public DiagramDiffExtensionPostProcessor(DiagramComparisonConfiguration configuration) {
+ public CompareDiagramPostProcessor(CompareDiagramConfiguration configuration) {
this.configuration = configuration;
}
@@ -59,7 +59,7 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
* @param configuration
* The configuration.
*/
- public void setConfiguration(DiagramComparisonConfiguration configuration) {
+ public void setConfiguration(CompareDiagramConfiguration configuration) {
this.configuration = configuration;
}
@@ -88,9 +88,10 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
* org.eclipse.emf.common.util.Monitor)
*/
public void postRequirements(Comparison comparison, Monitor monitor) {
- final Map<Class<? extends Diff>, IDiffExtensionFactory> mapDiagramExtensionFactories = DiffExtensionFactoryRegistry
+ final Map<Class<? extends Diff>, IDiagramExtensionFactory> mapDiagramExtensionFactories = DiagramExtensionFactoryRegistry
.createExtensionFactories(configuration);
- diagramExtensionFactories = new HashSet<IDiffExtensionFactory>(mapDiagramExtensionFactories.values());
+ diagramExtensionFactories = new HashSet<IDiagramExtensionFactory>(mapDiagramExtensionFactories
+ .values());
// Creation of the diagram difference extensions
for (Diff diff : comparison.getDifferences()) {
@@ -101,7 +102,8 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
for (Diff diff : comparison.getDifferences()) {
if (diff instanceof DiagramDiff) {
final Class<?> classDiffElement = diff.eClass().getInstanceClass();
- final IDiffExtensionFactory diffFactory = mapDiagramExtensionFactories.get(classDiffElement);
+ final IDiagramExtensionFactory diffFactory = mapDiagramExtensionFactories
+ .get(classDiffElement);
if (diffFactory != null) {
diffFactory.fillRequiredDifferences(comparison, diff);
}
@@ -128,13 +130,22 @@ public class DiagramDiffExtensionPostProcessor implements IPostProcessor {
}
/**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postComparison(Comparison comparison, Monitor monitor) {
+ }
+
+ /**
* Creates the difference extensions in relation to the existing difference.
*
* @param element
* The current candidate difference for the build of the diagram extension.
*/
private void applyManagedTypes(Diff element) {
- for (IDiffExtensionFactory factory : diagramExtensionFactories) {
+ for (IDiagramExtensionFactory factory : diagramExtensionFactories) {
if (factory.handles(element)) {
final Diff extension = factory.create(element);
final Match match = factory.getParentMatch(element);
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/DiagramCompareUIMessages.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramUIMessages.java
index 9421fe6cf..d7cacd24f 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/DiagramCompareUIMessages.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/CompareDiagramUIMessages.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.util;
+package org.eclipse.emf.compare.diagram.internal;
import java.text.MessageFormat;
import java.util.MissingResourceException;
@@ -19,9 +19,9 @@ import java.util.ResourceBundle;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public final class DiagramCompareUIMessages {
+public final class CompareDiagramUIMessages {
/** Full qualified path to the properties file in which to seek the keys. */
- private static final String BUNDLE_NAME = "org.eclipse.emf.compare.diagram.diff.util.diagramcompareuimessages"; //$NON-NLS-1$
+ private static final String BUNDLE_NAME = "org.eclipse.emf.compare.diagram.internal.diagramcompareuimessages"; //$NON-NLS-1$
/** Contains the locale specific {@link String}s needed by this plug-in. */
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
@@ -29,7 +29,7 @@ public final class DiagramCompareUIMessages {
/**
* Utility classes don't need to (and shouldn't) be instantiated.
*/
- private DiagramCompareUIMessages() {
+ private CompareDiagramUIMessages() {
// prevents instantiation
}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/diagramcompareuimessages.properties b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/diagramcompareuimessages.properties
index f7ec4253a..f7ec4253a 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/util/diagramcompareuimessages.properties
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/diagramcompareuimessages.properties
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/AbstractDiffExtensionFactory.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramExtensionFactory.java
index 07175bb0d..edf87b677 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/AbstractDiffExtensionFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/AbstractDiagramExtensionFactory.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.internal.extension;
+package org.eclipse.emf.compare.diagram.internal.factories;
import com.google.common.base.Predicate;
import com.google.common.collect.Sets;
@@ -36,7 +36,7 @@ import org.eclipse.gmf.runtime.notation.View;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public abstract class AbstractDiffExtensionFactory implements IDiffExtensionFactory {
+public abstract class AbstractDiagramExtensionFactory implements IDiagramExtensionFactory {
/**
* Switch which returns the <code>DifferenceKind</code> of the matching diagram extension in relation to
@@ -116,7 +116,7 @@ public abstract class AbstractDiffExtensionFactory implements IDiffExtensionFact
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#handles(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#handles(org.eclipse.emf.compare.Diff)
*/
public boolean handles(Diff input) {
return getRelatedExtensionKind(input) != null && !isDiffOnAddOrDelete(input);
@@ -125,7 +125,7 @@ public abstract class AbstractDiffExtensionFactory implements IDiffExtensionFact
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#getParentMatch(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#getParentMatch(org.eclipse.emf.compare.Diff)
*/
public Match getParentMatch(Diff input) {
return input.getMatch();
@@ -314,7 +314,7 @@ public abstract class AbstractDiffExtensionFactory implements IDiffExtensionFact
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#getExtensionKind()
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#getExtensionKind()
*/
public Class<? extends Diff> getExtensionKind() {
return Diff.class;
@@ -372,7 +372,7 @@ public abstract class AbstractDiffExtensionFactory implements IDiffExtensionFact
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#fillRequiredDifferences(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#fillRequiredDifferences(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.compare.Diff)
*/
public void fillRequiredDifferences(Comparison comparison, Diff extension) {
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/DiagramExtensionFactoryRegistry.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/DiagramExtensionFactoryRegistry.java
new file mode 100644
index 000000000..3d7ab2005
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/DiagramExtensionFactoryRegistry.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.diagram.internal.factories;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramConfiguration;
+import org.eclipse.emf.compare.diagram.internal.factories.extensions.EdgeChangeFactory;
+import org.eclipse.emf.compare.diagram.internal.factories.extensions.HideFactory;
+import org.eclipse.emf.compare.diagram.internal.factories.extensions.NodeChangeFactory;
+import org.eclipse.emf.compare.diagram.internal.factories.extensions.ShowFactory;
+
+/**
+ * Registry of all {@link IDiagramExtensionFactory}.
+ *
+ * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
+ */
+public final class DiagramExtensionFactoryRegistry {
+
+ /**
+ * Constructor.
+ */
+ private DiagramExtensionFactoryRegistry() {
+ }
+
+ /**
+ * Creates and returns all {@link IDiagramExtensionFactory} available in this plugin. The returned Set in
+ * unmodifiable.
+ *
+ * @param configuration
+ * The diagram comparison configuration.
+ * @return an unmodifiable set of all {@link IDiagramExtensionFactory}.
+ */
+ public static Map<Class<? extends Diff>, IDiagramExtensionFactory> createExtensionFactories(
+ CompareDiagramConfiguration configuration) {
+ final Map<Class<? extends Diff>, IDiagramExtensionFactory> dataset = new HashMap<Class<? extends Diff>, IDiagramExtensionFactory>();
+
+ List<IDiagramExtensionFactory> factories = new ArrayList<IDiagramExtensionFactory>();
+ factories.add(new HideFactory());
+ factories.add(new ShowFactory());
+ factories.add(new NodeChangeFactory(configuration));
+ factories.add(new EdgeChangeFactory());
+
+ for (IDiagramExtensionFactory iDiffExtensionFactory : factories) {
+ dataset.put(iDiffExtensionFactory.getExtensionKind(), iDiffExtensionFactory);
+ }
+
+ return Collections.unmodifiableMap(dataset);
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/IDiffExtensionFactory.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/IDiagramExtensionFactory.java
index b6c88cb19..68223ab6a 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/IDiffExtensionFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/IDiagramExtensionFactory.java
@@ -8,14 +8,14 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.internal.extension;
+package org.eclipse.emf.compare.diagram.internal.factories;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.Match;
/**
- * An {@link IDiffExtensionFactory} is a factory capable to create an {@link Diff extension} from a
+ * An {@link IDiagramExtensionFactory} is a factory capable to create an {@link Diff extension} from a
* {@link Diff} if and only if this factory can {@link #handles(Diff) handle} the given {@link Diff}.
* <p>
* A factory must be able to say in which parent an {@link Diff extension} must be attached if it handles the
@@ -23,7 +23,7 @@ import org.eclipse.emf.compare.Match;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public interface IDiffExtensionFactory {
+public interface IDiagramExtensionFactory {
/**
* Returns the kind of extension that this factory has to create.
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/EdgeChangeFactory.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/EdgeChangeFactory.java
index 39897d86d..8e349506f 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/EdgeChangeFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/EdgeChangeFactory.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.internal.extension.factories;
+package org.eclipse.emf.compare.diagram.internal.factories.extensions;
import static com.google.common.collect.Iterables.filter;
@@ -24,10 +24,10 @@ import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.diagram.DiagramCompareFactory;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.EdgeChange;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.EdgeChange;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsFactory;
+import org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory;
import org.eclipse.emf.compare.utils.MatchUtil;
import org.eclipse.emf.compare.utils.ReferenceUtil;
import org.eclipse.emf.ecore.EObject;
@@ -41,12 +41,12 @@ import org.eclipse.gmf.runtime.notation.View;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
+public class EdgeChangeFactory extends AbstractDiagramExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#getExtensionKind()
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#getExtensionKind()
*/
@Override
public Class<? extends Diff> getExtensionKind() {
@@ -56,10 +56,10 @@ public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#create(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#create(org.eclipse.emf.compare.Diff)
*/
public Diff create(Diff input) {
- final EdgeChange ret = DiagramCompareFactory.eINSTANCE.createEdgeChange();
+ final EdgeChange ret = ExtensionsFactory.eINSTANCE.createEdgeChange();
final DifferenceKind extensionKind = getRelatedExtensionKind(input);
@@ -95,7 +95,7 @@ public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#fillRequiredDifferences(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#fillRequiredDifferences(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.compare.Diff)
*/
@Override
@@ -184,7 +184,7 @@ public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#getParentMatch(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#getParentMatch(org.eclipse.emf.compare.Diff)
*/
@Override
public Match getParentMatch(Diff input) {
@@ -194,7 +194,7 @@ public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionAdd(org.eclipse.emf.compare.ReferenceChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionAdd(org.eclipse.emf.compare.ReferenceChange)
*/
@Override
protected boolean isRelatedToAnExtensionAdd(ReferenceChange input) {
@@ -205,7 +205,7 @@ public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionDelete(org.eclipse.emf.compare.ReferenceChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionDelete(org.eclipse.emf.compare.ReferenceChange)
*/
@Override
protected boolean isRelatedToAnExtensionDelete(ReferenceChange input) {
@@ -216,7 +216,7 @@ public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionMove(org.eclipse.emf.compare.AttributeChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionMove(org.eclipse.emf.compare.AttributeChange)
*/
@Override
protected boolean isRelatedToAnExtensionMove(AttributeChange input) {
@@ -228,7 +228,7 @@ public class EdgeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionMove(org.eclipse.emf.compare.ReferenceChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionMove(org.eclipse.emf.compare.ReferenceChange)
*/
@Override
protected boolean isRelatedToAnExtensionMove(ReferenceChange input) {
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/HideFactory.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/HideFactory.java
index 84fe8ba04..767e8eb94 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/HideFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/HideFactory.java
@@ -8,15 +8,15 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.internal.extension.factories;
+package org.eclipse.emf.compare.diagram.internal.factories.extensions;
import org.eclipse.emf.compare.AttributeChange;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
-import org.eclipse.emf.compare.diagram.DiagramCompareFactory;
-import org.eclipse.emf.compare.diagram.Hide;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.Hide;
+import org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory;
import org.eclipse.emf.compare.utils.MatchUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -27,12 +27,12 @@ import org.eclipse.gmf.runtime.notation.View;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class HideFactory extends AbstractDiffExtensionFactory {
+public class HideFactory extends AbstractDiagramExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#getExtensionKind()
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#getExtensionKind()
*/
@Override
public Class<? extends Diff> getExtensionKind() {
@@ -42,10 +42,10 @@ public class HideFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#create(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#create(org.eclipse.emf.compare.Diff)
*/
public Diff create(Diff input) {
- final Hide ret = DiagramCompareFactory.eINSTANCE.createHide();
+ final Hide ret = ExtensionsFactory.eINSTANCE.createHide();
final DifferenceKind extensionKind = getRelatedExtensionKind(input);
@@ -64,7 +64,7 @@ public class HideFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionChange(org.eclipse.emf.compare.AttributeChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionChange(org.eclipse.emf.compare.AttributeChange)
*/
@Override
protected boolean isRelatedToAnExtensionChange(AttributeChange input) {
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/NodeChangeFactory.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/NodeChangeFactory.java
index 5bab3fbbe..c00386ff9 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/NodeChangeFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/NodeChangeFactory.java
@@ -8,7 +8,7 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.internal.extension.factories;
+package org.eclipse.emf.compare.diagram.internal.factories.extensions;
import static com.google.common.collect.Iterables.filter;
@@ -23,11 +23,11 @@ import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.diagram.DiagramCompareFactory;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
-import org.eclipse.emf.compare.diagram.NodeChange;
-import org.eclipse.emf.compare.diagram.diff.DiagramComparisonConfiguration;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory;
+import org.eclipse.emf.compare.diagram.internal.CompareDiagramConfiguration;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.NodeChange;
+import org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory;
import org.eclipse.emf.compare.utils.MatchUtil;
import org.eclipse.emf.compare.utils.ReferenceUtil;
import org.eclipse.emf.ecore.EObject;
@@ -41,10 +41,10 @@ import org.eclipse.gmf.runtime.notation.View;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class NodeChangeFactory extends AbstractDiffExtensionFactory {
+public class NodeChangeFactory extends AbstractDiagramExtensionFactory {
/** Configuration of the diagram comparison. */
- private final DiagramComparisonConfiguration configuration;
+ private final CompareDiagramConfiguration configuration;
/**
* Constructor.
@@ -52,14 +52,14 @@ public class NodeChangeFactory extends AbstractDiffExtensionFactory {
* @param configuration
* The configuration of the diagram comparison.
*/
- public NodeChangeFactory(DiagramComparisonConfiguration configuration) {
+ public NodeChangeFactory(CompareDiagramConfiguration configuration) {
this.configuration = configuration;
}
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#getExtensionKind()
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#getExtensionKind()
*/
@Override
public Class<? extends Diff> getExtensionKind() {
@@ -69,10 +69,10 @@ public class NodeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#create(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#create(org.eclipse.emf.compare.Diff)
*/
public Diff create(Diff input) {
- final NodeChange ret = DiagramCompareFactory.eINSTANCE.createNodeChange();
+ final NodeChange ret = ExtensionsFactory.eINSTANCE.createNodeChange();
final DifferenceKind extensionKind = getRelatedExtensionKind(input);
@@ -108,7 +108,7 @@ public class NodeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#fillRequiredDifferences(org.eclipse.emf.compare.Comparison,
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#fillRequiredDifferences(org.eclipse.emf.compare.Comparison,
* org.eclipse.emf.compare.Diff)
*/
@Override
@@ -142,7 +142,7 @@ public class NodeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#getParentMatch(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#getParentMatch(org.eclipse.emf.compare.Diff)
*/
@Override
public Match getParentMatch(Diff input) {
@@ -152,7 +152,7 @@ public class NodeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionAdd(org.eclipse.emf.compare.ReferenceChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionAdd(org.eclipse.emf.compare.ReferenceChange)
*/
@Override
protected boolean isRelatedToAnExtensionAdd(ReferenceChange input) {
@@ -164,7 +164,7 @@ public class NodeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionDelete(org.eclipse.emf.compare.ReferenceChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionDelete(org.eclipse.emf.compare.ReferenceChange)
*/
@Override
protected boolean isRelatedToAnExtensionDelete(ReferenceChange input) {
@@ -176,7 +176,7 @@ public class NodeChangeFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionMove(org.eclipse.emf.compare.AttributeChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionMove(org.eclipse.emf.compare.AttributeChange)
*/
@Override
protected boolean isRelatedToAnExtensionMove(AttributeChange input) {
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/ShowFactory.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/ShowFactory.java
index 1fd6ff3c7..dc166c72b 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/diff/internal/extension/factories/ShowFactory.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/factories/extensions/ShowFactory.java
@@ -8,15 +8,15 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.diff.internal.extension.factories;
+package org.eclipse.emf.compare.diagram.internal.factories.extensions;
import org.eclipse.emf.compare.AttributeChange;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.DifferenceSource;
-import org.eclipse.emf.compare.diagram.DiagramCompareFactory;
-import org.eclipse.emf.compare.diagram.Show;
-import org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.ExtensionsFactory;
+import org.eclipse.emf.compare.diagram.internal.extensions.Show;
+import org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory;
import org.eclipse.emf.compare.utils.MatchUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -27,7 +27,7 @@ import org.eclipse.gmf.runtime.notation.View;
*
* @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
*/
-public class ShowFactory extends AbstractDiffExtensionFactory {
+public class ShowFactory extends AbstractDiagramExtensionFactory {
@Override
public Class<? extends Diff> getExtensionKind() {
@@ -37,10 +37,10 @@ public class ShowFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.IDiffExtensionFactory#create(org.eclipse.emf.compare.Diff)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.IDiagramExtensionFactory#create(org.eclipse.emf.compare.Diff)
*/
public Diff create(Diff input) {
- final Show ret = DiagramCompareFactory.eINSTANCE.createShow();
+ final Show ret = ExtensionsFactory.eINSTANCE.createShow();
final DifferenceKind extensionKind = getRelatedExtensionKind(input);
@@ -58,7 +58,7 @@ public class ShowFactory extends AbstractDiffExtensionFactory {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.diagram.diff.internal.extension.AbstractDiffExtensionFactory#isRelatedToAnExtensionChange(org.eclipse.emf.compare.AttributeChange)
+ * @see org.eclipse.emf.compare.diagram.internal.factories.AbstractDiagramExtensionFactory#isRelatedToAnExtensionChange(org.eclipse.emf.compare.AttributeChange)
*/
@Override
protected boolean isRelatedToAnExtensionChange(AttributeChange input) {
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/merge/DiagramDiffMerger.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/merge/CompareDiagramMerger.java
index e860d7b6b..ac966807a 100644
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/merge/DiagramDiffMerger.java
+++ b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/internal/merge/CompareDiagramMerger.java
@@ -8,13 +8,13 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
-package org.eclipse.emf.compare.diagram.merge;
+package org.eclipse.emf.compare.diagram.internal.merge;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceSource;
import org.eclipse.emf.compare.DifferenceState;
-import org.eclipse.emf.compare.diagram.DiagramDiff;
+import org.eclipse.emf.compare.diagram.internal.extensions.DiagramDiff;
import org.eclipse.emf.compare.merge.AbstractMerger;
/**
@@ -22,7 +22,7 @@ import org.eclipse.emf.compare.merge.AbstractMerger;
*
* @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
*/
-public class DiagramDiffMerger extends AbstractMerger {
+public class CompareDiagramMerger extends AbstractMerger {
/**
* {@inheritDoc}
*
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/AbstractLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/AbstractLabelProvider.java
deleted file mode 100644
index 50852ec1c..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/AbstractLabelProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider;
-
-import org.eclipse.emf.compare.diagram.diff.util.GMFLabelUtil;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.common.ui.services.parser.IParser;
-import org.eclipse.gmf.runtime.common.ui.services.parser.ParserOptions;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
-import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Provide the label of a {@link View}.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public abstract class AbstractLabelProvider implements IViewLabelProvider {
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.diagram.provider.IViewLabelProvider#elementLabel(org.eclipse.gef.GraphicalEditPart)
- */
- public String elementLabel(View view) {
- if (view == null) {
- throw new IllegalArgumentException("view"); //$NON-NLS-1$
- }
- final ITextAwareEditPart editPart = GMFLabelUtil.getTextEditPart(view);
-
- final EObject semanticElement = getSemanticElement(editPart);
- final EObjectAdapter semanticAdapter = new EObjectAdapter(semanticElement);
-
- final IParser parser = GMFLabelUtil.getParser(view);
- final ParserOptions parserOptions = editPart.getParserOptions();
-
- final String ret = parser.getPrintString(semanticAdapter, parserOptions.intValue());
- return ret;
- }
-
- /**
- * Get the semantic element managed by the graphical edit part.
- *
- * @param editPart
- * The graphical edit part.
- * @return The semantic element.
- */
- protected EObject getSemanticElement(GraphicalEditPart editPart) {
- if (editPart.getModel() instanceof View) {
- final View view = (View)editPart.getModel();
- return view.getElement();
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/IViewLabelProvider.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/IViewLabelProvider.java
deleted file mode 100644
index 65ca840bc..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/IViewLabelProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider;
-
-import org.eclipse.gmf.runtime.notation.View;
-
-/**
- * Provider for the management of labels.
- *
- * @author <a href="mailto:cedric.notot@obeo.fr">Cedric Notot</a>
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public interface IViewLabelProvider {
-
- /**
- * The default instance of this provider.
- */
- IViewLabelProvider DEFAULT_INSTANCE = new AbstractLabelProvider() {
- public boolean isManaged(View view) {
- return false;
- }
- };
-
- /**
- * Checks if the view represents a label.
- *
- * @param view
- * The view.
- * @return True if the specified view contains a label.
- */
- boolean isManaged(View view);
-
- /**
- * Get the label from the view.
- *
- * @param view
- * The view.
- * @return The label.
- */
- String elementLabel(View view);
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionDescriptor.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionDescriptor.java
deleted file mode 100644
index cb5373f2f..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionDescriptor.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider;
-
-/**
- * Describes a extension as contributed to the "" extension point.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class ViewLabelProviderExtensionDescriptor {
-
- /** Qualified class name of the extension. This will be used as an id to remove contributions. */
- protected String className;
-
- /** Name of the type of diagram. */
- protected String diagramType;
-
- /** We only need to create the instance once, this will keep reference to it. */
- protected IViewLabelProvider extension;
-
- /**
- * Constructor.
- */
- public ViewLabelProviderExtensionDescriptor() {
- this.className = null;
- this.diagramType = null;
- this.extension = null;
- }
-
- /**
- * Constructor.
- *
- * @param className
- * .
- * @param diagramType
- * .
- * @param extension
- * .
- */
- public ViewLabelProviderExtensionDescriptor(String className, String diagramType,
- IViewLabelProvider extension) {
- this.className = className;
- this.diagramType = diagramType;
- this.extension = extension;
- }
-
- /**
- * Returns this descriptor's "extension" class name.
- *
- * @return This descriptor's "extension" class name.
- */
- public String getExtensionClassName() {
- return className;
- }
-
- public String getDiagramType() {
- return diagramType;
- }
-
- public IViewLabelProvider getExtension() {
- return extension;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionRegistry.java b/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionRegistry.java
deleted file mode 100644
index 3a8486e30..000000000
--- a/plugins/org.eclipse.emf.compare.diagram/src/org/eclipse/emf/compare/diagram/provider/ViewLabelProviderExtensionRegistry.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.diagram.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This will contain all extensions that have been parsed from the extension point.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public final class ViewLabelProviderExtensionRegistry {
-
- /** List of extensions created from the extension point contributions. */
- private static final List<ViewLabelProviderExtensionDescriptor> VIEW_LABEL_PROVIDERS = new ArrayList<ViewLabelProviderExtensionDescriptor>();
-
- /**
- * Constructor.
- */
- private ViewLabelProviderExtensionRegistry() {
- }
-
- /**
- * Adds an extension to the registry.
- *
- * @param extension
- * The extension that is to be added to the registry.
- */
- public static void addViewLabelProvider(ViewLabelProviderExtensionDescriptor extension) {
- VIEW_LABEL_PROVIDERS.add(extension);
- }
-
- /**
- * Removes all extensions from the registry. This will be called at plugin stopping.
- */
- public static void clearRegistry() {
- VIEW_LABEL_PROVIDERS.clear();
- }
-
- /**
- * Returns a copy of the registered extensions list.
- *
- * @return A copy of the registered extensions list.
- */
- public static List<ViewLabelProviderExtensionDescriptor> getRegisteredViewLabelProviders() {
- return new ArrayList<ViewLabelProviderExtensionDescriptor>(VIEW_LABEL_PROVIDERS);
- }
-
- /**
- * Removes a phantom from the registry.
- *
- * @param extensionClassName
- * Qualified class name of the sync element which corresponding phantom is to be removed from
- * the registry.
- */
- public static void removeExtension(String extensionClassName) {
- for (ViewLabelProviderExtensionDescriptor extension : getRegisteredViewLabelProviders()) {
- if (extension.getExtensionClassName().equals(extensionClassName)) {
- VIEW_LABEL_PROVIDERS.remove(extension);
- }
- }
- }
-
- /**
- * Return the {@link IViewLabelProvider} for the given diagram type.
- *
- * @param diagramType
- * The diagram type.
- * @return {@link IViewLabelProvider}
- */
- public static IViewLabelProvider getExtensionForType(String diagramType) {
- if (diagramType == null || "".equals(diagramType.trim())) { //$NON-NLS-1$
- throw new IllegalArgumentException("nsURI"); //$NON-NLS-1$
- }
-
- final List<ViewLabelProviderExtensionDescriptor> registeredExtensions = getRegisteredViewLabelProviders();
- for (ViewLabelProviderExtensionDescriptor viewLabelTypeProviderExtensionDescriptor : registeredExtensions) {
- if (diagramType.equals(viewLabelTypeProviderExtensionDescriptor.getDiagramType())) {
- return viewLabelTypeProviderExtensionDescriptor.getExtension();
- }
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF
index 59a352283..78ab0f80f 100644
--- a/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.edit/META-INF/MANIFEST.MF
@@ -22,5 +22,5 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore.edit;visibility:=reexport,
org.eclipse.emf.transaction;bundle-version="1.3.0"
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)"
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/confinoutchg_ov.png b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/confinoutchg_ov.png
new file mode 100644
index 000000000..9f4a38717
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/confinoutchg_ov.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inadd_ov.gif b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inadd_ov.gif
deleted file mode 100644
index 05a9f5a68..000000000
--- a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inadd_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inchg_ov.gif b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inchg_ov.gif
deleted file mode 100644
index 12d4a9732..000000000
--- a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inchg_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/indel_ov.gif b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/indel_ov.gif
deleted file mode 100644
index 373a68f14..000000000
--- a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/indel_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inoutchg_ov.gif b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inoutchg_ov.gif
deleted file mode 100644
index 453497689..000000000
--- a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/inoutchg_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outadd_ov.gif b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outadd_ov.gif
deleted file mode 100644
index 63fb2967c..000000000
--- a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outadd_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outchg_ov.gif b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outchg_ov.gif
deleted file mode 100644
index 78321d74d..000000000
--- a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outchg_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outdel_ov.gif b/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outdel_ov.gif
deleted file mode 100644
index 7182e5596..000000000
--- a/plugins/org.eclipse.emf.compare.edit/icons/full/ovr16/outdel_ov.gif
+++ /dev/null
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.edit/plugin.properties b/plugins/org.eclipse.emf.compare.edit/plugin.properties
index 85f997260..827824a76 100644
--- a/plugins/org.eclipse.emf.compare.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.edit/plugin.properties
@@ -7,7 +7,7 @@
# Contributors:
# Obeo - initial API and implementation
-pluginName = Compare Edit Support
+pluginName = EMF Compare Edit Support
providerName = Eclipse Modeling Project
_UI_CreateChild_text = {0}
diff --git a/plugins/org.eclipse.emf.compare.edit/plugin.xml b/plugins/org.eclipse.emf.compare.edit/plugin.xml
index e7a9d46ca..9bc27d9d7 100644
--- a/plugins/org.eclipse.emf.compare.edit/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.edit/plugin.xml
@@ -1,30 +1,31 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-
-<!--
- Copyright (c) 2012 Obeo.
- All rights reserved. This program and the accompanying materials
- are made available under the terms of the Eclipse Public License v1.0
- which accompanies this distribution, and is available at
- http://www.eclipse.org/legal/epl-v10.html
-
- Contributors:
- Obeo - initial API and implementation
--->
-
-<plugin>
-
- <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
- <factory
- uri="http://www.eclipse.org/emf/compare"
- class="org.eclipse.emf.compare.provider.spec.CompareItemProviderAdapterFactorySpec"
- supportedTypes=
- "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
- org.eclipse.emf.edit.provider.IStructuredItemContentProvider
- org.eclipse.emf.edit.provider.ITreeItemContentProvider
- org.eclipse.emf.edit.provider.IItemLabelProvider
- org.eclipse.emf.edit.provider.IItemPropertySource
- org.eclipse.emf.compare.provider.IItemStyledLabelProvider"/>
- </extension>
-
-</plugin>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!--
+ Copyright (c) 2012 Obeo.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+
+ Contributors:
+ Obeo - initial API and implementation
+-->
+
+<plugin>
+
+ <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories">
+ <factory
+ uri="http://www.eclipse.org/emf/compare"
+ class="org.eclipse.emf.compare.provider.spec.CompareItemProviderAdapterFactorySpec"
+ supportedTypes=
+ "org.eclipse.emf.edit.provider.IEditingDomainItemProvider
+ org.eclipse.emf.edit.provider.IStructuredItemContentProvider
+ org.eclipse.emf.edit.provider.ITreeItemContentProvider
+ org.eclipse.emf.edit.provider.IItemLabelProvider
+ org.eclipse.emf.edit.provider.IItemPropertySource
+ org.eclipse.emf.compare.provider.IItemStyledLabelProvider
+ org.eclipse.emf.compare.provider.IItemDescriptionProvider"/>
+ </extension>
+
+</plugin>
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemDescriptionProvider.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemDescriptionProvider.java
new file mode 100644
index 000000000..5fa0431d0
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemDescriptionProvider.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.provider;
+
+/**
+ * This is the interface implemented to provide a description for an item.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
+ */
+public interface IItemDescriptionProvider {
+
+ /**
+ * Returns the description for the given object.
+ *
+ * @param object
+ * the object to evaluate the description for.
+ * @return the description.
+ */
+ String getDescription(Object object);
+
+}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemStyledLabelProvider.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemStyledLabelProvider.java
index 80b13b6c4..af11ec692 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemStyledLabelProvider.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/IItemStyledLabelProvider.java
@@ -1,9 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
package org.eclipse.emf.compare.provider;
import org.eclipse.emf.compare.provider.utils.IStyledString.IComposedStyledString;
/**
+ * This is the interface implemented to provide a styled label for an item.
+ *
* @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
*/
public interface IItemStyledLabelProvider {
@@ -14,5 +27,5 @@ public interface IItemStyledLabelProvider {
* the object to evaluate the styled string for.
* @return the styled string.
*/
- public IComposedStyledString getStyledText(Object object);
+ IComposedStyledString getStyledText(Object object);
}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java
index 8f70267aa..7e52270fd 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/AttributeChangeItemProviderSpec.java
@@ -1,165 +1,233 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.provider.spec;
-
-import static com.google.common.collect.Lists.newArrayList;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.compare.AttributeChange;
-import org.eclipse.emf.compare.Conflict;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.provider.AdapterFactoryUtil;
-import org.eclipse.emf.compare.provider.AttributeChangeItemProvider;
-import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
-import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
-import org.eclipse.emf.compare.provider.utils.IStyledString;
-import org.eclipse.emf.compare.provider.utils.IStyledString.Style;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-
-/**
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class AttributeChangeItemProviderSpec extends AttributeChangeItemProvider implements IItemStyledLabelProvider {
-
- private final OverlayImageProvider overlayProvider;
-
- /**
- * @param adapterFactory
- */
- public AttributeChangeItemProviderSpec(AdapterFactory adapterFactory) {
- super(adapterFactory);
- overlayProvider = new OverlayImageProvider(getResourceLocator(), true);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.provider.MatchItemProvider#getImage(java.lang.Object)
- */
- @Override
- public Object getImage(Object object) {
- AttributeChange attributeChange = (AttributeChange)object;
- Object attributeChangeValueImage = AdapterFactoryUtil.getImage(getRootAdapterFactory(),
- attributeChange.getValue());
-
- if (attributeChangeValueImage == null) {
- attributeChangeValueImage = super.getImage(object);
- }
-
- Object diffImage = overlayProvider.getComposedImage(attributeChange, attributeChangeValueImage);
- Object ret = overlayImage(object, diffImage);
-
- return ret;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.provider.AttributeChangeItemProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object object) {
- return getStyledText(object).getString();
- }
-
- protected String getAttributeText(final AttributeChange attChange) {
- return attChange.getAttribute().getName();
- }
-
- protected String getValueText(final AttributeChange attChange) {
- String value = EcoreUtil.convertToString(attChange.getAttribute().getEAttributeType(), attChange
- .getValue());
- if (value == null) {
- value = "<null>"; //$NON-NLS-1$
- } else {
- value = Strings.elide(value, 50, "..."); //$NON-NLS-1$
- }
- return value;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object)
- */
- @Override
- public Collection<?> getChildren(Object object) {
- Collection<?> children = super.getChildren(object);
- List<? super Object> ret = newArrayList(children);
- AttributeChange attributeChange = (AttributeChange)object;
- Conflict conflict = attributeChange.getConflict();
- if (conflict != null) {
- // ret.add(conflict);
- }
-
- return ret;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getForeground(java.lang.Object)
- */
- @Override
- public Object getForeground(Object object) {
- AttributeChange attributeChange = (AttributeChange)object;
- switch (attributeChange.getState()) {
- case MERGED:
- case DISCARDED:
- return URI.createURI("color://rgb/156/156/156"); //$NON-NLS-1$
- default:
- return super.getForeground(object);
- }
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object)
- */
- public IStyledString.IComposedStyledString getStyledText(Object object) {
- final AttributeChange attChange = (AttributeChange)object;
-
- final String valueText = getValueText(attChange);
-
- final String attributeText = getAttributeText(attChange);
-
- ComposedStyledString ret = new ComposedStyledString(valueText);
- ret.append(" [" + attributeText, Style.DECORATIONS_STYLER); //$NON-NLS-1$
-
- switch (attChange.getKind()) {
- case ADD:
- ret.append(" add", Style.DECORATIONS_STYLER); //$NON-NLS-1$
- break;
- case DELETE:
- ret.append(" delete", Style.DECORATIONS_STYLER); //$NON-NLS-1$
- break;
- case CHANGE:
- ret.append(
- " " + ReferenceChangeItemProviderSpec.changeText(attChange, attChange.getAttribute()), //$NON-NLS-1$
- Style.DECORATIONS_STYLER);
- break;
- case MOVE:
- ret.append(" move", Style.DECORATIONS_STYLER); //$NON-NLS-1$
- break;
- default:
- throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() //$NON-NLS-1$
- + " value: " + attChange.getKind()); //$NON-NLS-1$
- }
- ret.append("]", Style.DECORATIONS_STYLER); //$NON-NLS-1$
-
- return ret;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.provider.spec;
+
+import static com.google.common.collect.Lists.newArrayList;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.compare.AttributeChange;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.DifferenceSource;
+import org.eclipse.emf.compare.provider.AdapterFactoryUtil;
+import org.eclipse.emf.compare.provider.AttributeChangeItemProvider;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
+import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
+import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString.Style;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+/**
+ * Specialized {@link AttributeChangeItemProvider} returning nice output for {@link #getText(Object)} and
+ * {@link #getImage(Object)}.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class AttributeChangeItemProviderSpec extends AttributeChangeItemProvider {
+
+ /** The elide length. */
+ private static final int ELIDE_LENGTH = 50;
+
+ /** The image provider used with this item provider. */
+ private final OverlayImageProvider overlayProvider;
+
+ /**
+ * Constructs an AttributeChangeItemProviderSpec with the given factory.
+ *
+ * @param adapterFactory
+ * the factory given to the super constructor.
+ */
+ public AttributeChangeItemProviderSpec(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ overlayProvider = new OverlayImageProvider(getResourceLocator());
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.MatchItemProvider#getImage(java.lang.Object)
+ */
+ @Override
+ public Object getImage(Object object) {
+ AttributeChange attributeChange = (AttributeChange)object;
+ Object attributeChangeValueImage = AdapterFactoryUtil.getImage(getRootAdapterFactory(),
+ attributeChange.getValue());
+
+ if (attributeChangeValueImage == null) {
+ attributeChangeValueImage = super.getImage(object);
+ }
+
+ Object diffImage = overlayProvider.getComposedImage(attributeChange, attributeChangeValueImage);
+ Object ret = overlayImage(object, diffImage);
+
+ return ret;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.AttributeChangeItemProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object object) {
+ return getStyledText(object).getString();
+ }
+
+ /**
+ * Returns the name of the attribute linked to the given {@link AttributeChange}.
+ *
+ * @param attChange
+ * the given {@link AttributeChange}.
+ * @return the name of the attribute linked to the given {@link AttributeChange}.
+ */
+ protected String getAttributeText(final AttributeChange attChange) {
+ return attChange.getAttribute().getName();
+ }
+
+ /**
+ * Converts to text the given {@link AttributeChange}.
+ *
+ * @param attChange
+ * the given {@link AttributeChange}.
+ * @return a nice text from the the given {@link AttributeChange}.
+ */
+ protected String getValueText(final AttributeChange attChange) {
+ String value = EcoreUtil.convertToString(attChange.getAttribute().getEAttributeType(), attChange
+ .getValue());
+ if (value == null) {
+ value = "<null>"; //$NON-NLS-1$
+ } else {
+ value = Strings.elide(value, ELIDE_LENGTH, "..."); //$NON-NLS-1$
+ }
+ return value;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object)
+ */
+ @Override
+ public Collection<?> getChildren(Object object) {
+ Collection<?> children = super.getChildren(object);
+ List<? super Object> ret = newArrayList(children);
+ AttributeChange attributeChange = (AttributeChange)object;
+ Conflict conflict = attributeChange.getConflict();
+ if (conflict != null) {
+ // ret.add(conflict);
+ }
+
+ return ret;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getForeground(java.lang.Object)
+ */
+ @Override
+ public Object getForeground(Object object) {
+ AttributeChange attributeChange = (AttributeChange)object;
+ switch (attributeChange.getState()) {
+ case MERGED:
+ case DISCARDED:
+ return URI.createURI("color://rgb/156/156/156"); //$NON-NLS-1$
+ default:
+ return super.getForeground(object);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object)
+ */
+ public IStyledString.IComposedStyledString getStyledText(Object object) {
+ final AttributeChange attChange = (AttributeChange)object;
+
+ final String valueText = getValueText(attChange);
+
+ final String attributeText = getAttributeText(attChange);
+
+ ComposedStyledString ret = new ComposedStyledString(valueText);
+ ret.append(" [" + attributeText, Style.DECORATIONS_STYLER); //$NON-NLS-1$
+
+ switch (attChange.getKind()) {
+ case ADD:
+ ret.append(" add", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+ break;
+ case DELETE:
+ ret.append(" delete", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+ break;
+ case CHANGE:
+ ret.append(
+ " " + ReferenceChangeItemProviderSpec.changeText(attChange, attChange.getAttribute()), //$NON-NLS-1$
+ Style.DECORATIONS_STYLER);
+ break;
+ case MOVE:
+ ret.append(" move", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+ break;
+ default:
+ throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() //$NON-NLS-1$
+ + " value: " + attChange.getKind()); //$NON-NLS-1$
+ }
+ ret.append("]", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+
+ return ret;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemDescriptionProvider#getDescription(java.lang.Object)
+ */
+ public String getDescription(Object object) {
+ final AttributeChange attChange = (AttributeChange)object;
+
+ final String valueText = getValueText(attChange);
+ final String attributeText = getAttributeText(attChange);
+
+ String remotely = "";
+ if (attChange.getSource() == DifferenceSource.RIGHT) {
+ remotely = "remotely ";
+ }
+
+ String ret = "";
+ final String hasBeen = " has been ";
+
+ switch (attChange.getKind()) {
+ case ADD:
+ ret = valueText + hasBeen + remotely + "added to " + attributeText;
+ break;
+ case DELETE:
+ ret = valueText + hasBeen + remotely + "deleted from " + attributeText;
+ break;
+ case CHANGE:
+ String changeText = ReferenceChangeItemProviderSpec.changeText(attChange, attChange
+ .getAttribute());
+ ret = attributeText + " " + valueText + hasBeen + remotely + changeText;
+ break;
+ case MOVE:
+ ret = valueText + hasBeen + remotely + "moved in '" + attributeText;
+ break;
+ default:
+ throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName()
+ + " value: " + attChange.getKind());
+ }
+
+ return ret;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/CompareItemProviderAdapterFactorySpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/CompareItemProviderAdapterFactorySpec.java
index eb272fcae..8c96fbf99 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/CompareItemProviderAdapterFactorySpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/CompareItemProviderAdapterFactorySpec.java
@@ -12,20 +12,25 @@ package org.eclipse.emf.compare.provider.spec;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.compare.provider.CompareItemProviderAdapterFactory;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
-import org.eclipse.emf.edit.provider.IItemLabelProvider;
/**
* Specialized {@link CompareItemProviderAdapterFactory} returning ItemProviderAdapter with nice
- * {@link IItemLabelProvider#getText(Object)} and {@link IItemLabelProvider#getImage(Object)}.
+ * {@link org.eclipse.emf.edit.provider.IItemLabelProvider#getText(Object)} and
+ * {@link org.eclipse.emf.edit.provider.IItemLabelProvider#getImage(Object)}.
*
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
public class CompareItemProviderAdapterFactorySpec extends CompareItemProviderAdapterFactory {
+ /**
+ * Constructor calling super {@link #CompareItemProviderAdapterFactory()}.
+ */
public CompareItemProviderAdapterFactorySpec() {
super();
supportedTypes.add(IItemStyledLabelProvider.class);
+ supportedTypes.add(IItemDescriptionProvider.class);
}
/**
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java
index 8e4c1402d..e66ce917a 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ComparisonItemProviderSpec.java
@@ -28,6 +28,7 @@ import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ResourceAttachmentChange;
import org.eclipse.emf.compare.provider.ComparisonItemProvider;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
import org.eclipse.emf.compare.provider.utils.IStyledString;
@@ -35,12 +36,18 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
/**
+ * Specialized {@link ComparisonItemProvider} returning nice output for {@link #getText(Object)} and
+ * {@link #getImage(Object)}.
+ *
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
-public class ComparisonItemProviderSpec extends ComparisonItemProvider implements IItemStyledLabelProvider {
+public class ComparisonItemProviderSpec extends ComparisonItemProvider implements IItemStyledLabelProvider, IItemDescriptionProvider {
/**
+ * Constructs a ComparisonItemProviderSpec with the given factory.
+ *
* @param adapterFactory
+ * the factory given to the super constructor.
*/
public ComparisonItemProviderSpec(AdapterFactory adapterFactory) {
super(adapterFactory);
@@ -68,6 +75,15 @@ public class ComparisonItemProviderSpec extends ComparisonItemProvider implement
return !isEmpty(getChildrenIterable(comparison));
}
+ /**
+ * Returns the children of the given {@link Comparison}. In this case children means: non empty matches
+ * (see {@link ComparisonItemProviderSpec#getNonEmptyMatches(Comparison)}), matches which not only
+ * contains {@link ResourceAttachmentChange} differences, and matched resources.
+ *
+ * @param comparison
+ * the given {@link Comparison}.
+ * @return the filtered list of children of the given {@link Comparison}.
+ */
private Iterable<EObject> getChildrenIterable(Comparison comparison) {
Iterable<? extends EObject> matches = getNonEmptyMatches(comparison);
List<EObject> children = Lists.newArrayList(matches);
@@ -81,6 +97,13 @@ public class ComparisonItemProviderSpec extends ComparisonItemProvider implement
return concat(children, comparison.getMatchedResources());
}
+ /**
+ * Filters out the empty matches of the given {@link Comparison}.
+ *
+ * @param comparison
+ * the given {@link Comparison}.
+ * @return an iterable of non empty matches.
+ */
private Iterable<Match> getNonEmptyMatches(Comparison comparison) {
Iterable<Match> match = filter(comparison.getMatches(), new Predicate<Match>() {
public boolean apply(Match input) {
@@ -111,4 +134,13 @@ public class ComparisonItemProviderSpec extends ComparisonItemProvider implement
public IStyledString.IComposedStyledString getStyledText(Object object) {
return new ComposedStyledString(getText(object));
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemDescriptionProvider#getDescription(java.lang.Object)
+ */
+ public String getDescription(Object object) {
+ return getText(object);
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ConflictItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ConflictItemProviderSpec.java
index 325a65405..7ef4c5e49 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ConflictItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ConflictItemProviderSpec.java
@@ -1,70 +1,92 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.provider.spec;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.compare.Conflict;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.provider.ConflictItemProvider;
-import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
-import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
-import org.eclipse.emf.compare.provider.utils.IStyledString;
-
-/**
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class ConflictItemProviderSpec extends ConflictItemProvider implements IItemStyledLabelProvider {
-
- /**
- * @param adapterFactory
- */
- public ConflictItemProviderSpec(AdapterFactory adapterFactory) {
- super(adapterFactory);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.provider.ConflictItemProvider#getText(java.lang.Object)
- */
- @Override
- public String getText(Object object) {
- return getStyledText(object).getString();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object)
- */
- @Override
- public Collection<?> getChildren(Object object) {
- Conflict conflict = (Conflict)object;
- EList<Diff> differences = conflict.getDifferences();
- return differences;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object)
- */
- public IStyledString.IComposedStyledString getStyledText(Object object) {
- Conflict conflict = (Conflict)object;
- int size = conflict.getDifferences().size() - 1;
- return new ComposedStyledString(conflict.getKind().getName()
- + " conflict with " + size + " other difference" //$NON-NLS-1$ //$NON-NLS-2$
- + (size > 1 ? "s" : "")); //$NON-NLS-1$ //$NON-NLS-2$
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012, 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.provider.spec;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.provider.ConflictItemProvider;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
+import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
+import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString;
+
+/**
+ * Specialized {@link ConflictItemProvider} returning nice output for {@link #getText(Object)} and
+ * {@link #getImage(Object)}.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class ConflictItemProviderSpec extends ConflictItemProvider implements IItemStyledLabelProvider, IItemDescriptionProvider {
+
+ /**
+ * Constructs a ComparisonItemProviderSpec with the given factory.
+ *
+ * @param adapterFactory
+ * the factory given to the super constructor.
+ */
+ public ConflictItemProviderSpec(AdapterFactory adapterFactory) {
+ super(adapterFactory);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.ConflictItemProvider#getText(java.lang.Object)
+ */
+ @Override
+ public String getText(Object object) {
+ return getStyledText(object).getString();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getChildren(java.lang.Object)
+ */
+ @Override
+ public Collection<?> getChildren(Object object) {
+ Conflict conflict = (Conflict)object;
+ EList<Diff> differences = conflict.getDifferences();
+ return differences;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object)
+ */
+ public IStyledString.IComposedStyledString getStyledText(Object object) {
+ Conflict conflict = (Conflict)object;
+ int size = conflict.getDifferences().size() - 1;
+ return new ComposedStyledString(conflict.getKind().getName()
+ + " conflict with " + size + " other difference" //$NON-NLS-1$ //$NON-NLS-2$
+ + (size > 1 ? "s" : "")); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemDescriptionProvider#getDescription(java.lang.Object)
+ */
+ public String getDescription(Object object) {
+ Conflict conflict = (Conflict)object;
+ int size = conflict.getDifferences().size() - 1;
+ String ret = conflict.getKind().getName() + " conflict with " + size + " other difference";
+ if (size > 1) {
+ ret += "s";
+ }
+ return ret;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java
index f00268299..a893323ad 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchItemProviderSpec.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,19 +27,17 @@ import java.util.Collection;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.compare.Conflict;
-import org.eclipse.emf.compare.ConflictKind;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ReferenceChange;
import org.eclipse.emf.compare.ResourceAttachmentChange;
import org.eclipse.emf.compare.provider.AdapterFactoryUtil;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
import org.eclipse.emf.compare.provider.MatchItemProvider;
import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
import org.eclipse.emf.compare.provider.utils.IStyledString;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
/**
* Specialized {@link MatchItemProvider} returning nice output for {@link #getText(Object)} and
@@ -47,20 +45,27 @@ import org.eclipse.emf.ecore.EReference;
*
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
-public class MatchItemProviderSpec extends MatchItemProvider implements IItemStyledLabelProvider {
+public class MatchItemProviderSpec extends MatchItemProvider implements IItemStyledLabelProvider, IItemDescriptionProvider {
+ /**
+ * A predicate to know if the given {@link ReferenceChange} is a reference of type containment.
+ */
private static final Predicate<ReferenceChange> CONTAINMENT_REFERENCE_CHANGE = new Predicate<ReferenceChange>() {
public boolean apply(ReferenceChange input) {
return input.getReference().isContainment();
}
};
+ /**
+ * A function returning the {@link ReferenceChange#getValue()} of the given {@link ReferenceChange}.
+ */
private static final Function<ReferenceChange, EObject> VALUE = new Function<ReferenceChange, EObject>() {
public EObject apply(ReferenceChange input) {
return input.getValue();
}
};
+ /** The image provider used with this item provider. */
private final OverlayImageProvider overlayProvider;
/**
@@ -71,7 +76,7 @@ public class MatchItemProviderSpec extends MatchItemProvider implements IItemSty
*/
public MatchItemProviderSpec(AdapterFactory adapterFactory) {
super(adapterFactory);
- overlayProvider = new OverlayImageProvider(getResourceLocator(), true);
+ overlayProvider = new OverlayImageProvider(getResourceLocator());
}
/**
@@ -139,19 +144,55 @@ public class MatchItemProviderSpec extends MatchItemProvider implements IItemSty
return ImmutableList.copyOf(filteredChildren);
}
- Iterable<?> getChildrenIterable(Match match) {
+ /**
+ * Returns the children that will be displayed under the given Match.
+ *
+ * @param match
+ * the given Match.
+ * @return an iterable of children that will be displayed under the given Match.
+ * @since 3.0
+ */
+ public Iterable<?> getChildrenIterable(Match match) {
+ ImmutableSet<EObject> containementDifferenceValues = containmentReferencesValues(match);
+
+ @SuppressWarnings("unchecked")
+ Predicate<Object> childrenFilter = not(or(matchOfContainmentDiff(containementDifferenceValues),
+ emptyMatch(), instanceOf(ResourceAttachmentChange.class)));
+
+ Iterable<?> filteredChildren = filter(super.getChildren(match), childrenFilter);
+ return filteredChildren;
+ }
+
+ /**
+ * Returns the filtered children (children without those who don't have children) that will be displayed
+ * under the given Match.
+ *
+ * @param match
+ * the given Match.
+ * @return an iterable of the filtered children (children without those who don't have children) that will
+ * be displayed under the given Match.
+ * @since 3.0
+ */
+ public Iterable<?> getFilteredChildren(Match match) {
ImmutableSet<EObject> containementDifferenceValues = containmentReferencesValues(match);
@SuppressWarnings("unchecked")
Predicate<Object> childrenFilter = not(or(matchOfContainmentDiff(containementDifferenceValues),
- matchWithNoChildren(), emptyMatch(), PSEUDO_CONFLICT_DIFF, REFINED_DIFF,
- PSEUDO_DELETE_CONFLICT, instanceOf(ResourceAttachmentChange.class)));
+ matchWithNoChildren(), emptyMatch(), instanceOf(ResourceAttachmentChange.class)));
Iterable<?> filteredChildren = filter(super.getChildren(match), childrenFilter);
return filteredChildren;
}
- private ImmutableSet<EObject> containmentReferencesValues(Match match) {
+ /**
+ * Returns the containment references values of the given Match.
+ *
+ * @param match
+ * the given Match.
+ * @return the containment references values of the given Match.
+ * @since 3.0
+ */
+ public static ImmutableSet<EObject> containmentReferencesValues(Match match) {
EList<Diff> differences = match.getDifferences();
Iterable<ReferenceChange> containmentReferenceChanges = filter(filter(differences,
ReferenceChange.class), CONTAINMENT_REFERENCE_CHANGE);
@@ -160,8 +201,18 @@ public class MatchItemProviderSpec extends MatchItemProvider implements IItemSty
return containementDifferenceValues;
}
- private static Predicate<? super Object> matchOfContainmentDiff(
- final ImmutableSet<EObject> containementDifferenceValues) {
+ /**
+ * A predicate to know if the given object is a {@link Match} containing a {@link Diff} of type
+ * containment.
+ *
+ * @param containementDifferenceValues
+ * the list of containment values.
+ * @return a predicate to know if the given object is a {@link Match} containing a {@link Diff} of type
+ * containment.
+ * @since 3.0
+ */
+ public static Predicate<? super Object> matchOfContainmentDiff(
+ final ImmutableSet<? extends EObject> containementDifferenceValues) {
return new Predicate<Object>() {
public boolean apply(Object input) {
boolean ret = false;
@@ -178,24 +229,34 @@ public class MatchItemProviderSpec extends MatchItemProvider implements IItemSty
};
}
+ /**
+ * A predicate to know if the given object is a {@link Match} with no children.
+ *
+ * @return A predicate to know if the given object is a {@link Match} with no children.
+ */
private Predicate<? super Object> matchWithNoChildren() {
return new Predicate<Object>() {
public boolean apply(Object input) {
boolean ret = false;
if (input instanceof Match) {
Match match = (Match)input;
- ret = Iterables.isEmpty(MatchItemProviderSpec.this.getChildrenIterable(match));
+ ret = Iterables.isEmpty(MatchItemProviderSpec.this.getFilteredChildren(match));
}
return ret;
}
};
}
+ /**
+ * A predicate to know if the given object is an empty match (no left, right and origin).
+ *
+ * @return A predicate to know if the given object is an empty match (no left, right and origin).
+ */
private static Predicate<? super Object> emptyMatch() {
return new Predicate<Object>() {
public boolean apply(Object input) {
if (input instanceof Match) {
- final Match match = ((Match)input);
+ final Match match = (Match)input;
return match.getLeft() == null && match.getRight() == null && match.getOrigin() == null;
}
return false;
@@ -203,55 +264,6 @@ public class MatchItemProviderSpec extends MatchItemProvider implements IItemSty
};
}
- static final Predicate<? super Object> REFINED_DIFF = new Predicate<Object>() {
- public boolean apply(Object input) {
- boolean ret = false;
- if (input instanceof Diff) {
- Diff diff = (Diff)input;
- ret = !diff.getRefines().isEmpty();
- }
- return ret;
- }
- };
-
- private static final Predicate<? super Object> PSEUDO_CONFLICT_DIFF = new Predicate<Object>() {
- public boolean apply(Object input) {
- boolean ret = false;
- if (input instanceof Diff) {
- Diff diff = (Diff)input;
- Conflict conflict = diff.getConflict();
- if (conflict != null && conflict.getKind() == ConflictKind.PSEUDO) {
- ret = true;
- }
- }
- return ret;
- }
- };
-
- private static final Predicate<? super Object> PSEUDO_DELETE_CONFLICT = new Predicate<Object>() {
- public boolean apply(Object input) {
- boolean ret = false;
- if (input instanceof ReferenceChange) {
- ReferenceChange referenceChange = (ReferenceChange)input;
- Conflict conflict = referenceChange.getConflict();
- if (conflict != null) {
- EReference eReference = referenceChange.getReference();
- EObject value = referenceChange.getValue();
- Iterable<ReferenceChange> conflictualReferenceChanges = filter(conflict.getDifferences(),
- ReferenceChange.class);
- for (ReferenceChange conflictualReferenceChange : conflictualReferenceChanges) {
- if (conflictualReferenceChange != referenceChange
- && conflictualReferenceChange.getReference() == eReference
- && conflictualReferenceChange.getValue() == value) {
- ret = true;
- }
- }
- }
- }
- return ret;
- }
- };
-
/**
* {@inheritDoc}
*
@@ -267,8 +279,18 @@ public class MatchItemProviderSpec extends MatchItemProvider implements IItemSty
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object)
+ * @since 3.0
*/
public IStyledString.IComposedStyledString getStyledText(Object object) {
return new ComposedStyledString(getText(object));
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemDescriptionProvider#getDescription(java.lang.Object)
+ */
+ public String getDescription(Object object) {
+ return getText(object);
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java
index 90c5fbc15..79643b0a0 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/MatchResourceItemProviderSpec.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.MatchResource;
import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
import org.eclipse.emf.compare.provider.MatchResourceItemProvider;
import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
@@ -32,7 +33,7 @@ import org.eclipse.emf.edit.provider.IItemLabelProvider;
*
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
-public class MatchResourceItemProviderSpec extends MatchResourceItemProvider implements IItemStyledLabelProvider {
+public class MatchResourceItemProviderSpec extends MatchResourceItemProvider implements IItemStyledLabelProvider, IItemDescriptionProvider {
/**
* Constructor calling super {@link #MatchResourceItemProviderSpec(AdapterFactory)}.
@@ -100,6 +101,7 @@ public class MatchResourceItemProviderSpec extends MatchResourceItemProvider imp
public Object getImage(Object object) {
final MatchResource matchResource = (MatchResource)object;
Resource resource = matchResource.getLeft();
+ Object image = null;
if (resource == null) {
resource = matchResource.getRight();
if (resource == null) {
@@ -111,15 +113,14 @@ public class MatchResourceItemProviderSpec extends MatchResourceItemProvider imp
IItemLabelProvider itemLabelProvider = (IItemLabelProvider)getRootAdapterFactory().adapt(
resource, IItemLabelProvider.class);
- Object image = itemLabelProvider.getImage(resource);
- if (image != null) {
- return image;
- } else {
- return super.getImage(object);
+ image = itemLabelProvider.getImage(resource);
+ if (image == null) {
+ image = super.getImage(object);
}
} else {
- return super.getImage(object);
+ image = super.getImage(object);
}
+ return image;
}
/**
@@ -165,4 +166,13 @@ public class MatchResourceItemProviderSpec extends MatchResourceItemProvider imp
public IStyledString.IComposedStyledString getStyledText(Object object) {
return new ComposedStyledString(getText(object));
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemDescriptionProvider#getDescription(java.lang.Object)
+ */
+ public String getDescription(Object object) {
+ return getText(object);
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
index b5ba7a103..21428c059 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/OverlayImageProvider.java
@@ -11,13 +11,11 @@
package org.eclipse.emf.compare.provider.spec;
import static com.google.common.collect.Iterables.any;
-import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.isEmpty;
import static com.google.common.collect.Lists.newArrayList;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.fromSide;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.hasConflict;
-import com.google.common.base.Predicate;
-
import java.util.Collection;
import java.util.List;
@@ -38,16 +36,13 @@ import org.eclipse.emf.edit.provider.ComposedImage;
*/
public class OverlayImageProvider {
- private final boolean fLeftIsLocal;
-
private final ResourceLocator fResourceLocator;
/**
*
*/
- public OverlayImageProvider(ResourceLocator resourceLocator, boolean leftIsLocal) {
+ public OverlayImageProvider(ResourceLocator resourceLocator) {
this.fResourceLocator = resourceLocator;
- this.fLeftIsLocal = leftIsLocal;
}
public Object getComposedImage(Diff diff, Object imageToCompose) {
@@ -70,44 +65,36 @@ public class OverlayImageProvider {
return new ComposedImageExtension(images);
}
+ // Nothing here has to be externalized
+ @SuppressWarnings("nls")
private String getImageOverlay(Diff diff) {
final DifferenceSource source = diff.getSource();
final Match match = diff.getMatch();
final Conflict conflict = diff.getConflict();
final DifferenceKind diffKind = diff.getKind();
- final Comparison c = match.getComparison();
+ final Comparison comparison = match.getComparison();
String path = "full/ovr16/";
if (diff.getState() == DifferenceState.MERGED) {
path += "merged_ov";
} else if (diff.getState() == DifferenceState.DISCARDED) {
path += "removed_ov";
- } else if (c.isThreeWay()) {
- String filext = "";
- if (conflict != null) {
- if (conflict.getKind() == ConflictKind.REAL) {
- filext = ".png";
- path += "conf";
- path += getConflictWay(source);
+ } else if (comparison.isThreeWay()) {
+ // "png" needs explicit declaration, "gif" does not
+ String extension = "";
+ if (conflict != null && conflict.getKind() == ConflictKind.REAL) {
+ extension = ".png";
+ path += "conf";
+ if (source == DifferenceSource.RIGHT) {
+ path += "r_";
}
- // if (conflict.getKind() == ConflictKind.PSEUDO) {
- // path += "pconf";
- // }
} else {
switch (source) {
case LEFT:
- if (fLeftIsLocal) {
- path += "r_out";
- } else {
- path += "out";
- }
+ path += "r_out";
break;
case RIGHT:
- if (fLeftIsLocal) {
- path += "r_in";
- } else {
- path += "in";
- }
+ path += "r_in";
break;
default:
// Cannot happen ... for now
@@ -131,54 +118,29 @@ public class OverlayImageProvider {
// Cannot happen ... for now
break;
}
- path += filext;
+ path += extension;
} else {
- path += getPathForTwoWayDiff(diffKind);
- }
- return path;
- }
-
- private String getPathForTwoWayDiff(final DifferenceKind diffKind) {
- final String path;
- switch (diffKind) {
- case ADD:
- if (fLeftIsLocal) {
- path = "add_ov";
- } else {
- path = "del_ov";
- }
- break;
- case DELETE:
- if (fLeftIsLocal) {
- path = "del_ov";
- } else {
- path = "add_ov";
- }
- break;
- case CHANGE:
- // fallthrough
- case MOVE:
- path = "chg_ov";
- break;
- default:
- path = "";
- break;
- }
- return path;
- }
-
- private String getConflictWay(final DifferenceSource source) {
- final String path;
- if (source == DifferenceSource.LEFT && !fLeftIsLocal) {
- path = "r_";
- } else if (source == DifferenceSource.RIGHT && fLeftIsLocal) {
- path = "r_";
- } else {
- path = "";
+ switch (diffKind) {
+ case ADD:
+ path += "add_ov";
+ break;
+ case DELETE:
+ path += "del_ov";
+ break;
+ case CHANGE:
+ // fallthrough
+ case MOVE:
+ path += "chg_ov";
+ break;
+ default:
+ break;
+ }
}
return path;
}
+ // Nothing here has to be externalized
+ @SuppressWarnings("nls")
private String getImageOverlay(Match match) {
String path = null;
final EObject ancestor = match.getOrigin();
@@ -188,91 +150,46 @@ public class OverlayImageProvider {
final Iterable<Diff> differences = match.getAllDifferences();
if (match.getComparison().isThreeWay()) {
- boolean hasConflicts = any(differences, hasConflict(ConflictKind.REAL, ConflictKind.PSEUDO));
-
- if (ancestor == null) {
- if (left == null) {
- if (right != null) {
- if (fLeftIsLocal) {
- path = "r_inadd_ov";
- } else {
- path = "inadd_ov";
- }
- }
- } else if (right == null) {
- if (fLeftIsLocal) {
- path = "r_outadd_ov";
- } else {
- path = "outadd_ov";
- }
- } else if (hasConflicts && any(differences, hasConflict(ConflictKind.REAL))) {
- path = "confadd_ov.png";
+ if (any(differences, hasConflict(ConflictKind.REAL))) {
+ path = "confinoutchg_ov.png";
+ } else if (ancestor == null) {
+ if (right == null) {
+ path = "r_outadd_ov";
+ } else if (left == null) {
+ path = "r_inadd_ov";
+ } else {
+ // pseudo conflict addition
+ // TODO we filter this by default, what to do if the filter is off?
}
} else if (left == null) {
- if (right == null) {
- // path = Differencer.CONFLICTING | Differencer.DELETION |
- // Differencer.PSEUDO_CONFLICT;
- } else if (!hasConflicts) {
- if (fLeftIsLocal) {
- path = "r_outdel_ov";
- } else {
- path = "outdel_ov";
- }
- } else if (any(differences, hasConflict(ConflictKind.REAL))) {
- path = "confdel_ov.png";
+ if (right != null) {
+ path = "r_outdel_ov";
+ } else {
+ // pseudo conflict deletion
+ // TODO we filter this by default, what to do if the filter is off?
}
} else if (right == null) {
- if (!hasConflicts) {
- if (fLeftIsLocal) {
- path = "r_indel_ov";
- } else {
- path = "indel_ov";
- }
- } else if (any(differences, hasConflict(ConflictKind.REAL))) {
- path = "confchg_ov.png";
- }
+ path = "r_indel_ov";
} else {
- boolean ay = isEmpty(filter(differences, LEFT_DIFF));
- boolean am = isEmpty(filter(differences, RIGHT_DIFF));
-
- if (isEmpty(differences)) {
- // empty
- } else if (ay && !am) {
- if (fLeftIsLocal) {
- path = "r_inchg_ov";
- } else {
- path = "inchg_ov";
- }
- } else if (!ay && am) {
- if (fLeftIsLocal) {
- path = "r_outchg_ov";
- } else {
- path = "outchg_ov";
- }
- } else {
- if (hasConflicts && any(differences, hasConflict(ConflictKind.REAL))) {
- path = "confchg_ov.png";
- } else {
- path = "r_inoutchg_ov.gif";
- }
- }
- }
- } else if (left == null) {
- if (right != null) {
- if (fLeftIsLocal) {
- path = "add_ov";
- } else {
- path = "del_ov";
+ boolean hasLeftDiffs = any(differences, fromSide(DifferenceSource.LEFT));
+ boolean hasRightDiffs = any(differences, fromSide(DifferenceSource.RIGHT));
+
+ if (hasLeftDiffs && hasRightDiffs) {
+ path = "r_inoutchg_ov";
+ } else if (hasLeftDiffs) {
+ path = "r_outchg_ov";
+ } else if (hasRightDiffs) {
+ path = "r_inchg_ov";
}
}
- } else if (right == null) {
- if (fLeftIsLocal) {
+ } else {
+ if (left == null) {
path = "del_ov";
- } else {
+ } else if (right == null) {
path = "add_ov";
+ } else if (!isEmpty(differences)) {
+ path = "chg_ov";
}
- } else if (!isEmpty(differences)) {
- path = "chg_ov";
}
String ret = null;
@@ -282,18 +199,6 @@ public class OverlayImageProvider {
return ret;
}
- private static final Predicate<Diff> LEFT_DIFF = new Predicate<Diff>() {
- public boolean apply(Diff input) {
- return input != null && input.getSource() == DifferenceSource.LEFT;
- }
- };
-
- private static final Predicate<Diff> RIGHT_DIFF = new Predicate<Diff>() {
- public boolean apply(Diff input) {
- return input != null && input.getSource() == DifferenceSource.RIGHT;
- }
- };
-
private final class ComposedImageExtension extends ComposedImage {
/**
@@ -324,12 +229,12 @@ public class OverlayImageProvider {
* @see org.eclipse.emf.edit.provider.ComposedImage#getSize(java.util.Collection)
*/
@Override
- public Size getSize(Collection<? extends Size> imageSizes) {
- this.imageSizes = newArrayList(imageSizes);
+ public Size getSize(Collection<? extends Size> sizes) {
+ this.imageSizes = newArrayList(sizes);
List<Point> drawPoints = getDrawPoints(null);
Size result = new Size();
- for (int i = 0; i < imageSizes.size(); i++) {
+ for (int i = 0; i < sizes.size(); i++) {
Size size = this.imageSizes.get(i);
Point point = drawPoints.get(i);
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java
index f20e11fee..13bc5ddef 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ReferenceChangeItemProviderSpec.java
@@ -32,6 +32,7 @@ import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ReferenceChange;
import org.eclipse.emf.compare.ResourceAttachmentChange;
import org.eclipse.emf.compare.provider.AdapterFactoryUtil;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
import org.eclipse.emf.compare.provider.ReferenceChangeItemProvider;
import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
@@ -49,8 +50,12 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
*
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
-public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider implements IItemStyledLabelProvider {
+public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider implements IItemStyledLabelProvider, IItemDescriptionProvider {
+ /** The elide length. */
+ private static final int ELIDE_LENGTH = 50;
+
+ /** The image provider used with this item provider. */
private final OverlayImageProvider overlayProvider;
/**
@@ -61,7 +66,7 @@ public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider
*/
public ReferenceChangeItemProviderSpec(AdapterFactory adapterFactory) {
super(adapterFactory);
- overlayProvider = new OverlayImageProvider(getResourceLocator(), true);
+ overlayProvider = new OverlayImageProvider(getResourceLocator());
}
/**
@@ -90,29 +95,49 @@ public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider
return changeText;
}
+ /**
+ * Returns the type of change linked to the given {@link EStructuralFeature} ("unset", "set" or
+ * "changed"), according the the given sides.
+ *
+ * @param eStructuralFeature
+ * the given {@link EStructuralFeature}.
+ * @param sourceSide
+ * the source side as an {@link EObject}.
+ * @param otherSide
+ * the other side as an {@link EObject}.
+ * @return a String ("unset", "set" or "changed") containing the type of change linked to the given
+ * {@link EStructuralFeature}, according the the given sides.
+ */
private static String changeText(final EStructuralFeature eStructuralFeature, EObject sourceSide,
EObject otherSide) {
String changeText;
if (sourceSide != null) {
Object leftValue = ReferenceUtil.safeEGet(sourceSide, eStructuralFeature);
if (leftValue == null || isStringAndNullOrEmpty(leftValue)) {
- changeText = "unset"; //$NON-NLS-1$
+ changeText = "unset";
} else if (otherSide != null) {
Object otherValue = ReferenceUtil.safeEGet(otherSide, eStructuralFeature);
if (otherValue == null || isStringAndNullOrEmpty(otherValue)) {
- changeText = "set"; //$NON-NLS-1$
+ changeText = "set";
} else {
- changeText = "changed"; //$NON-NLS-1$
+ changeText = "changed";
}
} else {
- changeText = "set"; //$NON-NLS-1$
+ changeText = "set";
}
} else {
- changeText = "unset"; //$NON-NLS-1$
+ changeText = "unset";
}
return changeText;
}
+ /**
+ * Checks if the given Object is a null or empty String.
+ *
+ * @param s
+ * the given Object.
+ * @return true if the Object is a null or empty String, false otherwise.
+ */
private static boolean isStringAndNullOrEmpty(Object s) {
if (s instanceof String) {
return Strings.isNullOrEmpty((String)s);
@@ -121,16 +146,30 @@ public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider
}
}
+ /**
+ * Returns the name of the reference linked to the given {@link ReferenceChange}.
+ *
+ * @param refChange
+ * the given {@link ReferenceChange}.
+ * @return the name of the reference linked to the given {@link ReferenceChange}.
+ */
protected String getReferenceText(final ReferenceChange refChange) {
return refChange.getReference().getName();
}
+ /**
+ * Converts to text the given {@link ReferenceChange}.
+ *
+ * @param refChange
+ * the given {@link ReferenceChange}.
+ * @return a nice text from the the given {@link ReferenceChange}.
+ */
protected String getValueText(final ReferenceChange refChange) {
String value = AdapterFactoryUtil.getText(getRootAdapterFactory(), refChange.getValue());
if (value == null) {
value = "<null>"; //$NON-NLS-1$
} else {
- value = org.eclipse.emf.compare.provider.spec.Strings.elide(value, 50, "..."); //$NON-NLS-1$
+ value = org.eclipse.emf.compare.provider.spec.Strings.elide(value, ELIDE_LENGTH, "..."); //$NON-NLS-1$
}
return value;
}
@@ -176,11 +215,17 @@ public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider
}
}
- return ImmutableList.copyOf(filter(filter(ret, not(instanceOf(ResourceAttachmentChange.class))),
- not(MatchItemProviderSpec.REFINED_DIFF)));
+ return ImmutableList.copyOf(filter(ret, not(instanceOf(ResourceAttachmentChange.class))));
}
+ /**
+ * Returns the children of the given {@link Match}.
+ *
+ * @param matchOfValue
+ * the given {@link Match}.
+ * @return the children of the given {@link Match}.
+ */
private Collection<?> getChildren(Match matchOfValue) {
final Collection<?> children;
ITreeItemContentProvider matchItemContentProvider = (ITreeItemContentProvider)adapterFactory.adapt(
@@ -243,23 +288,63 @@ public class ReferenceChangeItemProviderSpec extends ReferenceChangeItemProvider
switch (refChange.getKind()) {
case ADD:
- ret.append(" add", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+ ret.append(" add", Style.DECORATIONS_STYLER);
break;
case DELETE:
- ret.append(" delete", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+ ret.append(" delete", Style.DECORATIONS_STYLER);
break;
case CHANGE:
- ret.append(" " + changeText(refChange, refChange.getReference()), //$NON-NLS-1$
- Style.DECORATIONS_STYLER);
+ ret.append(" " + changeText(refChange, refChange.getReference()), Style.DECORATIONS_STYLER);
break;
case MOVE:
- ret.append(" move", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+ ret.append(" move", Style.DECORATIONS_STYLER);
+ break;
+ default:
+ throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName()
+ + " value: " + refChange.getKind());
+ }
+ ret.append("]", Style.DECORATIONS_STYLER); //$NON-NLS-1$
+
+ return ret;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemDescriptionProvider#getDescription(java.lang.Object)
+ */
+ public String getDescription(Object object) {
+ final ReferenceChange refChange = (ReferenceChange)object;
+
+ final String valueText = getValueText(refChange);
+ final String referenceText = getReferenceText(refChange);
+
+ String remotely = ""; //$NON-NLS-1$
+ if (refChange.getSource() == DifferenceSource.RIGHT) {
+ remotely = "remotely "; //$NON-NLS-1$
+ }
+
+ String ret = ""; //$NON-NLS-1$
+ final String hasBeen = " has been "; //$NON-NLS-1$
+
+ switch (refChange.getKind()) {
+ case ADD:
+ ret = valueText + hasBeen + remotely + "added to " + referenceText; //$NON-NLS-1$
+ break;
+ case DELETE:
+ ret = valueText + hasBeen + remotely + "deleted from " + referenceText; //$NON-NLS-1$
+ break;
+ case CHANGE:
+ String changeText = changeText(refChange, refChange.getReference());
+ ret = referenceText + " " + valueText + hasBeen + remotely + changeText; //$NON-NLS-1$
+ break;
+ case MOVE:
+ ret = valueText + hasBeen + remotely + "moved in " + referenceText; //$NON-NLS-1$
break;
default:
throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName() //$NON-NLS-1$
+ " value: " + refChange.getKind()); //$NON-NLS-1$
}
- ret.append("]", Style.DECORATIONS_STYLER); //$NON-NLS-1$
return ret;
}
diff --git a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java
index bf3656a9e..a403a9b8d 100644
--- a/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.edit/src/org/eclipse/emf/compare/provider/spec/ResourceAttachmentChangeItemProviderSpec.java
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.emf.compare.provider.spec;
-import static com.google.common.base.Predicates.not;
-import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Lists.newArrayList;
import com.google.common.collect.ImmutableCollection;
@@ -23,9 +21,11 @@ import java.util.List;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.compare.DifferenceKind;
+import org.eclipse.emf.compare.DifferenceSource;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.ResourceAttachmentChange;
import org.eclipse.emf.compare.provider.AdapterFactoryUtil;
+import org.eclipse.emf.compare.provider.IItemDescriptionProvider;
import org.eclipse.emf.compare.provider.IItemStyledLabelProvider;
import org.eclipse.emf.compare.provider.ResourceAttachmentChangeItemProvider;
import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
@@ -41,8 +41,9 @@ import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
* @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
* @since 3.0
*/
-public class ResourceAttachmentChangeItemProviderSpec extends ResourceAttachmentChangeItemProvider implements IItemStyledLabelProvider {
+public class ResourceAttachmentChangeItemProviderSpec extends ResourceAttachmentChangeItemProvider implements IItemStyledLabelProvider, IItemDescriptionProvider {
+ /** The image provider used with this item provider. */
private final OverlayImageProvider overlayProvider;
/**
@@ -53,7 +54,7 @@ public class ResourceAttachmentChangeItemProviderSpec extends ResourceAttachment
*/
public ResourceAttachmentChangeItemProviderSpec(AdapterFactory adapterFactory) {
super(adapterFactory);
- overlayProvider = new OverlayImageProvider(getResourceLocator(), true);
+ overlayProvider = new OverlayImageProvider(getResourceLocator());
}
/**
@@ -88,9 +89,16 @@ public class ResourceAttachmentChangeItemProviderSpec extends ResourceAttachment
ret.addAll(children);
}
- return ImmutableList.copyOf(filter(ret, not(MatchItemProviderSpec.REFINED_DIFF)));
+ return ImmutableList.copyOf(ret);
}
+ /**
+ * Returns the children of the given {@link Match}.
+ *
+ * @param matchOfValue
+ * the given {@link Match}.
+ * @return the children of the given {@link Match}.
+ */
private Collection<?> getChildren(Match matchOfValue) {
final Collection<?> children;
ITreeItemContentProvider matchItemContentProvider = (ITreeItemContentProvider)adapterFactory.adapt(
@@ -154,6 +162,11 @@ public class ResourceAttachmentChangeItemProviderSpec extends ResourceAttachment
return getStyledText(object).getString();
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemStyledLabelProvider#getStyledText(java.lang.Object)
+ */
public IComposedStyledString getStyledText(Object object) {
final Match match = ((ResourceAttachmentChange)object).getMatch();
String value = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getLeft());
@@ -175,4 +188,48 @@ public class ResourceAttachmentChangeItemProviderSpec extends ResourceAttachment
return ret.append(" [resource contents " + label + "]", Style.DECORATIONS_STYLER); //$NON-NLS-1$ //$NON-NLS-2$
}
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.provider.IItemDescriptionProvider#getDescription(java.lang.Object)
+ */
+ public String getDescription(Object object) {
+ final ResourceAttachmentChange rac = (ResourceAttachmentChange)object;
+ final Match match = rac.getMatch();
+ String ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getLeft());
+ if (ret == null) {
+ ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getRight());
+ }
+ if (ret == null) {
+ ret = AdapterFactoryUtil.getText(getRootAdapterFactory(), match.getOrigin());
+ }
+ if (ret == null) {
+ ret = super.getText(object);
+ }
+
+ String remotely = "";
+ if (rac.getSource() == DifferenceSource.RIGHT) {
+ remotely = "remotely ";
+ }
+
+ DifferenceKind labelValue = rac.getKind();
+ final String hasBeen = " has been ";
+
+ switch (labelValue) {
+ case ADD:
+ ret += hasBeen + remotely + "added to resource contents";
+ break;
+ case DELETE:
+ ret += hasBeen + remotely + "deleted from resource contents";
+ break;
+ case MOVE:
+ ret += hasBeen + remotely + "moved in resource contents";
+ break;
+ default:
+ throw new IllegalStateException("Unsupported " + DifferenceKind.class.getSimpleName()
+ + " value: " + rac.getKind());
+ }
+ return ret;
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
index 27b64a9f6..d96fb9cea 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide.ui/META-INF/MANIFEST.MF
@@ -35,9 +35,9 @@ Export-Package: org.eclipse.emf.compare.ide.ui.internal;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider;x-internal:=true,
org.eclipse.emf.compare.ide.ui.internal.util;x-internal:=true,
org.eclipse.emf.compare.ide.ui.logical
-Import-Package: com.google.common.annotations;version="[10.0.0,11.0.0)",
- com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.cache;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)",
- com.google.common.eventbus;version="[10.0.0,11.0.0)",
- com.google.common.io;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.annotations;version="[11.0.0,15.0.0)",
+ com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.cache;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)",
+ com.google.common.eventbus;version="[11.0.0,15.0.0)",
+ com.google.common.io;version="[11.0.0,15.0.0)"
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/about.ini b/plugins/org.eclipse.emf.compare.ide.ui/about.ini
new file mode 100644
index 000000000..eec22440e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/about.properties b/plugins/org.eclipse.emf.compare.ide.ui/about.properties
new file mode 100644
index 000000000..4825d266b
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/about.properties
@@ -0,0 +1,26 @@
+# /**
+# * <copyright>
+# *
+# * Copyright (c) 2006, 2012 Obeo and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Obeo - Initial API and implementation
+# *
+# * </copyright>
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=EMF Compare IDE UI
+
+featureText=EMF Compare - IDE UI\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright Obeo and others. 2006, 2012. All rights reserved.\n\
+\n\
+EMF Compare brings comparison to the Eclipse Modeling Framework\n\
+Visit http://www.eclipse.org/emf/compare
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/build.properties b/plugins/org.eclipse.emf.compare.ide.ui/build.properties
index b358a03aa..073b0de37 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/build.properties
+++ b/plugins/org.eclipse.emf.compare.ide.ui/build.properties
@@ -6,7 +6,13 @@ bin.includes = META-INF/,\
about.html,\
plugin.xml,\
icons/,\
- schema/
+ schema/,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
src.includes = about.html,\
icons/,\
- schema/
+ schema/,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/modeling32.png b/plugins/org.eclipse.emf.compare.ide.ui/modeling32.png
new file mode 100644
index 000000000..6b08de2ad
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml b/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
index 4e6e6ef7c..57c234b2a 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.ide.ui/plugin.xml
@@ -26,6 +26,10 @@
contentTypeId="org.eclipse.emf.ecore.xmi"
structureMergeViewerId="org.eclipse.emf.compare.ide.ui.internal.structureMergeViewer">
</contentTypeBinding>
+ <contentTypeBinding
+ contentTypeId="org.eclipse.emf.compare.content.type"
+ structureMergeViewerId="org.eclipse.emf.compare.ide.ui.internal.structureMergeViewer">
+ </contentTypeBinding>
</extension>
<extension
point="org.eclipse.compare.contentMergeViewers">
@@ -39,6 +43,10 @@
contentMergeViewerId="org.eclipse.emf.compare.ide.ui.internal.EObjectContentMergeViewer"
contentTypeId="org.eclipse.emf.ecore.xmi">
</contentTypeBinding>
+ <contentTypeBinding
+ contentMergeViewerId="org.eclipse.emf.compare.ide.ui.internal.EObjectContentMergeViewer"
+ contentTypeId="org.eclipse.emf.compare.content.type">
+ </contentTypeBinding>
<viewer
class="org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.table.TableContentMergeViewerCreator"
extensions="emfcompare_diff"
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
index 39ff1c246..1e710181d 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/EMFCompareIDEUIPlugin.java
@@ -199,8 +199,8 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
try {
Integer.parseInt(rankingStr);
} catch (NumberFormatException nfe) {
- logError(element, "Attribute '" + ATT_RANKING //$NON-NLS-1$
- + "' is malformed, should be an integer."); //$NON-NLS-1$
+ logError(element, "Attribute '" + ATT_RANKING
+ + "' is malformed, should be an integer.");
}
logMissingAttribute(element, ATT_RANKING);
} else {
@@ -212,8 +212,8 @@ public class EMFCompareIDEUIPlugin extends AbstractUIPlugin {
factory.setRanking(Integer.parseInt(element.getAttribute(ATT_RANKING)));
IAccessorFactory previous = registry.add(factory);
if (previous != null) {
- log(IStatus.WARNING, "The factory '" + factory.getClass().getName() //$NON-NLS-1$
- + "' is registered twice."); //$NON-NLS-1$
+ log(IStatus.WARNING, "The factory '" + factory.getClass().getName()
+ + "' is registered twice.");
}
} catch (CoreException e) {
logError(element, e.getMessage());
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
index 91dfb66cb..d819ba3fe 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
@@ -156,16 +156,11 @@ public abstract class EMFCompareContentMergeViewer extends ContentMergeViewer im
*/
@Override
protected void updateContent(Object ancestor, Object left, Object right) {
- undoAction.setEditingDomain(getEditingDomain());
- redoAction.setEditingDomain(getEditingDomain());
-
- if (getEditingDomain() != null && fCommandStackListener == null) {
- fCommandStackListener = installCommandStackListener(undoAction, redoAction);
- }
+ initStackListenerAndUpdateContent(ancestor, left, right);
+ updateSelection(left);
+ }
- fAncestor.setInput(ancestor);
- fLeft.setInput(left);
- fRight.setInput(right);
+ protected void updateSelection(Object left) {
// must update selection after the three viewers input has been set
// to avoid some NPE/AssertionError (they are calling each other on selectionChanged event to
// synchronize their selection)
@@ -181,6 +176,19 @@ public abstract class EMFCompareContentMergeViewer extends ContentMergeViewer im
getCenterControl().redraw();
}
+ protected void initStackListenerAndUpdateContent(Object ancestor, Object left, Object right) {
+ undoAction.setEditingDomain(getEditingDomain());
+ redoAction.setEditingDomain(getEditingDomain());
+
+ if (getEditingDomain() != null && fCommandStackListener == null) {
+ fCommandStackListener = installCommandStackListener(undoAction, redoAction);
+ }
+
+ fAncestor.setInput(ancestor);
+ fLeft.setInput(left);
+ fRight.setInput(right);
+ }
+
private ISelection createSelectionOrEmpty(final Object o) {
final ISelection selection;
if (o != null) {
@@ -298,7 +306,7 @@ public abstract class EMFCompareContentMergeViewer extends ContentMergeViewer im
getHandlerService().setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
}
- private CommandStackListener installCommandStackListener(final UndoAction undoAction,
+ protected CommandStackListener installCommandStackListener(final UndoAction undoAction,
final RedoAction redoAction) {
CommandStackListener commandStackListener = new CommandStackListener() {
public void commandStackChanged(EventObject event) {
@@ -491,6 +499,10 @@ public abstract class EMFCompareContentMergeViewer extends ContentMergeViewer im
protected void updateToolItems() {
super.updateToolItems();
+ manageCopyActionsActivation();
+ }
+
+ protected void manageCopyActionsActivation() {
Diff diff = getDiffFrom(getRightMergeViewer());
if (diff == null) {
diff = getDiffFrom(getLeftMergeViewer());
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/DynamicObject.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/DynamicObject.java
index 6ea3ca1f7..6fd0de513 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/DynamicObject.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/DynamicObject.java
@@ -12,9 +12,9 @@ package org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util;
import static com.google.common.base.Throwables.propagate;
-import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Field;
@@ -30,7 +30,7 @@ import java.lang.reflect.Modifier;
*/
public class DynamicObject {
- private final Cache<String, Field> fFieldCache;
+ private final LoadingCache<String, Field> fFieldCache;
private final Object fTarget;
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
index 1f01f03bf..f5ef7df56 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
@@ -130,6 +130,8 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
private FilterActionMenu filterActionMenu;
+ private SaveComparisonModelAction saveAction;
+
private EventBus eventBus;
/**
@@ -148,7 +150,7 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
setLabelProvider(new DelegatingStyledCellLabelProvider(
new EMFCompareStructureMergeViewerLabelProvider(fAdapterFactory, this)));
setContentProvider(new EMFCompareStructureMergeViewerContentProvider(fAdapterFactory,
- structureMergeViewerGrouper));
+ structureMergeViewerGrouper, structureMergeViewerFilter));
if (parent instanceof CompareViewerSwitchingPane) {
fParent = (CompareViewerSwitchingPane)parent;
@@ -247,7 +249,7 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
private IRunnableWithProgress inputChangedTask = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- monitor.beginTask("Computing Structure Differences", 100); //$NON-NLS-1$
+ monitor.beginTask("Computing Structure Differences", 100);
compareInputChanged((ICompareInput)getInput(), new SubProgressMonitor(monitor, 100));
monitor.done();
}
@@ -322,9 +324,11 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
final CompareConfiguration config = getCompareConfiguration();
if (!syncModel.isLeftEditable()) {
config.setLeftEditable(false);
+ saveAction.setEnabled(false);
}
if (!syncModel.isRightEditable()) {
config.setRightEditable(false);
+ saveAction.setEnabled(false);
}
final IComparisonScope scope = syncModel.createMinimizedScope();
@@ -450,7 +454,7 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
String message = null;
if (comparison.getDifferences().isEmpty()) {
- message = "No Differences"; //$NON-NLS-1$
+ message = "No Differences";
}
if (Display.getCurrent() != null) {
@@ -501,7 +505,8 @@ public class EMFCompareStructureMergeViewer extends DiffTreeViewer implements Co
groupActionMenu = new GroupActionMenu(getStructureMergeViewerGrouper(), getGroupsMenuManager(),
getDefaultGroupProvider());
filterActionMenu = new FilterActionMenu(getStructureMergeViewerFilter(), getFiltersMenuManager());
- toolbarManager.add(new SaveComparisonModelAction(getCompareConfiguration()));
+ saveAction = new SaveComparisonModelAction(getCompareConfiguration());
+ toolbarManager.add(saveAction);
toolbarManager.add(groupActionMenu);
toolbarManager.add(filterActionMenu);
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
index 562b32a00..b17c0cdab 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Obeo.
+ * Copyright (c) 2012, 2013 Obeo.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,38 +10,76 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
+import static com.google.common.base.Predicates.not;
+import static com.google.common.base.Predicates.or;
import static com.google.common.collect.Iterables.filter;
import static com.google.common.collect.Iterables.isEmpty;
import static com.google.common.collect.Iterables.toArray;
import static com.google.common.collect.Iterables.transform;
import com.google.common.base.Function;
+import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
+import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
+import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.ReferenceChange;
import org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider.ComparisonNode;
+import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.StructureMergeViewerFilter;
import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.DifferenceGroup;
import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.StructureMergeViewerGrouper;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
+import org.eclipse.swt.graphics.Image;
+/**
+ * Specialized AdapterFactoryContentProvider for the emf compare structure merge viewer.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
class EMFCompareStructureMergeViewerContentProvider extends AdapterFactoryContentProvider {
+ /** The viewer grouper associated with this content provider. */
private final StructureMergeViewerGrouper fViewerGrouper;
- EMFCompareStructureMergeViewerContentProvider(AdapterFactory adapterFactory,
- StructureMergeViewerGrouper structureMergeViewerGrouper) {
+ /** The viewer filter associated with this content provider. */
+ private final StructureMergeViewerFilter fViewerFilter;
+
+ /**
+ * Constructs the content provider with the appropriate adapter factory.
+ *
+ * @param adapterFactory
+ * The adapter factory used to construct the content provider.
+ * @param structureMergeViewerGrouper
+ * The viewer grouper associated with this content provider.
+ * @param structureMergeViewerFilter
+ * The viewer filter associated with this content provider.
+ */
+ public EMFCompareStructureMergeViewerContentProvider(AdapterFactory adapterFactory,
+ StructureMergeViewerGrouper structureMergeViewerGrouper,
+ StructureMergeViewerFilter structureMergeViewerFilter) {
super(adapterFactory);
this.fViewerGrouper = structureMergeViewerGrouper;
+ this.fViewerFilter = structureMergeViewerFilter;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#getParent(Object object)
+ */
@Override
public Object getParent(Object element) {
- final Object ret;
+ Object ret;
if (element instanceof Adapter) {
ret = getAdapterFactory().adapt(super.getParent(((Adapter)element).getTarget()),
ICompareInput.class);
@@ -53,6 +91,11 @@ class EMFCompareStructureMergeViewerContentProvider extends AdapterFactoryConten
return ret;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#hasChildren(Object object)
+ */
@Override
public final boolean hasChildren(Object element) {
final boolean ret;
@@ -74,6 +117,11 @@ class EMFCompareStructureMergeViewerContentProvider extends AdapterFactoryConten
return ret;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#getChildren(Object object)
+ */
@Override
public final Object[] getChildren(Object element) {
final Object[] ret;
@@ -88,20 +136,39 @@ class EMFCompareStructureMergeViewerContentProvider extends AdapterFactoryConten
ret = toArray(compareInputs, ICompareInput.class);
}
} else if (element instanceof DifferenceGroup) {
- Iterable<? extends Diff> differences = ((DifferenceGroup)element).getDifferences();
- Iterable<ICompareInput> compareInputs = adapt(differences, getAdapterFactory(),
+ final Comparison target = ((DifferenceGroup)element).getComparison();
+ Iterable<ICompareInput> compareInputs = adapt(super.getChildren(target), getAdapterFactory(),
ICompareInput.class);
- ret = toArray(compareInputs, ICompareInput.class);
+ Iterable<FilteredEDiffNode> filteredCompareInputs = filteredEDiffNodes(filter(compareInputs,
+ AbstractEDiffNode.class), (DifferenceGroup)element);
+ ret = toArray(filteredCompareInputs, FilteredEDiffNode.class);
} else if (element instanceof Adapter) {
- Iterable<ICompareInput> compareInputs = adapt(super.getChildren(((Adapter)element).getTarget()),
- getAdapterFactory(), ICompareInput.class);
- ret = toArray(compareInputs, ICompareInput.class);
+ final Iterable<Object> children;
+ if (element instanceof FilteredEDiffNode) {
+ children = filteredElements(super.getChildren(((Adapter)element).getTarget()),
+ ((FilteredEDiffNode)element).getDifferenceGroup());
+ } else {
+ children = Lists.newArrayList(super.getChildren(((Adapter)element).getTarget()));
+ }
+ Iterable<ICompareInput> compareInputs = adapt(children, getAdapterFactory(), ICompareInput.class);
+ if (element instanceof FilteredEDiffNode) {
+ Iterable<FilteredEDiffNode> filteredCompareInputs = filteredEDiffNodes(filter(compareInputs,
+ AbstractEDiffNode.class), ((FilteredEDiffNode)element).getDifferenceGroup());
+ ret = toArray(filteredCompareInputs, FilteredEDiffNode.class);
+ } else {
+ ret = toArray(compareInputs, ICompareInput.class);
+ }
} else {
ret = new Object[0];
}
return ret;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider#getElements(Object object)
+ */
@Override
public Object[] getElements(Object element) {
return getChildren(element);
@@ -116,9 +183,9 @@ class EMFCompareStructureMergeViewerContentProvider extends AdapterFactoryConten
* @param iterable
* the iterable to transform.
* @param adapterFactory
- * the {@link AdapterFactory} used to adapt elements
+ * the {@link AdapterFactory} used to adapt elements.
* @param type
- * the target type of adapted elements
+ * the target type of adapted elements.
* @return an iterable with element of type <code>type</code>.
*/
static <T> Iterable<T> adapt(Iterable<?> iterable, final AdapterFactory adapterFactory,
@@ -131,7 +198,260 @@ class EMFCompareStructureMergeViewerContentProvider extends AdapterFactoryConten
return filter(transform(iterable, adaptFunction), type);
}
+ /**
+ * Adapts each elements of the the given <code>array</code> to the given <code>type</code> by using the
+ * given <code>adapterFactory</code>.
+ *
+ * @param <T>
+ * the type of returned elements.
+ * @param iterable
+ * the array to transform.
+ * @param adapterFactory
+ * the {@link AdapterFactory} used to adapt elements.
+ * @param type
+ * the target type of adapted elements
+ * @return an iterable with element of type <code>type</code>.
+ */
static <T> Iterable<T> adapt(Object[] iterable, final AdapterFactory adapterFactory, final Class<T> type) {
return adapt(Lists.newArrayList(iterable), adapterFactory, type);
}
+
+ /**
+ * Filter out each element of the given <code>array</code> that should not be contained under the given
+ * {@link DifferenceGroup}.
+ *
+ * @param unfiltered
+ * the array to filter.
+ * @param diffGroup
+ * the given {@link DifferenceGroup}.
+ * @return an iterable of elements that should be contained under the given {@link DifferenceGroup}.
+ */
+ private Iterable<Object> filteredElements(Object[] unfiltered, final DifferenceGroup diffGroup) {
+ final Predicate<? super Object> isPartOfTree = new Predicate<Object>() {
+ public boolean apply(Object input) {
+ return isPartOfGroup(input, diffGroup);
+ }
+ };
+ return filter(Lists.newArrayList(unfiltered), isPartOfTree);
+ }
+
+ /**
+ * Returns whether this object should be contained under the given {@link DifferenceGroup}.
+ *
+ * @param object
+ * the object to filter.
+ * @param diffGroup
+ * the given {@link DifferenceGroup}.
+ * @return true if the object should be contained under the given {@link DifferenceGroup}, false
+ * otherwise.
+ */
+ private boolean isPartOfGroup(Object object, final DifferenceGroup diffGroup) {
+ final Predicate<? super EObject> isPartOfTree = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ return Iterables.contains(filter(diffGroup.getDifferences(), not(or(fViewerFilter
+ .getPredicates()))), input);
+ }
+ };
+ boolean ret = false;
+ if (object instanceof Match) {
+ ret = Iterables.any(((Match)object).getAllDifferences(), isPartOfTree);
+ } else if (object instanceof Diff) {
+ if (!isPartOfTree.apply((Diff)object)) {
+ if (object instanceof ReferenceChange
+ && ((ReferenceChange)object).getReference().isContainment()) {
+ ret = Iterables.any(((Diff)object).getMatch().getComparison().getMatch(
+ ((ReferenceChange)object).getValue()).getAllDifferences(), isPartOfTree);
+ }
+ } else {
+ ret = true;
+ }
+ }
+ return ret;
+ }
+
+ /**
+ * Creates an iterable of {@link FilteredEDiffNode} from an iterable of {@link AbstractEDiffNode} and a
+ * {@link DifferenceGroup}.
+ *
+ * @param iterable
+ * the iterable of {@link AbstractEDiffNode} to transform.
+ * @param diffGroup
+ * the {@link DifferenceGroup} to associate with the FilteredEDiffNodes.
+ * @return an iterable of {@link FilteredEDiffNode}.
+ */
+ private Iterable<FilteredEDiffNode> filteredEDiffNodes(Iterable<AbstractEDiffNode> iterable,
+ final DifferenceGroup diffGroup) {
+ Function<AbstractEDiffNode, FilteredEDiffNode> adaptFunction = new Function<AbstractEDiffNode, FilteredEDiffNode>() {
+ public FilteredEDiffNode apply(AbstractEDiffNode input) {
+ return new FilteredEDiffNode(input, diffGroup);
+ }
+ };
+ return transform(iterable, adaptFunction);
+ }
+
+ /**
+ * AbstractEDiffNodes that know the DifferenceGroup in which they are. This class wraps an
+ * AbstractEDiffNode and it delegates its interfaces to corresponding AbstractEDiffNode implemented
+ * interfaces.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ */
+ private class FilteredEDiffNode implements ICompareInput, Adapter {
+
+ /** The AbstractEDiffNode wrapped. */
+ private AbstractEDiffNode fDelegate;
+
+ /** The DifferenceGroup associated with the node. */
+ private DifferenceGroup differenceGroup;
+
+ /**
+ * This constructs an instance that wraps this {@link AbstractEDiffNode} contained in the given
+ * {@link DifferenceGroup}.
+ *
+ * @param delegate
+ * the given AbstractEDiffNode.
+ * @param diffGroup
+ * the given DifferenceGroup.
+ */
+ public FilteredEDiffNode(AbstractEDiffNode delegate, DifferenceGroup diffGroup) {
+ fDelegate = delegate;
+ differenceGroup = diffGroup;
+ }
+
+ /**
+ * Returns the backing delegate instance that methods are forwarded to.
+ *
+ * @return the wrapped AbstractEDiffNode.
+ */
+ private AbstractEDiffNode delegate() {
+ return fDelegate;
+ }
+
+ /**
+ * Returns the {@link DifferenceGroup} associated with the wrapped {@link AbstractEDiffNode}.
+ *
+ * @return the difference group.
+ */
+ public DifferenceGroup getDifferenceGroup() {
+ return differenceGroup;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#getName()
+ */
+ public String getName() {
+ return delegate().getName();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#getImage()
+ */
+ public Image getImage() {
+ return delegate().getImage();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#getKind()
+ */
+ public int getKind() {
+ return delegate().getKind();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#getAncestor()
+ */
+ public ITypedElement getAncestor() {
+ return delegate().getAncestor();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#getLeft()
+ */
+ public ITypedElement getLeft() {
+ return delegate().getLeft();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#getRight()
+ */
+ public ITypedElement getRight() {
+ return delegate().getRight();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#addCompareInputChangeListener(org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener)
+ */
+ public void addCompareInputChangeListener(ICompareInputChangeListener listener) {
+ delegate().addCompareInputChangeListener(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#removeCompareInputChangeListener(org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener)
+ */
+ public void removeCompareInputChangeListener(ICompareInputChangeListener listener) {
+ delegate().removeCompareInputChangeListener(listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.compare.structuremergeviewer.ICompareInput#copy(boolean)
+ */
+ public void copy(boolean leftToRight) {
+ delegate().copy(leftToRight);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ public void notifyChanged(Notification notification) {
+ delegate().notifyChanged(notification);
+
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#getTarget()
+ */
+ public Notifier getTarget() {
+ return delegate().getTarget();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
+ */
+ public void setTarget(Notifier newTarget) {
+ delegate().setTarget(newTarget);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(Object)
+ */
+ public boolean isAdapterForType(Object type) {
+ return delegate().isAdapterForType(type);
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerLabelProvider.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerLabelProvider.java
index a6d58f446..d8ec3ddc4 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerLabelProvider.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewerLabelProvider.java
@@ -27,15 +27,30 @@ import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
+/**
+ * A specialized {@link AdapterFactoryLabelProvider.FontAndColorProvider} for the structure merge viewer.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
class EMFCompareStructureMergeViewerLabelProvider extends AdapterFactoryLabelProvider.FontAndColorProvider implements IStyledLabelProvider {
/**
+ * Constructor calling super {@link #FontAndColorProvider(AdapterFactory, Viewer)}.
+ *
* @param adapterFactory
+ * The adapter factory.
+ * @param viewer
+ * The viewer.
*/
public EMFCompareStructureMergeViewerLabelProvider(AdapterFactory adapterFactory, Viewer viewer) {
super(adapterFactory, viewer);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider#getText(java.lang.Object)
+ */
@Override
public String getText(Object element) {
return getStyledText(element).getString();
@@ -80,6 +95,11 @@ class EMFCompareStructureMergeViewerLabelProvider extends AdapterFactoryLabelPro
return super.getBackground(object);
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider#getImage(java.lang.Object)
+ */
@Override
public Image getImage(Object element) {
final Image ret;
@@ -99,6 +119,13 @@ class EMFCompareStructureMergeViewerLabelProvider extends AdapterFactoryLabelPro
return ret;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see
+ * org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider.getStyledText(java
+ * .lang.Object)
+ */
public StyledString getStyledText(Object element) {
final StyledString ret;
if (element instanceof Adapter) {
@@ -110,7 +137,8 @@ class EMFCompareStructureMergeViewerLabelProvider extends AdapterFactoryLabelPro
ret = styledText;
}
} else if (element instanceof DifferenceGroup) {
- ret = new StyledString(((DifferenceGroup)element).getName());
+ StyledStringConverter stringConverter = new StyledStringConverter();
+ return stringConverter.toJFaceStyledString(((DifferenceGroup)element).getStyledName());
} else {
ret = new StyledString(super.getText(element));
}
@@ -137,13 +165,13 @@ class EMFCompareStructureMergeViewerLabelProvider extends AdapterFactoryLabelPro
if (object == null) {
return null;
}
-
+ StyledString ret = null;
Object itemStyledLabelProvider = adapterFactory.adapt(object, IItemStyledLabelProvider.class);
if (itemStyledLabelProvider instanceof IItemStyledLabelProvider) {
StyledStringConverter stringConverter = new StyledStringConverter();
- return stringConverter.toJFaceStyledString(((IItemStyledLabelProvider)itemStyledLabelProvider)
+ ret = stringConverter.toJFaceStyledString(((IItemStyledLabelProvider)itemStyledLabelProvider)
.getStyledText(object));
}
- return null;
+ return ret;
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/provider/MatchNode.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/provider/MatchNode.java
index b3293ce2f..1ebdefce6 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/provider/MatchNode.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/provider/MatchNode.java
@@ -10,14 +10,14 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.provider;
-import static com.google.common.collect.Iterables.all;
-import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.any;
import static com.google.common.collect.Iterables.isEmpty;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.fromSide;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.hasConflict;
import com.google.common.base.Predicate;
import org.eclipse.compare.structuremergeviewer.Differencer;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.compare.ConflictKind;
import org.eclipse.emf.compare.Diff;
@@ -42,24 +42,6 @@ public class MatchNode extends AbstractEDiffNode {
}
};
- private static final Predicate<Diff> PSEUDO_CONFLICT = new Predicate<Diff>() {
- public boolean apply(Diff input) {
- return input != null && input.getConflict().getKind() == ConflictKind.REAL;
- }
- };
-
- private static final Predicate<Diff> LEFT_DIFF = new Predicate<Diff>() {
- public boolean apply(Diff input) {
- return input != null && input.getSource() == DifferenceSource.LEFT;
- }
- };
-
- private static final Predicate<Diff> RIGHT_DIFF = new Predicate<Diff>() {
- public boolean apply(Diff input) {
- return input != null && input.getSource() == DifferenceSource.RIGHT;
- }
- };
-
/**
* Creates a node with the given factory.
*
@@ -83,7 +65,7 @@ public class MatchNode extends AbstractEDiffNode {
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.AbstractEDiffElement#getKind()
+ * @see org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.AbstractEDiffNode#getKind()
*/
@Override
public int getKind() {
@@ -96,93 +78,43 @@ public class MatchNode extends AbstractEDiffNode {
final Iterable<Diff> differences = getTarget().getAllDifferences();
if (getTarget().getComparison().isThreeWay()) {
- Iterable<Diff> conflictualDiffs = filter(differences, CONFLICTUAL_DIFF);
+ /*
+ * Differencer.CONFLICTING == Differencer.LEFT | Differencer.RIGHT. With that in mind, all we need
+ * to check is whether this is a pseudo conflict, and the kind of diff (deletion, addition).
+ */
+ if (any(differences, hasConflict(ConflictKind.REAL))) {
+ ret |= Differencer.CONFLICTING;
+ } else if (any(differences, hasConflict(ConflictKind.PSEUDO))) {
+ // "pseudo" does not include the direction bits, we add them both through "CONFLITING"
+ ret |= Differencer.CONFLICTING | Differencer.PSEUDO_CONFLICT;
+ } else {
+ if (any(differences, fromSide(DifferenceSource.LEFT))) {
+ ret |= Differencer.LEFT;
+ }
+ if (any(differences, fromSide(DifferenceSource.RIGHT))) {
+ ret |= Differencer.RIGHT;
+ }
+ }
if (ancestor == null) {
- if (left == null) {
- if (right == null) {
- Assert.isTrue(false);
- // shouldn't happen
- } else {
- ret = Differencer.RIGHT | Differencer.ADDITION;
- }
- } else {
- if (right == null) {
- ret = Differencer.LEFT | Differencer.ADDITION;
- } else {
- if (!isEmpty(conflictualDiffs)) {
- ret = Differencer.CONFLICTING | Differencer.ADDITION;
- if (all(conflictualDiffs, PSEUDO_CONFLICT)) {
- ret |= Differencer.PSEUDO_CONFLICT;
- }
- }
- }
- }
- } else {
- if (left == null) {
- if (right == null) {
- ret = Differencer.CONFLICTING | Differencer.DELETION | Differencer.PSEUDO_CONFLICT;
- } else {
- if (isEmpty(conflictualDiffs)) {
- ret = Differencer.LEFT | Differencer.DELETION;
- } else {
- if (!isEmpty(conflictualDiffs)) {
- ret = Differencer.CONFLICTING | Differencer.DELETION;
- if (all(conflictualDiffs, PSEUDO_CONFLICT)) {
- ret |= Differencer.PSEUDO_CONFLICT;
- }
- }
- }
- }
+ if (left == null || right == null) {
+ ret |= Differencer.ADDITION;
} else {
- if (right == null) {
- if (isEmpty(conflictualDiffs)) {
- ret = Differencer.RIGHT | Differencer.DELETION;
- } else {
- if (!isEmpty(conflictualDiffs)) {
- ret = Differencer.CONFLICTING | Differencer.CHANGE;
- if (all(conflictualDiffs, PSEUDO_CONFLICT)) {
- ret |= Differencer.PSEUDO_CONFLICT;
- }
- }
- }
- } else {
- boolean ay = isEmpty(filter(differences, LEFT_DIFF));
- boolean am = isEmpty(filter(differences, RIGHT_DIFF));
-
- if (isEmpty(differences)) {
- // empty
- } else if (ay && !am) {
- ret = Differencer.RIGHT | Differencer.CHANGE;
- } else if (!ay && am) {
- ret = Differencer.LEFT | Differencer.CHANGE;
- } else {
- if (!isEmpty(conflictualDiffs)) {
- ret = Differencer.CONFLICTING | Differencer.CHANGE;
- if (all(conflictualDiffs, PSEUDO_CONFLICT)) {
- ret |= Differencer.PSEUDO_CONFLICT;
- }
- }
- }
- }
+ // Can't have all three sides null.
}
+ } else if (left == null || right == null) {
+ ret |= Differencer.DELETION;
+ } else if (!isEmpty(differences)) {
+ ret |= Differencer.CHANGE;
}
- } else { // two way compare ignores ancestor
+ } else {
+ // no direction bit in two-way
if (left == null) {
- if (right == null) {
- Assert.isTrue(false);
- // shouldn't happen
- } else {
- ret = Differencer.ADDITION;
- }
- } else {
- if (right == null) {
- ret = Differencer.DELETION;
- } else {
- if (!isEmpty(differences)) {
- ret = Differencer.CHANGE;
- }
- }
+ ret |= Differencer.DELETION;
+ } else if (right == null) {
+ ret |= Differencer.ADDITION;
+ } else if (!isEmpty(differences)) {
+ ret |= Differencer.CHANGE;
}
}
return ret;
diff --git a/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
index 09d92e3ad..bda2586ba 100644
--- a/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.ide/META-INF/MANIFEST.MF
@@ -12,12 +12,12 @@ Require-Bundle: org.eclipse.core.runtime,
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Localization: plugin
-Import-Package: com.google.common.annotations;version="[10.0.0,11.0.0)",
- com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.cache;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)",
- com.google.common.io;version="[10.0.0,11.0.0)",
- com.google.common.util.concurrent;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.annotations;version="[11.0.0,15.0.0)",
+ com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.cache;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)",
+ com.google.common.io;version="[11.0.0,15.0.0)",
+ com.google.common.util.concurrent;version="[11.0.0,15.0.0)"
Export-Package: org.eclipse.emf.compare.ide,
org.eclipse.emf.compare.ide.internal.extension;x-internal:=true,
org.eclipse.emf.compare.ide.internal.policy;x-internal:=true,
diff --git a/plugins/org.eclipse.emf.compare.ide/plugin.xml b/plugins/org.eclipse.emf.compare.ide/plugin.xml
index a86b75aef..49ce681c9 100644
--- a/plugins/org.eclipse.emf.compare.ide/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.ide/plugin.xml
@@ -38,4 +38,12 @@
ranking="10">
</merger>
</extension>
+ <extension
+ point="org.eclipse.core.contenttype.contentTypes">
+ <content-type
+ id="org.eclipse.emf.compare.content.type"
+ name="EMF Compare"
+ priority="normal">
+ </content-type>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java
index fccc3f49b..09a748288 100644
--- a/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java
+++ b/plugins/org.eclipse.emf.compare.ide/src/org/eclipse/emf/compare/ide/internal/utils/ForwardingXMLHandler.java
@@ -10,9 +10,9 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.internal.utils;
-import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
import com.google.common.collect.Maps;
import java.lang.reflect.Field;
@@ -50,7 +50,7 @@ public class ForwardingXMLHandler extends XMLHandler {
* The cache in which we'll store the fields we access through reflection. Note that this is only used by
* a single field in this implementation.
*/
- private static final Cache<String, Field> FIELD_CACHE = CacheBuilder.newBuilder().build(
+ private static final LoadingCache<String, Field> FIELD_CACHE = CacheBuilder.newBuilder().build(
new CacheLoader<String, Field>() {
/**
* {@inheritDoc}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
index 5cea7b380..7aa87b068 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/META-INF/MANIFEST.MF
@@ -7,6 +7,7 @@ Bundle-Activator: org.eclipse.emf.compare.rcp.ui.EMFCompareRCPUIPlugin
Bundle-Vendor: %providerName
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
+Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.emf.edit.ui;bundle-version="2.5.0",
org.eclipse.emf.compare;bundle-version="2.0.1",
@@ -18,7 +19,7 @@ Export-Package: org.eclipse.emf.compare.rcp.ui,
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.actions,
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters,
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.cache;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)",
- com.google.common.eventbus;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.cache;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)",
+ com.google.common.eventbus;version="[11.0.0,15.0.0)"
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/about.ini b/plugins/org.eclipse.emf.compare.rcp.ui/about.ini
new file mode 100644
index 000000000..eec22440e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/about.properties b/plugins/org.eclipse.emf.compare.rcp.ui/about.properties
new file mode 100644
index 000000000..0fc1ee74a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/about.properties
@@ -0,0 +1,26 @@
+# /**
+# * <copyright>
+# *
+# * Copyright (c) 2006, 2012 Obeo and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Obeo - Initial API and implementation
+# *
+# * </copyright>
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=EMF Compare RCP UI
+
+featureText=EMF Compare - RCP UI\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright Obeo and others. 2006, 2012. All rights reserved.\n\
+\n\
+EMF Compare brings comparison to the Eclipse Modeling Framework\n\
+Visit http://www.eclipse.org/emf/compare
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/build.properties b/plugins/org.eclipse.emf.compare.rcp.ui/build.properties
index 06dc0bb29..002d2e06f 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/build.properties
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/build.properties
@@ -6,7 +6,13 @@ bin.includes = META-INF/,\
about.html,\
plugin.xml,\
icons/,\
- schema/
+ schema/,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
src.includes = about.html,\
icons/,\
- schema/
+ schema/,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/modeling32.png b/plugins/org.eclipse.emf.compare.rcp.ui/modeling32.png
new file mode 100644
index 000000000..6b08de2ad
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml b/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml
index b76137a6a..82aac02d4 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/plugin.xml
@@ -24,11 +24,6 @@
</group>
<group
activeByDefault="false"
- class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.MetamodelGroupProvider"
- label="By Metaclass">
- </group>
- <group
- activeByDefault="false"
class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.ThreeWayComparisonGroupProvider"
label="By Side">
</group>
@@ -36,29 +31,29 @@
<extension
point="org.eclipse.emf.compare.rcp.ui.filters">
<filter
- activeByDefault="false"
- class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.ChangedElementsFilter"
- label="Changed elements">
+ activeByDefault="true"
+ class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.EmptyMatchedResourcesFilter"
+ label="Empty resource mappings">
</filter>
<filter
- activeByDefault="false"
- class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.AddedElementsFilter"
- label="Added elements">
+ activeByDefault="true"
+ class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.PseudoConflictsFilter"
+ label="Pseudo conflicts differences">
</filter>
<filter
- activeByDefault="false"
- class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.RemovedElementsFilter"
- label="Removed elements">
+ activeByDefault="true"
+ class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.PseudoDeleteConflictsFilter"
+ label="Pseudo delete conflicts differences">
</filter>
<filter
- activeByDefault="false"
- class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.MovedElementsFilter"
- label="Moved elements">
+ activeByDefault="true"
+ class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IdenticalElementsFilter"
+ label="Identical elements">
</filter>
<filter
activeByDefault="true"
- class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.EmptyMatchedResourcesFilter"
- label="Empty Resource Mappings">
+ class="org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.SubDiffElementsFilter"
+ label="Sub diff elements">
</filter>
</extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java
index 47c18313c..4cfe494d3 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/EMFCompareRCPUIPlugin.java
@@ -256,8 +256,8 @@ public class EMFCompareRCPUIPlugin extends AbstractUIPlugin {
}
IDifferenceGroupProvider previous = groupProviderRegistry.add(provider);
if (previous != null) {
- log(IStatus.WARNING, "The provider '" + provider.getClass().getName() //$NON-NLS-1$
- + "' is registered twice."); //$NON-NLS-1$
+ log(IStatus.WARNING, "The provider '" + provider.getClass().getName()
+ + "' is registered twice.");
}
} catch (CoreException e) {
logError(element, e.getMessage());
@@ -334,8 +334,8 @@ public class EMFCompareRCPUIPlugin extends AbstractUIPlugin {
}
IDifferenceFilter previous = filterRegistry.add(filter);
if (previous != null) {
- log(IStatus.WARNING, "The filter '" + filter.getClass().getName() //$NON-NLS-1$
- + "' is registered twice."); //$NON-NLS-1$
+ log(IStatus.WARNING, "The filter '" + filter.getClass().getName()
+ + "' is registered twice.");
}
} catch (CoreException e) {
logError(element, e.getMessage());
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java
index f46606c56..190a6c336 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/internal/util/AbstractRegistryEventListener.java
@@ -117,7 +117,7 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
internalReadElement(children[i], action);
}
} else {
- logError(element, "Error processing extension: " + element); //$NON-NLS-1$
+ logError(element, "Error processing extension: " + element);
}
}
@@ -131,7 +131,7 @@ public abstract class AbstractRegistryEventListener implements IRegistryEventLis
* the name of the missing attribute.
*/
protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
- logError(element, "The required attribute '" + attributeName + "' not defined"); //$NON-NLS-1$//$NON-NLS-2$
+ logError(element, "The required attribute '" + attributeName + "' not defined");
}
/**
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/CompareColorImpl.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/CompareColorImpl.java
index 2999e5fc3..35c78c76e 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/CompareColorImpl.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/CompareColorImpl.java
@@ -1,280 +1,280 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.rcp.ui.mergeviewer;
-
-import com.google.common.cache.Cache;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.RemovalListener;
-import com.google.common.cache.RemovalNotification;
-
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.ColorRegistry;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.RGB;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * Default implementation that use a cache to store created Color and that is listening to a preference store
- * for color configuration.
- *
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class CompareColorImpl implements RemovalListener<RGB, Color>, ICompareColor {
-
- /**
- *
- */
- private static final int MAX_CACHE_SIZE = 16;
-
- /**
- *
- */
- private static final int MED_RGB_COMPONENT = 128;
-
- /**
- *
- */
- private static final int MAX_RGB_COMPONENT = 255;
-
- /**
- *
- */
- private static final double INTERPOLATION_SCALE_1 = 0.6;
-
- /**
- *
- */
- private static final double INTERPOLATION_SCALE_2 = 0.97;
-
- public static final String INCOMING_COLOR = "INCOMING_COLOR"; //$NON-NLS-1$
-
- public static final String OUTGOING_COLOR = "OUTGOING_COLOR"; //$NON-NLS-1$
-
- public static final String CONFLICTING_COLOR = "CONFLICTING_COLOR"; //$NON-NLS-1$
-
- public static final String RESOLVED_COLOR = "RESOLVED_COLOR"; //$NON-NLS-1$
-
- private RGB fIncomingSelected;
-
- private RGB fIncoming;
-
- private RGB fIncomingFill;
-
- private RGB fConflictSelected;
-
- private RGB fConflict;
-
- private RGB fConflictFill;
-
- private RGB fOutgoingSelected;
-
- private RGB fOutgoing;
-
- private RGB fOutgoingFill;
-
- private RGB fResolved;
-
- private final Cache<RGB, Color> fColors;
-
- private final IPreferenceStore fPreferenceStore;
-
- private final IPropertyChangeListener fPreferenceChangeListener;
-
- private final boolean fLeftIsLocal;
-
- private Display fDisplay;
-
- public CompareColorImpl(Display display, boolean leftIsLocal, IPreferenceStore preferenceStore) {
- this.fDisplay = display;
- this.fPreferenceStore = preferenceStore;
- this.fColors = CacheBuilder.newBuilder().maximumSize(MAX_CACHE_SIZE).removalListener(this).build(
- new CacheLoader<RGB, Color>() {
- @Override
- public Color load(RGB rgb) throws Exception {
- return new Color(fDisplay, rgb);
- }
- });
-
- this.fPreferenceChangeListener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- handlePropertyChangeEvent(event);
- }
- };
-
- if (fPreferenceStore != null) {
- fPreferenceStore.addPropertyChangeListener(fPreferenceChangeListener);
- }
-
- fLeftIsLocal = leftIsLocal;
- updateColors();
- }
-
- public void onRemoval(RemovalNotification<RGB, Color> notification) {
- Color color = notification.getValue();
- if (!color.isDisposed()) {
- color.dispose();
- }
- }
-
- protected final void handlePropertyChangeEvent(PropertyChangeEvent event) {
- String key = event.getProperty();
-
- if (key.equals(INCOMING_COLOR) || key.equals(OUTGOING_COLOR) || key.equals(CONFLICTING_COLOR)
- || key.equals(RESOLVED_COLOR)) {
- updateColors();
- }
- }
-
- private Color getColor(RGB rgb) {
- if (rgb == null) {
- return null;
- }
- Color c = fColors.getUnchecked(rgb);
- return c;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.ICompareColor#getFillColor(org.eclipse.emf.compare.Diff,
- * boolean, boolean, boolean)
- */
- public Color getFillColor(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
- return getColor(getFillRGB(diff, isThreeWay, isIgnoreAncestor, selected));
- }
-
- private RGB getFillRGB(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
- RGB selectedFill = getBackground();
- if (isThreeWay && !isIgnoreAncestor) {
- boolean requiredConflictForWayOfMerge = false;
-
- if (diff.getConflict() == null && !requiredConflictForWayOfMerge) {
- switch (diff.getSource()) {
- case RIGHT:
- if (fLeftIsLocal) {
- return selected ? selectedFill : fIncomingFill;
- }
- return selected ? selectedFill : fOutgoingFill;
- case LEFT:
- if (fLeftIsLocal) {
- return selected ? selectedFill : fOutgoingFill;
- }
- return selected ? selectedFill : fIncomingFill;
- }
- } else {
- return selected ? selectedFill : fConflictFill;
- }
- return selected ? selectedFill : fConflictFill;
- }
- return selected ? selectedFill : fOutgoingFill;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.ICompareColor#getStrokeColor(org.eclipse.emf.compare.Diff,
- * boolean, boolean, boolean)
- */
- public Color getStrokeColor(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
- return getColor(getStrokeRGB(diff, isThreeWay, isIgnoreAncestor, selected));
- }
-
- private RGB getStrokeRGB(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
- if (isThreeWay && !isIgnoreAncestor) {
- boolean requiredConflictForWayOfMerge = false;
-
- if (diff.getConflict() == null && !requiredConflictForWayOfMerge) {
- switch (diff.getSource()) {
- case RIGHT:
- if (fLeftIsLocal) {
- return selected ? fIncomingSelected : fIncoming;
- }
- return selected ? fOutgoingSelected : fOutgoing;
- case LEFT:
- if (fLeftIsLocal) {
- return selected ? fOutgoingSelected : fOutgoing;
- }
- return selected ? fIncomingSelected : fIncoming;
- }
- } else {
- return selected ? fConflictSelected : fConflict;
- }
- return selected ? fConflictSelected : fConflict;
- }
- return selected ? fOutgoingSelected : fOutgoing;
- }
-
- private RGB getBackground() {
- return fDisplay.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
- }
-
- private void updateColors() {
- ColorRegistry registry = JFaceResources.getColorRegistry();
-
- RGB bg = getBackground();
- fIncomingSelected = registry.getRGB(INCOMING_COLOR);
- if (fIncomingSelected == null) {
- fIncomingSelected = new RGB(0, 0, MAX_RGB_COMPONENT); // BLUE
- }
- fIncoming = interpolate(fIncomingSelected, bg, INTERPOLATION_SCALE_1);
- fIncomingFill = interpolate(fIncomingSelected, bg, INTERPOLATION_SCALE_2);
-
- fOutgoingSelected = registry.getRGB(OUTGOING_COLOR);
- if (fOutgoingSelected == null) {
- fOutgoingSelected = new RGB(0, 0, 0); // BLACK
- }
- fOutgoing = interpolate(fOutgoingSelected, bg, INTERPOLATION_SCALE_1);
- fOutgoingFill = interpolate(fOutgoingSelected, bg, INTERPOLATION_SCALE_2);
-
- fConflictSelected = registry.getRGB(CONFLICTING_COLOR);
- if (fConflictSelected == null) {
- fConflictSelected = new RGB(MAX_RGB_COMPONENT, 0, 0); // RED
- }
- fConflict = interpolate(fConflictSelected, bg, INTERPOLATION_SCALE_1);
- fConflictFill = interpolate(fConflictSelected, bg, INTERPOLATION_SCALE_2);
-
- fResolved = registry.getRGB(RESOLVED_COLOR);
- if (fResolved == null) {
- fResolved = new RGB(0, MAX_RGB_COMPONENT, 0); // GREEN
- }
- }
-
- private static RGB interpolate(RGB fg, RGB bg, double scale) {
- if (fg != null && bg != null) {
- return new RGB((int)((1.0 - scale) * fg.red + scale * bg.red),
- (int)((1.0 - scale) * fg.green + scale * bg.green), (int)((1.0 - scale) * fg.blue + scale
- * bg.blue));
- }
- if (fg != null) {
- return fg;
- }
- if (bg != null) {
- return bg;
- }
- return new RGB(MED_RGB_COMPONENT, MED_RGB_COMPONENT, MED_RGB_COMPONENT); // a gray
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.ICompareColor#dispose()
- */
- public void dispose() {
- fColors.invalidateAll();
- fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.mergeviewer;
+
+import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
+import com.google.common.cache.RemovalListener;
+import com.google.common.cache.RemovalNotification;
+
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * Default implementation that use a cache to store created Color and that is listening to a preference store
+ * for color configuration.
+ *
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class CompareColorImpl implements RemovalListener<RGB, Color>, ICompareColor {
+
+ /**
+ *
+ */
+ private static final int MAX_CACHE_SIZE = 16;
+
+ /**
+ *
+ */
+ private static final int MED_RGB_COMPONENT = 128;
+
+ /**
+ *
+ */
+ private static final int MAX_RGB_COMPONENT = 255;
+
+ /**
+ *
+ */
+ private static final double INTERPOLATION_SCALE_1 = 0.6;
+
+ /**
+ *
+ */
+ private static final double INTERPOLATION_SCALE_2 = 0.97;
+
+ public static final String INCOMING_COLOR = "INCOMING_COLOR"; //$NON-NLS-1$
+
+ public static final String OUTGOING_COLOR = "OUTGOING_COLOR"; //$NON-NLS-1$
+
+ public static final String CONFLICTING_COLOR = "CONFLICTING_COLOR"; //$NON-NLS-1$
+
+ public static final String RESOLVED_COLOR = "RESOLVED_COLOR"; //$NON-NLS-1$
+
+ private RGB fIncomingSelected;
+
+ private RGB fIncoming;
+
+ private RGB fIncomingFill;
+
+ private RGB fConflictSelected;
+
+ private RGB fConflict;
+
+ private RGB fConflictFill;
+
+ private RGB fOutgoingSelected;
+
+ private RGB fOutgoing;
+
+ private RGB fOutgoingFill;
+
+ private RGB fResolved;
+
+ private final LoadingCache<RGB, Color> fColors;
+
+ private final IPreferenceStore fPreferenceStore;
+
+ private final IPropertyChangeListener fPreferenceChangeListener;
+
+ private final boolean fLeftIsLocal;
+
+ private Display fDisplay;
+
+ public CompareColorImpl(Display display, boolean leftIsLocal, IPreferenceStore preferenceStore) {
+ this.fDisplay = display;
+ this.fPreferenceStore = preferenceStore;
+ this.fColors = CacheBuilder.newBuilder().maximumSize(MAX_CACHE_SIZE).removalListener(this).build(
+ new CacheLoader<RGB, Color>() {
+ @Override
+ public Color load(RGB rgb) throws Exception {
+ return new Color(fDisplay, rgb);
+ }
+ });
+
+ this.fPreferenceChangeListener = new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ handlePropertyChangeEvent(event);
+ }
+ };
+
+ if (fPreferenceStore != null) {
+ fPreferenceStore.addPropertyChangeListener(fPreferenceChangeListener);
+ }
+
+ fLeftIsLocal = leftIsLocal;
+ updateColors();
+ }
+
+ public void onRemoval(RemovalNotification<RGB, Color> notification) {
+ Color color = notification.getValue();
+ if (!color.isDisposed()) {
+ color.dispose();
+ }
+ }
+
+ protected final void handlePropertyChangeEvent(PropertyChangeEvent event) {
+ String key = event.getProperty();
+
+ if (key.equals(INCOMING_COLOR) || key.equals(OUTGOING_COLOR) || key.equals(CONFLICTING_COLOR)
+ || key.equals(RESOLVED_COLOR)) {
+ updateColors();
+ }
+ }
+
+ private Color getColor(RGB rgb) {
+ if (rgb == null) {
+ return null;
+ }
+ Color c = fColors.getUnchecked(rgb);
+ return c;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.ICompareColor#getFillColor(org.eclipse.emf.compare.Diff,
+ * boolean, boolean, boolean)
+ */
+ public Color getFillColor(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
+ return getColor(getFillRGB(diff, isThreeWay, isIgnoreAncestor, selected));
+ }
+
+ private RGB getFillRGB(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
+ RGB selectedFill = getBackground();
+ if (isThreeWay && !isIgnoreAncestor) {
+ boolean requiredConflictForWayOfMerge = false;
+
+ if (diff.getConflict() == null && !requiredConflictForWayOfMerge) {
+ switch (diff.getSource()) {
+ case RIGHT:
+ if (fLeftIsLocal) {
+ return selected ? selectedFill : fIncomingFill;
+ }
+ return selected ? selectedFill : fOutgoingFill;
+ case LEFT:
+ if (fLeftIsLocal) {
+ return selected ? selectedFill : fOutgoingFill;
+ }
+ return selected ? selectedFill : fIncomingFill;
+ }
+ } else {
+ return selected ? selectedFill : fConflictFill;
+ }
+ return selected ? selectedFill : fConflictFill;
+ }
+ return selected ? selectedFill : fOutgoingFill;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.ICompareColor#getStrokeColor(org.eclipse.emf.compare.Diff,
+ * boolean, boolean, boolean)
+ */
+ public Color getStrokeColor(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
+ return getColor(getStrokeRGB(diff, isThreeWay, isIgnoreAncestor, selected));
+ }
+
+ private RGB getStrokeRGB(Diff diff, boolean isThreeWay, boolean isIgnoreAncestor, boolean selected) {
+ if (isThreeWay && !isIgnoreAncestor) {
+ boolean requiredConflictForWayOfMerge = false;
+
+ if (diff.getConflict() == null && !requiredConflictForWayOfMerge) {
+ switch (diff.getSource()) {
+ case RIGHT:
+ if (fLeftIsLocal) {
+ return selected ? fIncomingSelected : fIncoming;
+ }
+ return selected ? fOutgoingSelected : fOutgoing;
+ case LEFT:
+ if (fLeftIsLocal) {
+ return selected ? fOutgoingSelected : fOutgoing;
+ }
+ return selected ? fIncomingSelected : fIncoming;
+ }
+ } else {
+ return selected ? fConflictSelected : fConflict;
+ }
+ return selected ? fConflictSelected : fConflict;
+ }
+ return selected ? fOutgoingSelected : fOutgoing;
+ }
+
+ private RGB getBackground() {
+ return fDisplay.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB();
+ }
+
+ private void updateColors() {
+ ColorRegistry registry = JFaceResources.getColorRegistry();
+
+ RGB bg = getBackground();
+ fIncomingSelected = registry.getRGB(INCOMING_COLOR);
+ if (fIncomingSelected == null) {
+ fIncomingSelected = new RGB(0, 0, MAX_RGB_COMPONENT); // BLUE
+ }
+ fIncoming = interpolate(fIncomingSelected, bg, INTERPOLATION_SCALE_1);
+ fIncomingFill = interpolate(fIncomingSelected, bg, INTERPOLATION_SCALE_2);
+
+ fOutgoingSelected = registry.getRGB(OUTGOING_COLOR);
+ if (fOutgoingSelected == null) {
+ fOutgoingSelected = new RGB(0, 0, 0); // BLACK
+ }
+ fOutgoing = interpolate(fOutgoingSelected, bg, INTERPOLATION_SCALE_1);
+ fOutgoingFill = interpolate(fOutgoingSelected, bg, INTERPOLATION_SCALE_2);
+
+ fConflictSelected = registry.getRGB(CONFLICTING_COLOR);
+ if (fConflictSelected == null) {
+ fConflictSelected = new RGB(MAX_RGB_COMPONENT, 0, 0); // RED
+ }
+ fConflict = interpolate(fConflictSelected, bg, INTERPOLATION_SCALE_1);
+ fConflictFill = interpolate(fConflictSelected, bg, INTERPOLATION_SCALE_2);
+
+ fResolved = registry.getRGB(RESOLVED_COLOR);
+ if (fResolved == null) {
+ fResolved = new RGB(0, MAX_RGB_COMPONENT, 0); // GREEN
+ }
+ }
+
+ private static RGB interpolate(RGB fg, RGB bg, double scale) {
+ if (fg != null && bg != null) {
+ return new RGB((int)((1.0 - scale) * fg.red + scale * bg.red),
+ (int)((1.0 - scale) * fg.green + scale * bg.green), (int)((1.0 - scale) * fg.blue + scale
+ * bg.blue));
+ }
+ if (fg != null) {
+ return fg;
+ }
+ if (bg != null) {
+ return bg;
+ }
+ return new RGB(MED_RGB_COMPONENT, MED_RGB_COMPONENT, MED_RGB_COMPONENT); // a gray
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.ICompareColor#dispose()
+ */
+ public void dispose() {
+ fColors.invalidateAll();
+ fPreferenceStore.removePropertyChangeListener(fPreferenceChangeListener);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/MergeViewerInfoViewer.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/MergeViewerInfoViewer.java
index ebd4bfbf1..c131743ac 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/MergeViewerInfoViewer.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/MergeViewerInfoViewer.java
@@ -169,7 +169,7 @@ public class MergeViewerInfoViewer extends ContentViewer {
if (getLabelProvider() instanceof ILabelProvider) {
ILabelProvider labelProvider = (ILabelProvider)getLabelProvider();
- fFeatureLabel.setText("resource contents"); //$NON-NLS-1$
+ fFeatureLabel.setText("resource contents");
fEObjectIcon.setImage(labelProvider.getImage(resource));
fEObjectLabel.setText(labelProvider.getText(resource));
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/TableMergeViewer.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/TableMergeViewer.java
index 0b3cdaa94..061aada39 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/TableMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/mergeviewer/TableMergeViewer.java
@@ -153,7 +153,8 @@ public class TableMergeViewer extends StructuredMergeViewer {
private void paintItemDiffBox(Event event, Diff diff, Rectangle bounds) {
event.detail &= ~SWT.HOT;
- if (diff.getState() == DifferenceState.DISCARDED || diff.getState() == DifferenceState.MERGED) {
+ if (diff != null
+ && (diff.getState() == DifferenceState.DISCARDED || diff.getState() == DifferenceState.MERGED)) {
return;
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterAction.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterAction.java
index 4cb6e0f30..39b6d26d1 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterAction.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterAction.java
@@ -45,7 +45,8 @@ public class FilterAction extends Action {
* @param filter
* The filter associated with this action.
*/
- public FilterAction(String text, StructureMergeViewerFilter structureMergeViewerFilter, IDifferenceFilter filter) {
+ public FilterAction(String text, StructureMergeViewerFilter structureMergeViewerFilter,
+ IDifferenceFilter filter) {
super(text, IAction.AS_CHECK_BOX);
this.structureMergeViewerFilter = structureMergeViewerFilter;
this.filter = filter;
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterActionMenu.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterActionMenu.java
index 3e83bfd58..b41141279 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterActionMenu.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/FilterActionMenu.java
@@ -49,7 +49,7 @@ public class FilterActionMenu extends Action implements IMenuCreator {
this.menuManager = menuManager;
this.structureMergeViewerFilter = structureMergeViewerFilter;
setMenuCreator(this);
- setToolTipText("Filters"); //$NON-NLS-1$
+ setToolTipText("Filters");
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(EMFCompareRCPUIPlugin.PLUGIN_ID,
"icons/full/toolb16/filter.gif")); //$NON-NLS-1$
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/GroupActionMenu.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/GroupActionMenu.java
index 90dc19827..0227bdd77 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/GroupActionMenu.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/actions/GroupActionMenu.java
@@ -56,7 +56,7 @@ public class GroupActionMenu extends Action implements IMenuCreator {
this.menuManager = menuManager;
this.structureMergeViewerGrouper = structureMergeViewerGrouper;
this.defaultGroupProvider = defaultGroupProvider;
- setToolTipText("Groups"); //$NON-NLS-1$
+ setToolTipText("Groups");
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(EMFCompareRCPUIPlugin.PLUGIN_ID,
"icons/full/toolb16/group.gif")); //$NON-NLS-1$
setMenuCreator(this);
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/AddedElementsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/AbstractDifferenceFilter.java
index b8c8995fc..d9679edf4 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/AddedElementsFilter.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/AbstractDifferenceFilter.java
@@ -1,48 +1,47 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
-
import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.EObject;
/**
- * A filter used by default that filtered out added elements.
+ * An abstract filter implementation.
*
* @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
* @since 3.0
*/
-public class AddedElementsFilter implements IDifferenceFilter {
+public abstract class AbstractDifferenceFilter implements IDifferenceFilter {
/** A human-readable label for this filter. This will be displayed in the EMF Compare UI. */
- private String label;
+ protected String label;
/** The initial activation state of the filter. */
- private boolean activeByDefault;
-
- /** The predicate activate through this filter. */
- private Predicate<? super EObject> predicate;
+ protected boolean activeByDefault;
/**
* Constructs the filter with the appropriate predicate.
*/
- public AddedElementsFilter() {
+ public AbstractDifferenceFilter() {
super();
- setPredicate();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
+ */
+ public abstract Predicate<? super EObject> getPredicateWhenSelected();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenUnselected()
+ */
+ public Predicate<? super EObject> getPredicateWhenUnselected() {
+ return Predicates.alwaysFalse();
}
/**
@@ -91,24 +90,4 @@ public class AddedElementsFilter implements IDifferenceFilter {
return true;
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicate()
- */
- public Predicate<? super EObject> getPredicate() {
- return predicate;
- }
-
- /**
- * Set the predicate that will be activate through this filter.
- */
- private void setPredicate() {
- final Predicate<? super EObject> actualPredicate = new Predicate<EObject>() {
- public boolean apply(EObject input) {
- return input instanceof Diff && ofKind(DifferenceKind.ADD).apply((Diff)input);
- }
- };
- predicate = actualPredicate;
- }
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/ChangedElementsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/ChangedElementsFilter.java
deleted file mode 100644
index dfa072d6a..000000000
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/ChangedElementsFilter.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
-
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
-
-import com.google.common.base.Predicate;
-
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.scope.IComparisonScope;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * A filter used by default that filtered out changed elements.
- *
- * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
- * @since 3.0
- */
-public class ChangedElementsFilter implements IDifferenceFilter {
-
- /** A human-readable label for this filter. This will be displayed in the EMF Compare UI. */
- private String label;
-
- /** The initial activation state of the filter. */
- private boolean activeByDefault;
-
- /** The Predicate activate through this action. */
- private Predicate<? super EObject> predicate;
-
- /**
- * Constructs the filter with the appropriate predicate.
- */
- public ChangedElementsFilter() {
- super();
- setPredicate();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getLabel()
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setLabel(java.lang.String)
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#defaultSelected()
- */
- public boolean defaultSelected() {
- return activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setDefaultSelected(boolean)
- */
- public void setDefaultSelected(boolean activeByDefault) {
- this.activeByDefault = activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
- * org.eclipse.emf.compare.Comparison)
- */
- public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
- return true;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicate()
- */
- public Predicate<? super EObject> getPredicate() {
- return predicate;
- }
-
- /**
- * Set the predicate that will be activate through this filter.
- */
- private void setPredicate() {
- final Predicate<? super EObject> actualPredicate = new Predicate<EObject>() {
- public boolean apply(EObject input) {
- return input instanceof Diff && ofKind(DifferenceKind.CHANGE).apply((Diff)input);
- }
- };
- predicate = actualPredicate;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java
index 355242e52..0fd965382 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/EmptyMatchedResourcesFilter.java
@@ -16,11 +16,9 @@ import static com.google.common.collect.Iterables.isEmpty;
import com.google.common.base.Predicate;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.MatchResource;
import org.eclipse.emf.compare.ResourceAttachmentChange;
-import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.EObject;
/**
@@ -29,107 +27,42 @@ import org.eclipse.emf.ecore.EObject;
* @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
* @since 3.0
*/
-public class EmptyMatchedResourcesFilter implements IDifferenceFilter {
-
- /** A human-readable label for this filter. This will be displayed in the EMF Compare UI. */
- private String label;
-
- /** The initial activation state of the filter. */
- private boolean activeByDefault;
-
- /** The Predicate activate through this action. */
- private Predicate<? super EObject> predicate;
-
- /**
- * Constructs the filter with the appropriate predicate.
- */
- public EmptyMatchedResourcesFilter() {
- super();
- setPredicate();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getLabel()
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setLabel(java.lang.String)
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#defaultSelected()
- */
- public boolean defaultSelected() {
- return activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setDefaultSelected(boolean)
- */
- public void setDefaultSelected(boolean activeByDefault) {
- this.activeByDefault = activeByDefault;
- }
+public class EmptyMatchedResourcesFilter extends AbstractDifferenceFilter {
/**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
- * org.eclipse.emf.compare.Comparison)
+ * The predicate use by this filter when it is selected.
*/
- public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
- return true;
- }
+ private static final Predicate<? super EObject> predicateWhenSelected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ if (input instanceof MatchResource) {
+ EList<Diff> differences = ((MatchResource)input).getComparison().getDifferences();
+ Iterable<ResourceAttachmentChange> resourceAttachmentchanges = filter(differences,
+ ResourceAttachmentChange.class);
+ if (!isEmpty(resourceAttachmentchanges)) {
+ for (ResourceAttachmentChange rac : resourceAttachmentchanges) {
+ final String diffResourceURI = rac.getResourceURI();
+ if (!diffResourceURI.equals(((MatchResource)input).getLeftURI())
+ && !diffResourceURI.equals(((MatchResource)input).getRightURI())
+ && !diffResourceURI.equals(((MatchResource)input).getOriginURI())) {
+ return true;
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+ return false;
+ }
+ };
/**
* {@inheritDoc}
*
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicate()
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
*/
- public Predicate<? super EObject> getPredicate() {
- return predicate;
- }
-
- /**
- * Set the predicate that will be activate through this filter.
- */
- private void setPredicate() {
- final Predicate<? super EObject> actualPredicate = new Predicate<EObject>() {
- public boolean apply(EObject input) {
- if (input instanceof MatchResource) {
- EList<Diff> differences = ((MatchResource)input).getComparison().getDifferences();
- Iterable<ResourceAttachmentChange> resourceAttachmentchanges = filter(differences,
- ResourceAttachmentChange.class);
- if (!isEmpty(resourceAttachmentchanges)) {
- for (ResourceAttachmentChange rac : resourceAttachmentchanges) {
- final String diffResourceURI = rac.getResourceURI();
- if (!diffResourceURI.equals(((MatchResource)input).getLeftURI())
- && !diffResourceURI.equals(((MatchResource)input).getRightURI())
- && !diffResourceURI.equals(((MatchResource)input).getOriginURI())) {
- return true;
- }
- }
- } else {
- return true;
- }
- }
- return false;
- }
- };
- predicate = actualPredicate;
+ @Override
+ public Predicate<? super EObject> getPredicateWhenSelected() {
+ return predicateWhenSelected;
}
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IDifferenceFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IDifferenceFilter.java
index 496e94b7a..8658a707d 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IDifferenceFilter.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IDifferenceFilter.java
@@ -35,11 +35,22 @@ import org.eclipse.emf.ecore.EObject;
public interface IDifferenceFilter {
/**
- * The predicate that will filter out objects in the structural differences view.
+ * Returns the predicate that will filter out objects in the structural differences view when this filter
+ * will be selected.
*
- * @return The predicate that will filter out objects in the structural differences view.
+ * @return the predicate that will filter out objects in the structural differences view when this filter
+ * will be selected.
*/
- Predicate<? super EObject> getPredicate();
+ Predicate<? super EObject> getPredicateWhenSelected();
+
+ /**
+ * Returns the predicate that will filter out objects in the structural differences view when this filter
+ * will be unselected.
+ *
+ * @return the predicate that will filter out objects in the structural differences view when this filter
+ * will be unselected.
+ */
+ Predicate<? super EObject> getPredicateWhenUnselected();
/**
* A human-readable label for this filter. This will be displayed in the EMF Compare UI.
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IdenticalElementsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IdenticalElementsFilter.java
new file mode 100644
index 000000000..44e23e834
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/IdenticalElementsFilter.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.provider.spec.MatchItemProviderSpec;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A filter used by default that filtered out identical elements.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
+ */
+public class IdenticalElementsFilter extends AbstractDifferenceFilter {
+
+ /**
+ * The predicate use by this filter when it is selected.
+ */
+ private static final Predicate<? super EObject> predicateWhenSelected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ if (input instanceof Match) {
+ Match match = (Match)input;
+ Iterator<Adapter> adapters = match.eAdapters().iterator();
+ while (adapters.hasNext()) {
+ Adapter adapter = adapters.next();
+ if (adapter instanceof MatchItemProviderSpec) {
+ MatchItemProviderSpec matchItem = (MatchItemProviderSpec)adapter;
+ return Iterables.isEmpty(matchItem.getFilteredChildren((match)));
+ }
+ }
+ return Iterables.isEmpty(match.getAllDifferences());
+ }
+ return false;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
+ */
+ @Override
+ public Predicate<? super EObject> getPredicateWhenSelected() {
+ return predicateWhenSelected;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MovedElementsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MovedElementsFilter.java
deleted file mode 100644
index ad9eed0ae..000000000
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/MovedElementsFilter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
-
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
-
-import com.google.common.base.Predicate;
-
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.scope.IComparisonScope;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * A filter used by default that filtered out moved elements.
- *
- * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
- * @since 3.0
- */
-public class MovedElementsFilter implements IDifferenceFilter {
-
- /** A human-readable label for this filter. This will be displayed in the EMF Compare UI. */
- private String label;
-
- /** The initial activation state of the filter. */
- private boolean activeByDefault;
-
- /** The Predicate activate through this action. */
- private Predicate<? super EObject> predicate;
-
- /**
- * Constructs the filter with the appropriate predicate.
- */
- public MovedElementsFilter() {
- super();
- setPredicate();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getLabel()
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setLabel(java.lang.String)
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#defaultSelected()
- */
- public boolean defaultSelected() {
- return activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setDefaultSelected(boolean)
- */
- public void setDefaultSelected(boolean activeByDefault) {
- this.activeByDefault = activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
- * org.eclipse.emf.compare.Comparison)
- */
- public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
- return true;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicate()
- */
- public Predicate<? super EObject> getPredicate() {
- return predicate;
- }
-
- /**
- * Set the predicate that will be activate through this filter.
- */
- private void setPredicate() {
- final Predicate<? super EObject> actualPredicate = new Predicate<EObject>() {
- public boolean apply(EObject input) {
- return input instanceof Diff && ofKind(DifferenceKind.MOVE).apply((Diff)input);
- }
- };
- predicate = actualPredicate;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoConflictsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoConflictsFilter.java
new file mode 100644
index 000000000..47d3dcc9a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoConflictsFilter.java
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
+
+import com.google.common.base.Predicate;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.ConflictKind;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A filter used by default that filtered out pseudo conflicts differences.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
+ */
+public class PseudoConflictsFilter extends AbstractDifferenceFilter {
+
+ /**
+ * The predicate use by this filter when it is selected.
+ */
+ private static final Predicate<? super EObject> predicateWhenSelected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ boolean ret = false;
+ if (input instanceof Diff) {
+ Diff diff = (Diff)input;
+ Conflict conflict = diff.getConflict();
+ if (conflict != null && conflict.getKind() == ConflictKind.PSEUDO) {
+ ret = true;
+ }
+ }
+ return ret;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
+ * org.eclipse.emf.compare.Comparison)
+ */
+ @Override
+ public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
+ if (comparison != null && comparison.isThreeWay()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
+ */
+ @Override
+ public Predicate<? super EObject> getPredicateWhenSelected() {
+ return predicateWhenSelected;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoDeleteConflictsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoDeleteConflictsFilter.java
new file mode 100644
index 000000000..b673de658
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/PseudoDeleteConflictsFilter.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
+
+import static com.google.common.collect.Iterables.filter;
+
+import com.google.common.base.Predicate;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+
+/**
+ * A filter used by default that filtered out pseudo delete conflicts differences.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
+ */
+public class PseudoDeleteConflictsFilter extends AbstractDifferenceFilter {
+
+ /**
+ * The predicate use by this filter when it is selected.
+ */
+ private static final Predicate<? super EObject> predicateWhenSelected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ boolean ret = false;
+ if (input instanceof ReferenceChange) {
+ ReferenceChange referenceChange = (ReferenceChange)input;
+ Conflict conflict = referenceChange.getConflict();
+ if (conflict != null) {
+ EReference eReference = referenceChange.getReference();
+ EObject value = referenceChange.getValue();
+ Iterable<ReferenceChange> conflictualReferenceChanges = filter(conflict.getDifferences(),
+ ReferenceChange.class);
+ for (ReferenceChange conflictualReferenceChange : conflictualReferenceChanges) {
+ if (conflictualReferenceChange != referenceChange
+ && conflictualReferenceChange.getReference() == eReference
+ && conflictualReferenceChange.getValue() == value) {
+ ret = true;
+ }
+ }
+ }
+ }
+ return ret;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
+ * org.eclipse.emf.compare.Comparison)
+ */
+ @Override
+ public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
+ if (comparison != null && comparison.isThreeWay()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
+ */
+ @Override
+ public Predicate<? super EObject> getPredicateWhenSelected() {
+ return predicateWhenSelected;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/RemovedElementsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/RemovedElementsFilter.java
deleted file mode 100644
index 2bf51be43..000000000
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/RemovedElementsFilter.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
-
-import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
-
-import com.google.common.base.Predicate;
-
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.DifferenceKind;
-import org.eclipse.emf.compare.scope.IComparisonScope;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * A filter used by default that filtered out removed elements.
- *
- * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
- * @since 3.0
- */
-public class RemovedElementsFilter implements IDifferenceFilter {
-
- /** A human-readable label for this filter. This will be displayed in the EMF Compare UI. */
- private String label;
-
- /** The initial activation state of the filter. */
- private boolean activeByDefault;
-
- /** The Predicate activate through this action. */
- private Predicate<? super EObject> predicate;
-
- /**
- * Constructs the filter with the appropriate predicate.
- */
- public RemovedElementsFilter() {
- super();
- setPredicate();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getLabel()
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setLabel(java.lang.String)
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#defaultSelected()
- */
- public boolean defaultSelected() {
- return activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#setDefaultSelected(boolean)
- */
- public void setDefaultSelected(boolean activeByDefault) {
- this.activeByDefault = activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
- * org.eclipse.emf.compare.Comparison)
- */
- public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
- return true;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicate()
- */
- public Predicate<? super EObject> getPredicate() {
- return predicate;
- }
-
- /**
- * Set the predicate that will be activate through this filter.
- */
- private void setPredicate() {
- final Predicate<? super EObject> actualPredicate = new Predicate<EObject>() {
- public boolean apply(EObject input) {
- return input instanceof Diff && ofKind(DifferenceKind.DELETE).apply((Diff)input);
- }
- };
- predicate = actualPredicate;
- }
-
-}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java
index e9b530f27..e77026141 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/StructureMergeViewerFilter.java
@@ -14,6 +14,7 @@ import static com.google.common.base.Predicates.not;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
@@ -80,13 +81,13 @@ public class StructureMergeViewerFilter extends ViewerFilter {
*/
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (predicates.isEmpty()) {
+ if (getPredicates().isEmpty()) {
return true;
}
boolean result = false;
- final Predicate<? super EObject> predicate = Predicates.or(predicates);
+ final Predicate<? super EObject> predicate = Predicates.or(getPredicates());
- if (predicates.isEmpty()) {
+ if (getPredicates().isEmpty()) {
result = true;
} else if (element instanceof Adapter) {
Notifier notifier = ((Adapter)element).getTarget();
@@ -94,8 +95,12 @@ public class StructureMergeViewerFilter extends ViewerFilter {
final Diff diff = (Diff)notifier;
result = !predicate.apply(diff);
} else if (notifier instanceof Match) {
- final Iterator<Diff> differences = ((Match)notifier).getAllDifferences().iterator();
- result = Iterators.any(differences, not(predicate));
+ final Match match = (Match)notifier;
+ result = !predicate.apply(match);
+ if (result && !Iterables.isEmpty(match.getAllDifferences())) {
+ final Iterator<Diff> differences = match.getAllDifferences().iterator();
+ return Iterators.any(differences, not(predicate));
+ }
} else if (notifier instanceof MatchResource) {
final MatchResource matchResource = (MatchResource)notifier;
result = !predicate.apply(matchResource);
@@ -123,7 +128,8 @@ public class StructureMergeViewerFilter extends ViewerFilter {
* The given {@link IDifferenceFilter}.
*/
public void addFilter(IDifferenceFilter filter) {
- addPredicate(filter.getPredicate());
+ getPredicates().remove(filter.getPredicateWhenUnselected());
+ addPredicate(filter.getPredicateWhenSelected());
eventBus.post(new IDifferenceFilterSelectionChangeEvent.DefaultFilterSelectionChangeEvent(filter,
Action.ADD));
}
@@ -135,7 +141,8 @@ public class StructureMergeViewerFilter extends ViewerFilter {
* The given {@link IDifferenceFilter}.
*/
public void removeFilter(IDifferenceFilter filter) {
- removePredicate(filter.getPredicate());
+ getPredicates().add(filter.getPredicateWhenUnselected());
+ removePredicate(filter.getPredicateWhenSelected());
eventBus.post(new IDifferenceFilterSelectionChangeEvent.DefaultFilterSelectionChangeEvent(filter,
Action.REMOVE));
}
@@ -148,7 +155,7 @@ public class StructureMergeViewerFilter extends ViewerFilter {
* accepted.
*/
public void addPredicate(Predicate<? super EObject> predicate) {
- final boolean changed = predicates.add(predicate);
+ final boolean changed = getPredicates().add(predicate);
if (changed) {
refreshViewers();
}
@@ -162,7 +169,7 @@ public class StructureMergeViewerFilter extends ViewerFilter {
* of the accepted ones.
*/
public void removePredicate(Predicate<? super EObject> predicate) {
- final boolean changed = predicates.remove(predicate);
+ final boolean changed = getPredicates().remove(predicate);
if (changed) {
refreshViewers();
}
@@ -211,4 +218,13 @@ public class StructureMergeViewerFilter extends ViewerFilter {
viewers.remove(viewer);
}
+ /**
+ * Get the predicates associated with this viewer.
+ *
+ * @return the predicates
+ */
+ public Set<Predicate<? super EObject>> getPredicates() {
+ return predicates;
+ }
+
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/SubDiffElementsFilter.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/SubDiffElementsFilter.java
new file mode 100644
index 000000000..4dd539903
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/filters/SubDiffElementsFilter.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableSet;
+
+import org.eclipse.emf.compare.Conflict;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.provider.spec.MatchItemProviderSpec;
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * A filter used by default that filtered out sub differences.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
+ */
+public class SubDiffElementsFilter extends AbstractDifferenceFilter {
+
+ /**
+ * The predicate use by this filter when it is selected.
+ */
+ private static final Predicate<? super EObject> predicateWhenSelected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ boolean ret = false;
+ if (input instanceof Diff) {
+ final Diff diff = (Diff)input;
+ final Conflict conflict = diff.getConflict();
+ if (conflict == null) {
+ final EObject grandParent = diff.getMatch().eContainer();
+ if (grandParent instanceof Match) {
+ ImmutableSet<EObject> containementDifferenceValues = MatchItemProviderSpec
+ .containmentReferencesValues((Match)grandParent);
+ if (MatchItemProviderSpec.matchOfContainmentDiff(containementDifferenceValues).apply(
+ diff.getMatch())) {
+ ret = true;
+ }
+ }
+ }
+ }
+ return ret;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
+ */
+ @Override
+ public Predicate<? super EObject> getPredicateWhenSelected() {
+ return predicateWhenSelected;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultDifferenceGroup.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultDifferenceGroup.java
index 1a98680d4..0c063d024 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultDifferenceGroup.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultDifferenceGroup.java
@@ -15,6 +15,10 @@ import com.google.common.collect.Iterables;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceState;
+import org.eclipse.emf.compare.provider.utils.ComposedStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString;
+import org.eclipse.emf.compare.provider.utils.IStyledString.Style;
import org.eclipse.swt.graphics.Image;
/**
@@ -43,6 +47,15 @@ public class DefaultDifferenceGroup implements DifferenceGroup {
protected final Comparison comparison;
/**
+ * A predicate to know if the given {@link Diff} is in an UNRESOLVED state.
+ */
+ private static final Predicate<Diff> unresolved = new Predicate<Diff>() {
+ public boolean apply(Diff input) {
+ return DifferenceState.UNRESOLVED == input.getState();
+ }
+ };
+
+ /**
* Instantiates this group given the comparison and filter that should be used in order to determine its
* list of differences.
* <p>
@@ -58,7 +71,7 @@ public class DefaultDifferenceGroup implements DifferenceGroup {
*/
public DefaultDifferenceGroup(Comparison comparison, Iterable<? extends Diff> unfiltered,
Predicate<? super Diff> filter) {
- this(comparison, unfiltered, filter, "Group", null); //$NON-NLS-1$
+ this(comparison, unfiltered, filter, "Group", null);
}
/**
@@ -129,6 +142,22 @@ public class DefaultDifferenceGroup implements DifferenceGroup {
/**
* {@inheritDoc}
*
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.DifferenceGroup#getStyledName()
+ */
+ public IStyledString.IComposedStyledString getStyledName() {
+ final IStyledString.IComposedStyledString ret = new ComposedStyledString(getName());
+ int unresolvedDiffs = Iterables.size(Iterables.filter(getDifferences(), unresolved));
+ ret.append(" [" + unresolvedDiffs + " unresolved difference", Style.DECORATIONS_STYLER);
+ if (unresolvedDiffs > 1) {
+ ret.append("s", Style.DECORATIONS_STYLER);
+ }
+ ret.append("]", Style.DECORATIONS_STYLER);
+ return ret;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.DifferenceGroup#getImage()
*/
public Image getImage() {
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultGroupProvider.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultGroupProvider.java
index 17a996008..d2636cc2d 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultGroupProvider.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DefaultGroupProvider.java
@@ -39,7 +39,7 @@ public class DefaultGroupProvider implements IDifferenceGroupProvider {
* @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#getLabel()
*/
public String getLabel() {
- return "Default"; //$NON-NLS-1$
+ return "Default";
}
/**
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DifferenceGroup.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DifferenceGroup.java
index e265e7a53..2207c937b 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DifferenceGroup.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/DifferenceGroup.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.provider.utils.IStyledString;
import org.eclipse.swt.graphics.Image;
/**
@@ -38,13 +39,20 @@ public interface DifferenceGroup {
Comparison getComparison();
/**
- * A human-readable label for this group. This will be displayed in the EMF Compare UI.
+ * A human-readable label for this group.
*
* @return A human-readable label for this group that can be displayed to the user.
*/
String getName();
/**
+ * The styled label for the this group. This will be displayed in the EMF Compare UI.
+ *
+ * @return A human-readable styled label for this group that can be displayed to the user.
+ */
+ IStyledString.IComposedStyledString getStyledName();
+
+ /**
* The icon that is to be used for this group in the compare UI.
*
* @return Icon that is to be used for this group in the compare UI. If {@code null}, a default image will
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/KindGroupProvider.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/KindGroupProvider.java
index 1ad46144f..4b3e74b0b 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/KindGroupProvider.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/KindGroupProvider.java
@@ -45,13 +45,13 @@ public class KindGroupProvider implements IDifferenceGroupProvider {
final List<Diff> diffs = comparison.getDifferences();
final DifferenceGroup additions = new DefaultDifferenceGroup(comparison, diffs,
- ofKind(DifferenceKind.ADD), "Additions"); //$NON-NLS-1$
+ ofKind(DifferenceKind.ADD), "Additions");
final DifferenceGroup deletions = new DefaultDifferenceGroup(comparison, diffs,
- ofKind(DifferenceKind.DELETE), "Deletions"); //$NON-NLS-1$
+ ofKind(DifferenceKind.DELETE), "Deletions");
final DifferenceGroup changes = new DefaultDifferenceGroup(comparison, diffs,
- ofKind(DifferenceKind.CHANGE), "Changes"); //$NON-NLS-1$
+ ofKind(DifferenceKind.CHANGE), "Changes");
final DifferenceGroup moves = new DefaultDifferenceGroup(comparison, diffs,
- ofKind(DifferenceKind.MOVE), "Moves"); //$NON-NLS-1$
+ ofKind(DifferenceKind.MOVE), "Moves");
return ImmutableList.of(additions, deletions, changes, moves);
}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/MetamodelGroupProvider.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/MetamodelGroupProvider.java
deleted file mode 100644
index 3c61cc0a7..000000000
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/MetamodelGroupProvider.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012, 2013 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups;
-
-import static com.google.common.base.Predicates.alwaysTrue;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.emf.compare.AttributeChange;
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.scope.IComparisonScope;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * This implementation of a {@link IDifferenceGroupProvider} will be used to group the differences by their
- * metamodel element : all diffs that apply to a Class, all diffs that apply on a reference...
- *
- * @author <a href="mailto:laurent.goubet@obeo.fr">Laurent Goubet</a>
- * @since 3.0
- */
-public class MetamodelGroupProvider implements IDifferenceGroupProvider {
-
- /** A human-readable label for this group provider. This will be displayed in the EMF Compare UI. */
- private String label;
-
- /** The initial activation state of the group provider. */
- private boolean activeByDefault;
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#getGroups(org.eclipse.emf.compare.Comparison)
- */
- public Iterable<? extends DifferenceGroup> getGroups(Comparison comparison) {
- final List<Diff> diffs = comparison.getDifferences();
-
- final Map<EClass, List<Diff>> diffByEClass = Maps.newLinkedHashMap();
- for (Diff candidate : diffs) {
- final EClass target;
- if (candidate instanceof ReferenceChange) {
- if (((ReferenceChange)candidate).getReference().isContainment()) {
- final EObject parentMatch = candidate.getMatch().eContainer();
- if (parentMatch instanceof Match) {
- target = findEClass((Match)parentMatch);
- } else {
- target = findEClass(candidate.getMatch());
- }
- } else {
- target = findEClass(candidate.getMatch());
- }
- } else if (candidate instanceof AttributeChange) {
- target = findEClass(candidate.getMatch());
- } else {
- // Ignore this possibility for now.
- continue;
- }
-
- List<Diff> diffsForEClass = diffByEClass.get(target);
- if (diffsForEClass == null) {
- diffsForEClass = Lists.newArrayList();
- diffByEClass.put(target, diffsForEClass);
- }
- diffsForEClass.add(candidate);
- }
-
- final List<DifferenceGroup> groups = Lists.newArrayList();
- for (Map.Entry<EClass, List<Diff>> entry : diffByEClass.entrySet()) {
- groups.add(new DefaultDifferenceGroup(comparison, entry.getValue(), alwaysTrue(), entry.getKey()
- .getName()));
- }
-
- return groups;
- }
-
- /**
- * Returns the appropriate {@link EClass} associated with the given {@link Match}.
- *
- * @param match
- * The given {@link Match}.
- * @return the appropriate {@link EClass} associated with the given {@link Match}.
- */
- private EClass findEClass(Match match) {
- final EClass eClass;
- if (match.getOrigin() != null) {
- eClass = match.getOrigin().eClass();
- } else if (match.getRight() != null) {
- eClass = match.getRight().eClass();
- } else {
- /*
- * All three sides null means that something went awry. Might as well throw the exception from
- * here.
- */
- eClass = match.getLeft().eClass();
- }
- return eClass;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#getLabel()
- */
- public String getLabel() {
- return label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#setLabel(java.lang.String)
- */
- public void setLabel(String label) {
- this.label = label;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#defaultSelected()
- */
- public boolean defaultSelected() {
- return activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#setDefaultSelected(boolean)
- */
- public void setDefaultSelected(boolean activeByDefault) {
- this.activeByDefault = activeByDefault;
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#isEnabled(org
- * .eclipse.emf.compare.scope.IComparisonScope, org.eclipse.emf.compare.Comparison)
- */
- public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
- return true;
- }
-}
diff --git a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/ThreeWayComparisonGroupProvider.java b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/ThreeWayComparisonGroupProvider.java
index 6e1f8ec42..9ebf5dddb 100644
--- a/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/ThreeWayComparisonGroupProvider.java
+++ b/plugins/org.eclipse.emf.compare.rcp.ui/src/org/eclipse/emf/compare/rcp/ui/structuremergeviewer/groups/ThreeWayComparisonGroupProvider.java
@@ -48,12 +48,12 @@ public class ThreeWayComparisonGroupProvider implements IDifferenceGroupProvider
final List<Diff> diffs = comparison.getDifferences();
final DifferenceGroup leftSide = new DefaultDifferenceGroup(comparison, diffs, Predicates.and(
- fromSide(DifferenceSource.LEFT), Predicates.not(hasConflict(ConflictKind.REAL))), "Left side"); //$NON-NLS-1$
+ fromSide(DifferenceSource.LEFT), Predicates.not(hasConflict(ConflictKind.REAL))), "Left side");
final DifferenceGroup rightSide = new DefaultDifferenceGroup(comparison, diffs, Predicates.and(
fromSide(DifferenceSource.RIGHT), Predicates.not(hasConflict(ConflictKind.REAL))),
- "Right side"); //$NON-NLS-1$
+ "Right side");
final DifferenceGroup conflicts = new DefaultDifferenceGroup(comparison, diffs,
- hasConflict(ConflictKind.REAL), "Conflicts"); //$NON-NLS-1$
+ hasConflict(ConflictKind.REAL), "Conflicts");
return ImmutableList.of(leftSide, rightSide, conflicts);
}
@@ -90,8 +90,8 @@ public class ThreeWayComparisonGroupProvider implements IDifferenceGroupProvider
*
* @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#setDefaultSelected(boolean)
*/
- public void setDefaultSelected(boolean activeByDefault) {
- this.activeByDefault = activeByDefault;
+ public void setDefaultSelected(boolean active) {
+ this.activeByDefault = active;
}
/**
diff --git a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
index 9876c270b..1399506f8 100644
--- a/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.tests/META-INF/MANIFEST.MF
@@ -25,7 +25,7 @@ Export-Package: org.eclipse.emf.compare.tests.framework,
org.eclipse.emf.compare.tests.nodes.impl,
org.eclipse.emf.compare.tests.nodes.util,
org.eclipse.emf.compare.tests.suite
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.cache;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.cache;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)"
Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/AbstractTestCompareItemProviderAdapter.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/AbstractTestCompareItemProviderAdapter.java
index 5addcdf05..fcc6d1eec 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/AbstractTestCompareItemProviderAdapter.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/AbstractTestCompareItemProviderAdapter.java
@@ -1,124 +1,124 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.tests.edit;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.find;
-import static com.google.common.collect.Lists.newArrayList;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Predicate;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.EMFCompare;
-import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.compare.provider.CompareItemProviderAdapterFactory;
-import org.eclipse.emf.compare.provider.spec.CompareItemProviderAdapterFactorySpec;
-import org.eclipse.emf.compare.scope.IComparisonScope;
-import org.eclipse.emf.compare.tests.edit.data.ResourceScopeProvider;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
-import org.junit.Before;
-
-/**
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class AbstractTestCompareItemProviderAdapter {
-
- protected CompareItemProviderAdapterFactory compareItemProviderAdapterFactory;
-
- @Before
- public void before() throws IOException {
- compareItemProviderAdapterFactory = new CompareItemProviderAdapterFactorySpec();
- }
-
- /**
- * @return the comparison
- * @throws IOException
- */
- protected static Comparison getComparison(ResourceScopeProvider scopeProvider) throws IOException {
- IComparisonScope scope = EMFCompare.createDefaultScope(scopeProvider.getLeft(), scopeProvider
- .getRight(), scopeProvider.getOrigin());
- return EMFCompare.builder().build().compare(scope);
- }
-
- protected Match getMatchWithFeatureValue(Collection<?> c, final String featureName, final Object value) {
- Iterable<Match> matches = filter(c, Match.class);
- Predicate<Match> predicate = hasFeatureValue(featureName, value);
- return find(matches, predicate);
- }
-
- protected ReferenceChange getReferenceChangeWithFeatureValue(Collection<?> c, final String featureName,
- final Object value) {
- Iterable<ReferenceChange> matches = filter(c, ReferenceChange.class);
- Predicate<ReferenceChange> predicate = new Predicate<ReferenceChange>() {
- public boolean apply(ReferenceChange referenceChange) {
- EObject referenceChangeValue = referenceChange.getValue();
- if (referenceChangeValue != null) {
- return Objects.equal(eGet(referenceChangeValue, featureName), value);
- }
- return false;
- }
- };
- return find(matches, predicate);
- }
-
- protected Predicate<Match> hasFeatureValue(final String featureName, final Object value) {
- Predicate<Match> predicate = new Predicate<Match>() {
- public boolean apply(Match match) {
- final boolean ret;
- final EObject left = match.getLeft();
- final EObject right = match.getRight();
- final EObject origin = match.getOrigin();
- if (left != null) {
- ret = Objects.equal(value, eGet(left, featureName));
- } else if (right != null) {
- ret = Objects.equal(value, eGet(right, featureName));
- } else if (origin != null) {
- ret = Objects.equal(value, eGet(origin, featureName));
- } else {
- ret = false;
- }
- return ret;
- }
- };
- return predicate;
- }
-
- protected Object eGet(EObject eObject, String featureName) {
- EStructuralFeature eStructuralFeature = eObject.eClass().getEStructuralFeature(featureName);
- return eObject.eGet(eStructuralFeature);
- }
-
- protected List<Notifier> eAllChildren(Notifier notifier) {
- List<Notifier> ret = newArrayList();
- ITreeItemContentProvider contentProvider = adaptAsITreItemContentProvider(notifier);
- Iterable<Notifier> children = filter(contentProvider.getChildren(notifier), Notifier.class);
- for (Notifier child : children) {
- ret.add(child);
- ret.addAll(eAllChildren(child));
- }
- return ret;
- }
-
- protected ITreeItemContentProvider adaptAsITreItemContentProvider(Notifier notifier) {
- ITreeItemContentProvider contentProvider = (ITreeItemContentProvider)compareItemProviderAdapterFactory
- .adapt(notifier, ITreeItemContentProvider.class);
- return contentProvider;
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.tests.edit;
+
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.find;
+import static com.google.common.collect.Lists.newArrayList;
+
+import com.google.common.base.Objects;
+import com.google.common.base.Predicate;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.EMFCompare;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.compare.provider.CompareItemProviderAdapterFactory;
+import org.eclipse.emf.compare.provider.spec.CompareItemProviderAdapterFactorySpec;
+import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.compare.tests.edit.data.ResourceScopeProvider;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.junit.Before;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class AbstractTestCompareItemProviderAdapter {
+
+ protected CompareItemProviderAdapterFactory compareItemProviderAdapterFactory;
+
+ @Before
+ public void before() throws IOException {
+ compareItemProviderAdapterFactory = new CompareItemProviderAdapterFactorySpec();
+ }
+
+ /**
+ * @return the comparison
+ * @throws IOException
+ */
+ protected static Comparison getComparison(ResourceScopeProvider scopeProvider) throws IOException {
+ IComparisonScope scope = EMFCompare.createDefaultScope(scopeProvider.getLeft(), scopeProvider
+ .getRight(), scopeProvider.getOrigin());
+ return EMFCompare.builder().build().compare(scope);
+ }
+
+ protected Match getMatchWithFeatureValue(Collection<?> c, final String featureName, final Object value) {
+ Iterable<Match> matches = filter(c, Match.class);
+ Predicate<Match> predicate = hasFeatureValue(featureName, value);
+ return find(matches, predicate);
+ }
+
+ protected ReferenceChange getReferenceChangeWithFeatureValue(Collection<?> c, final String featureName,
+ final Object value) {
+ Iterable<ReferenceChange> matches = filter(c, ReferenceChange.class);
+ Predicate<ReferenceChange> predicate = new Predicate<ReferenceChange>() {
+ public boolean apply(ReferenceChange referenceChange) {
+ EObject referenceChangeValue = referenceChange.getValue();
+ if (referenceChangeValue != null) {
+ return Objects.equal(eGet(referenceChangeValue, featureName), value);
+ }
+ return false;
+ }
+ };
+ return find(matches, predicate);
+ }
+
+ protected Predicate<Match> hasFeatureValue(final String featureName, final Object value) {
+ Predicate<Match> predicate = new Predicate<Match>() {
+ public boolean apply(Match match) {
+ final boolean ret;
+ final EObject left = match.getLeft();
+ final EObject right = match.getRight();
+ final EObject origin = match.getOrigin();
+ if (left != null) {
+ ret = Objects.equal(value, eGet(left, featureName));
+ } else if (right != null) {
+ ret = Objects.equal(value, eGet(right, featureName));
+ } else if (origin != null) {
+ ret = Objects.equal(value, eGet(origin, featureName));
+ } else {
+ ret = false;
+ }
+ return ret;
+ }
+ };
+ return predicate;
+ }
+
+ protected Object eGet(EObject eObject, String featureName) {
+ EStructuralFeature eStructuralFeature = eObject.eClass().getEStructuralFeature(featureName);
+ return eObject.eGet(eStructuralFeature);
+ }
+
+ protected List<Notifier> eAllChildren(Notifier notifier) {
+ List<Notifier> ret = newArrayList();
+ ITreeItemContentProvider contentProvider = adaptAsITreItemContentProvider(notifier);
+ Iterable<Notifier> children = filter(contentProvider.getChildren(notifier), Notifier.class);
+ for (Notifier child : children) {
+ ret.add(child);
+ ret.addAll(eAllChildren(child));
+ }
+ return ret;
+ }
+
+ protected ITreeItemContentProvider adaptAsITreItemContentProvider(Notifier notifier) {
+ ITreeItemContentProvider contentProvider = (ITreeItemContentProvider)compareItemProviderAdapterFactory
+ .adapt(notifier, ITreeItemContentProvider.class);
+ return contentProvider;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestMatchItemProviderSpec.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestMatchItemProviderSpec.java
index 3f9507a72..d351bcf21 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestMatchItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestMatchItemProviderSpec.java
@@ -1,145 +1,145 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.tests.edit;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.size;
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.emf.compare.Comparison;
-import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.provider.MatchItemProvider;
-import org.eclipse.emf.compare.provider.spec.MatchItemProviderSpec;
-import org.eclipse.emf.compare.tests.edit.data.ecore.a1.EcoreA1InputData;
-import org.junit.Before;
-import org.junit.Test;
-
-/**
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class TestMatchItemProviderSpec extends AbstractTestCompareItemProviderAdapter {
-
- private MatchItemProvider itemProvider;
-
- @Override
- @Before
- public void before() throws IOException {
- super.before();
- itemProvider = (MatchItemProviderSpec)compareItemProviderAdapterFactory.createMatchAdapter();
- }
-
- @Test
- public void testGetChildren_EcoreA1() throws IOException {
- Match ePackageMatch = getEcoreA1_EPackageMatch();
-
- Collection<?> ePackageMatchChildren = itemProvider.getChildren(ePackageMatch);
- assertEquals(9, ePackageMatchChildren.size());
- assertEquals(4, size(filter(ePackageMatchChildren, Diff.class)));
- assertEquals(5, size(filter(ePackageMatchChildren, Match.class)));
- }
-
- static Match getEcoreA1_EPackageMatch() throws IOException {
- Comparison comparison = getComparison(new EcoreA1InputData());
-
- List<Match> matches = comparison.getMatches();
- Match ePackageMatch = matches.get(0);
- return ePackageMatch;
- }
-
- @Test
- public void testGetChildren_AudioVisualItem() throws IOException {
- Match ePackageMatch = getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
- Match audioVisualItem_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
- "AudioVisualItem");
- Collection<?> audioVisualItem_MatchChildren = itemProvider.getChildren(audioVisualItem_Match);
-
- assertEquals(3, audioVisualItem_MatchChildren.size());
- assertEquals(2, size(filter(audioVisualItem_MatchChildren, Diff.class)));
- assertEquals(1, size(filter(audioVisualItem_MatchChildren, Match.class)));
- }
-
- @Test
- public void testGetChildren_AudioVisualItem_lenght() throws IOException {
- Match ePackageMatch = getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
- Match audioVisualItem_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
- "AudioVisualItem");
- Collection<?> audioVisualItem_MatchChildren = itemProvider.getChildren(audioVisualItem_Match);
- Match audioVisualItem_legnth_Match = getMatchWithFeatureValue(audioVisualItem_MatchChildren, "name",
- "length");
- Collection<?> audioVisualItem_legnth_MatchChildren = itemProvider
- .getChildren(audioVisualItem_legnth_Match);
-
- assertEquals(2, audioVisualItem_legnth_MatchChildren.size());
- assertEquals(2, size(filter(audioVisualItem_legnth_MatchChildren, Diff.class)));
- assertEquals(0, size(filter(audioVisualItem_legnth_MatchChildren, Match.class)));
- }
-
- @Test
- public void testGetChildren_Book() throws IOException {
- Match ePackageMatch = getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
- Match book_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Book");
- Collection<?> book_MatchChildren = itemProvider.getChildren(book_Match);
-
- assertEquals(3, book_MatchChildren.size());
- assertEquals(3, size(filter(book_MatchChildren, Diff.class)));
- assertEquals(0, size(filter(book_MatchChildren, Match.class)));
- }
-
- @Test
- public void testGetChildren_BookCategory() throws IOException {
- Match ePackageMatch = getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
- Match bookCategory_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "BookCategory");
- Collection<?> bookCategory_MatchChildren = itemProvider.getChildren(bookCategory_Match);
-
- assertEquals(4, bookCategory_MatchChildren.size());
- assertEquals(4, size(filter(bookCategory_MatchChildren, Diff.class)));
- assertEquals(0, size(filter(bookCategory_MatchChildren, Match.class)));
- }
-
- @Test
- public void testGetChildren_Borrowable() throws IOException {
- Match ePackageMatch = getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
- Match borrowable_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Borrowable");
- Collection<?> borrowable_MatchChildren = itemProvider.getChildren(borrowable_Match);
-
- assertEquals(1, borrowable_MatchChildren.size());
- assertEquals(1, size(filter(borrowable_MatchChildren, Diff.class)));
- assertEquals(0, size(filter(borrowable_MatchChildren, Match.class)));
- }
-
- @Test
- public void testGetChildren_Person() throws IOException {
- Match ePackageMatch = getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
- Match person_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Person");
- Collection<?> person_MatchChildren = itemProvider.getChildren(person_Match);
-
- assertEquals(3, person_MatchChildren.size());
- assertEquals(3, size(filter(person_MatchChildren, Diff.class)));
- assertEquals(0, size(filter(person_MatchChildren, Match.class)));
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.tests.edit;
+
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.size;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.provider.MatchItemProvider;
+import org.eclipse.emf.compare.provider.spec.MatchItemProviderSpec;
+import org.eclipse.emf.compare.tests.edit.data.ecore.a1.EcoreA1InputData;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class TestMatchItemProviderSpec extends AbstractTestCompareItemProviderAdapter {
+
+ private MatchItemProvider itemProvider;
+
+ @Override
+ @Before
+ public void before() throws IOException {
+ super.before();
+ itemProvider = (MatchItemProviderSpec)compareItemProviderAdapterFactory.createMatchAdapter();
+ }
+
+ @Test
+ public void testGetChildren_EcoreA1() throws IOException {
+ Match ePackageMatch = getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackageMatchChildren = itemProvider.getChildren(ePackageMatch);
+ assertEquals(18, ePackageMatchChildren.size());
+ assertEquals(4, size(filter(ePackageMatchChildren, Diff.class)));
+ assertEquals(14, size(filter(ePackageMatchChildren, Match.class)));
+ }
+
+ static Match getEcoreA1_EPackageMatch() throws IOException {
+ Comparison comparison = getComparison(new EcoreA1InputData());
+
+ List<Match> matches = comparison.getMatches();
+ Match ePackageMatch = matches.get(0);
+ return ePackageMatch;
+ }
+
+ @Test
+ public void testGetChildren_AudioVisualItem() throws IOException {
+ Match ePackageMatch = getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
+ Match audioVisualItem_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
+ "AudioVisualItem");
+ Collection<?> audioVisualItem_MatchChildren = itemProvider.getChildren(audioVisualItem_Match);
+
+ assertEquals(4, audioVisualItem_MatchChildren.size());
+ assertEquals(2, size(filter(audioVisualItem_MatchChildren, Diff.class)));
+ assertEquals(2, size(filter(audioVisualItem_MatchChildren, Match.class)));
+ }
+
+ @Test
+ public void testGetChildren_AudioVisualItem_lenght() throws IOException {
+ Match ePackageMatch = getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
+ Match audioVisualItem_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
+ "AudioVisualItem");
+ Collection<?> audioVisualItem_MatchChildren = itemProvider.getChildren(audioVisualItem_Match);
+ Match audioVisualItem_legnth_Match = getMatchWithFeatureValue(audioVisualItem_MatchChildren, "name",
+ "length");
+ Collection<?> audioVisualItem_legnth_MatchChildren = itemProvider
+ .getChildren(audioVisualItem_legnth_Match);
+
+ assertEquals(2, audioVisualItem_legnth_MatchChildren.size());
+ assertEquals(2, size(filter(audioVisualItem_legnth_MatchChildren, Diff.class)));
+ assertEquals(0, size(filter(audioVisualItem_legnth_MatchChildren, Match.class)));
+ }
+
+ @Test
+ public void testGetChildren_Book() throws IOException {
+ Match ePackageMatch = getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
+ Match book_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Book");
+ Collection<?> book_MatchChildren = itemProvider.getChildren(book_Match);
+
+ assertEquals(6, book_MatchChildren.size());
+ assertEquals(3, size(filter(book_MatchChildren, Diff.class)));
+ assertEquals(3, size(filter(book_MatchChildren, Match.class)));
+ }
+
+ @Test
+ public void testGetChildren_BookCategory() throws IOException {
+ Match ePackageMatch = getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
+ Match bookCategory_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "BookCategory");
+ Collection<?> bookCategory_MatchChildren = itemProvider.getChildren(bookCategory_Match);
+
+ assertEquals(7, bookCategory_MatchChildren.size());
+ assertEquals(4, size(filter(bookCategory_MatchChildren, Diff.class)));
+ assertEquals(3, size(filter(bookCategory_MatchChildren, Match.class)));
+ }
+
+ @Test
+ public void testGetChildren_Borrowable() throws IOException {
+ Match ePackageMatch = getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
+ Match borrowable_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Borrowable");
+ Collection<?> borrowable_MatchChildren = itemProvider.getChildren(borrowable_Match);
+
+ assertEquals(3, borrowable_MatchChildren.size());
+ assertEquals(1, size(filter(borrowable_MatchChildren, Diff.class)));
+ assertEquals(2, size(filter(borrowable_MatchChildren, Match.class)));
+ }
+
+ @Test
+ public void testGetChildren_Person() throws IOException {
+ Match ePackageMatch = getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = itemProvider.getChildren(ePackageMatch);
+ Match person_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Person");
+ Collection<?> person_MatchChildren = itemProvider.getChildren(person_Match);
+
+ assertEquals(3, person_MatchChildren.size());
+ assertEquals(3, size(filter(person_MatchChildren, Diff.class)));
+ assertEquals(0, size(filter(person_MatchChildren, Match.class)));
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestReferenceChangeItemProviderSpec.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestReferenceChangeItemProviderSpec.java
index 0cda3ecfe..d219ef857 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestReferenceChangeItemProviderSpec.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/edit/TestReferenceChangeItemProviderSpec.java
@@ -1,295 +1,295 @@
-/*******************************************************************************
- * Copyright (c) 2012 Obeo.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Obeo - initial API and implementation
- *******************************************************************************/
-package org.eclipse.emf.compare.tests.edit;
-
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.get;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.compare.AttributeChange;
-import org.eclipse.emf.compare.Match;
-import org.eclipse.emf.compare.ReferenceChange;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EcorePackage;
-import org.junit.Test;
-
-/**
- * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
- */
-public class TestReferenceChangeItemProviderSpec extends AbstractTestCompareItemProviderAdapter {
-
- @Test
- public void testGetChildren_AudioVisualItem() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
- Match audioVisualItem_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
- "AudioVisualItem");
- Collection<?> audioVisualItem_MatchChildren = adaptAsITreItemContentProvider(audioVisualItem_Match)
- .getChildren(audioVisualItem_Match);
-
- ReferenceChange titleReferenceChange = getReferenceChangeWithFeatureValue(
- audioVisualItem_MatchChildren, "name", "title");
-
- Collection<?> titleReferenceChange_Children = adaptAsITreItemContentProvider(titleReferenceChange)
- .getChildren(titleReferenceChange);
-
- assertEquals(1, titleReferenceChange_Children.size());
- Object child = get(titleReferenceChange_Children, 0);
- assertTrue(child instanceof ReferenceChange);
- assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, ((ReferenceChange)child).getReference());
-
- ReferenceChange titledItemReferenceChange = getReferenceChangeWithFeatureValue(
- audioVisualItem_MatchChildren, "name", "TitledItem");
- Collection<?> titledItemReferenceChange_Children = adaptAsITreItemContentProvider(
- titledItemReferenceChange).getChildren(titledItemReferenceChange);
- assertEquals(0, titledItemReferenceChange_Children.size());
- }
-
- @Test
- public void testGetChildren_Book() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
- Match book_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Book");
- Collection<?> book_MatchChildren = adaptAsITreItemContentProvider(book_Match).getChildren(book_Match);
-
- ReferenceChange subtitleReferenceChange = getReferenceChangeWithFeatureValue(book_MatchChildren,
- "name", "subtitle");
-
- Collection<?> subtitleReferenceChange_Children = adaptAsITreItemContentProvider(
- subtitleReferenceChange).getChildren(subtitleReferenceChange);
-
- assertEquals(1, subtitleReferenceChange_Children.size());
- Notifier child = (Notifier)get(subtitleReferenceChange_Children, 0);
- assertTrue(child instanceof ReferenceChange);
- assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, ((ReferenceChange)child).getReference());
- assertTrue(adaptAsITreItemContentProvider(child).getChildren(child).isEmpty());
-
- ReferenceChange titleReferenceChange = getReferenceChangeWithFeatureValue(book_MatchChildren, "name",
- "title");
- Collection<?> titleReferenceChange_Children = adaptAsITreItemContentProvider(titleReferenceChange)
- .getChildren(titleReferenceChange);
- assertEquals(1, titleReferenceChange_Children.size());
- child = (Notifier)get(titleReferenceChange_Children, 0);
- assertTrue(child instanceof ReferenceChange);
- assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, ((ReferenceChange)child).getReference());
- assertTrue(adaptAsITreItemContentProvider(child).getChildren(child).isEmpty());
-
- ReferenceChange titledItemReferenceChange = getReferenceChangeWithFeatureValue(book_MatchChildren,
- "name", "TitledItem");
- Collection<?> titledItemReferenceChange_Children = adaptAsITreItemContentProvider(
- titledItemReferenceChange).getChildren(titledItemReferenceChange);
- assertEquals(0, titledItemReferenceChange_Children.size());
- }
-
- @Test
- public void testGetChildren_Borrowable() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
- Match borrowableCategory_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
- "Borrowable");
- Collection<?> borrowable_MatchChildren = adaptAsITreItemContentProvider(borrowableCategory_Match)
- .getChildren(borrowableCategory_Match);
-
- assertEquals(1, borrowable_MatchChildren.size());
- }
-
- @Test
- public void testGetChildren_BookCategory() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
- Match bookCategory_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "BookCategory");
- Collection<?> bookCategory_MatchChildren = adaptAsITreItemContentProvider(bookCategory_Match)
- .getChildren(bookCategory_Match);
-
- ReferenceChange dictionaryReferenceChange = getReferenceChangeWithFeatureValue(
- bookCategory_MatchChildren, "name", "Dictionary");
- ReferenceChange encyclopediaReferenceChange = getReferenceChangeWithFeatureValue(
- bookCategory_MatchChildren, "name", "Encyclopedia");
- ReferenceChange mangaReferenceChange = getReferenceChangeWithFeatureValue(bookCategory_MatchChildren,
- "name", "Manga");
- ReferenceChange manhwaReferenceChange = getReferenceChangeWithFeatureValue(
- bookCategory_MatchChildren, "name", "Manhwa");
-
- assertTrue(adaptAsITreItemContentProvider(dictionaryReferenceChange).getChildren(
- dictionaryReferenceChange).isEmpty());
- assertTrue(adaptAsITreItemContentProvider(encyclopediaReferenceChange).getChildren(
- encyclopediaReferenceChange).isEmpty());
- assertTrue(adaptAsITreItemContentProvider(mangaReferenceChange).getChildren(mangaReferenceChange)
- .isEmpty());
- assertTrue(adaptAsITreItemContentProvider(manhwaReferenceChange).getChildren(manhwaReferenceChange)
- .isEmpty());
- }
-
- @Test
- public void testGetChildren_Magazine1() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
-
- Collection<?> magazineChildren = null;
- for (ReferenceChange referenceChange : filter(ePackage_MatchChildren, ReferenceChange.class)) {
- EClass eClass = (EClass)referenceChange.getValue();
- if ("Magazine".equals(eClass.getName())
- && "CirculatingItem".equals(eClass.getESuperTypes().get(0).getName())) {
- magazineChildren = adaptAsITreItemContentProvider(referenceChange).getChildren(
- referenceChange);
- assertEquals(3, magazineChildren.size());
- break;
- }
- }
- ReferenceChange magazineSuperTypeChange = getReferenceChangeWithFeatureValue(magazineChildren,
- "name", "CirculatingItem");
- assertTrue(adaptAsITreItemContentProvider(magazineSuperTypeChange).getChildren(
- magazineSuperTypeChange).isEmpty());
-
- ReferenceChange magazineSFChange1 = getReferenceChangeWithFeatureValue(magazineChildren, "name",
- "pages");
- assertEquals(1, adaptAsITreItemContentProvider(magazineSFChange1).getChildren(magazineSFChange1)
- .size());
-
- ReferenceChange magazineSFChange2 = getReferenceChangeWithFeatureValue(magazineChildren, "name",
- "title");
- assertEquals(1, adaptAsITreItemContentProvider(magazineSFChange2).getChildren(magazineSFChange2)
- .size());
- }
-
- @Test
- public void testGetChildren_Magazine2() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
-
- Collection<?> magazineChildren = null;
- for (ReferenceChange referenceChange : filter(ePackage_MatchChildren, ReferenceChange.class)) {
- EClass eClass = (EClass)referenceChange.getValue();
- if ("Magazine".equals(eClass.getName())
- && "Periodical".equals(eClass.getESuperTypes().get(0).getName())) {
- magazineChildren = adaptAsITreItemContentProvider(referenceChange).getChildren(
- referenceChange);
- assertEquals(1, magazineChildren.size());
- break;
- }
- }
- ReferenceChange magazineSuperTypeChange = getReferenceChangeWithFeatureValue(magazineChildren,
- "name", "Periodical");
- assertTrue(adaptAsITreItemContentProvider(magazineSuperTypeChange).getChildren(
- magazineSuperTypeChange).isEmpty());
- }
-
- @Test
- public void testGetChildren_Periodical() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
- ReferenceChange periodical_ReferenceChange = getReferenceChangeWithFeatureValue(
- ePackage_MatchChildren, "name", "Periodical");
- Collection<?> periodical_ReferenceChangeChildren = adaptAsITreItemContentProvider(
- periodical_ReferenceChange).getChildren(periodical_ReferenceChange);
-
- assertEquals(3, periodical_ReferenceChangeChildren.size());
-
- ReferenceChange issuesPerYearChange = getReferenceChangeWithFeatureValue(
- periodical_ReferenceChangeChildren, "name", "issuesPerYear");
-
- ReferenceChange itemChange = getReferenceChangeWithFeatureValue(periodical_ReferenceChangeChildren,
- "name", "Item");
- ReferenceChange titledItemChange = getReferenceChangeWithFeatureValue(
- periodical_ReferenceChangeChildren, "name", "TitledItem");
-
- Collection<?> issuesPerYearChildren = adaptAsITreItemContentProvider(issuesPerYearChange)
- .getChildren(issuesPerYearChange);
- assertEquals(1, issuesPerYearChildren.size());
- ReferenceChange issuePerYearChild = (ReferenceChange)issuesPerYearChildren.iterator().next();
- assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, issuePerYearChild.getReference());
-
- assertTrue(adaptAsITreItemContentProvider(itemChange).getChildren(itemChange).isEmpty());
- assertTrue(adaptAsITreItemContentProvider(titledItemChange).getChildren(titledItemChange).isEmpty());
- }
-
- @Test
- public void testGetChildren_Person() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
- Match person_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Person");
- Collection<?> person_MatchChildren = adaptAsITreItemContentProvider(person_Match).getChildren(
- person_Match);
-
- assertEquals(3, person_MatchChildren.size());
-
- ReferenceChange issuesPerYearChange = getReferenceChangeWithFeatureValue(person_MatchChildren,
- "name", "firstName");
- Collection<?> firstNameChildren = adaptAsITreItemContentProvider(issuesPerYearChange).getChildren(
- issuesPerYearChange);
- assertEquals(1, firstNameChildren.size());
- ReferenceChange firstNameChild = (ReferenceChange)firstNameChildren.iterator().next();
- assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, firstNameChild.getReference());
-
- ReferenceChange fullNameChange = getReferenceChangeWithFeatureValue(person_MatchChildren, "name",
- "fullName");
- Collection<?> fullNameChildren = adaptAsITreItemContentProvider(fullNameChange).getChildren(
- fullNameChange);
- assertEquals(1, fullNameChildren.size());
- ReferenceChange fullNameChild = (ReferenceChange)fullNameChildren.iterator().next();
- assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, fullNameChild.getReference());
-
- ReferenceChange lastNameChange = getReferenceChangeWithFeatureValue(person_MatchChildren, "name",
- "lastName");
- Collection<?> lastNameChildren = adaptAsITreItemContentProvider(lastNameChange).getChildren(
- lastNameChange);
- assertEquals(2, lastNameChildren.size());
- Iterator<?> lastNameiterator = lastNameChildren.iterator();
- ReferenceChange lastName1stChild = (ReferenceChange)lastNameiterator.next();
- AttributeChange lastName2ndChild = (AttributeChange)lastNameiterator.next();
- assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, lastName1stChild.getReference());
- assertEquals(EcorePackage.Literals.ENAMED_ELEMENT__NAME, lastName2ndChild.getAttribute());
- }
-
- @Test
- public void testGetChildren_TitledItem() throws IOException {
- Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
-
- Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
- ePackageMatch);
-
- ReferenceChange titledItem_ReferenceChange = getReferenceChangeWithFeatureValue(
- ePackage_MatchChildren, "name", "TitledItem");
- Collection<?> titledItem_ReferenceChangeChildren = adaptAsITreItemContentProvider(
- titledItem_ReferenceChange).getChildren(titledItem_ReferenceChange);
- assertEquals(1, titledItem_ReferenceChangeChildren.size());
-
- ReferenceChange title_Change = (ReferenceChange)titledItem_ReferenceChangeChildren.iterator().next();
- Collection<?> title_ChangeChildren = adaptAsITreItemContentProvider(title_Change).getChildren(
- title_Change);
- assertEquals(1, title_ChangeChildren.size());
-
- ReferenceChange eType_Change = (ReferenceChange)title_ChangeChildren.iterator().next();
- assertTrue(adaptAsITreItemContentProvider(eType_Change).getChildren(eType_Change).isEmpty());
- }
-}
+/*******************************************************************************
+ * Copyright (c) 2012 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.tests.edit;
+
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.get;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.compare.AttributeChange;
+import org.eclipse.emf.compare.Match;
+import org.eclipse.emf.compare.ReferenceChange;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.junit.Test;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class TestReferenceChangeItemProviderSpec extends AbstractTestCompareItemProviderAdapter {
+
+ @Test
+ public void testGetChildren_AudioVisualItem() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+ Match audioVisualItem_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
+ "AudioVisualItem");
+ Collection<?> audioVisualItem_MatchChildren = adaptAsITreItemContentProvider(audioVisualItem_Match)
+ .getChildren(audioVisualItem_Match);
+
+ ReferenceChange titleReferenceChange = getReferenceChangeWithFeatureValue(
+ audioVisualItem_MatchChildren, "name", "title");
+
+ Collection<?> titleReferenceChange_Children = adaptAsITreItemContentProvider(titleReferenceChange)
+ .getChildren(titleReferenceChange);
+
+ assertEquals(1, titleReferenceChange_Children.size());
+ Object child = get(titleReferenceChange_Children, 0);
+ assertTrue(child instanceof ReferenceChange);
+ assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, ((ReferenceChange)child).getReference());
+
+ ReferenceChange titledItemReferenceChange = getReferenceChangeWithFeatureValue(
+ audioVisualItem_MatchChildren, "name", "TitledItem");
+ Collection<?> titledItemReferenceChange_Children = adaptAsITreItemContentProvider(
+ titledItemReferenceChange).getChildren(titledItemReferenceChange);
+ assertEquals(0, titledItemReferenceChange_Children.size());
+ }
+
+ @Test
+ public void testGetChildren_Book() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+ Match book_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Book");
+ Collection<?> book_MatchChildren = adaptAsITreItemContentProvider(book_Match).getChildren(book_Match);
+
+ ReferenceChange subtitleReferenceChange = getReferenceChangeWithFeatureValue(book_MatchChildren,
+ "name", "subtitle");
+
+ Collection<?> subtitleReferenceChange_Children = adaptAsITreItemContentProvider(
+ subtitleReferenceChange).getChildren(subtitleReferenceChange);
+
+ assertEquals(1, subtitleReferenceChange_Children.size());
+ Notifier child = (Notifier)get(subtitleReferenceChange_Children, 0);
+ assertTrue(child instanceof ReferenceChange);
+ assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, ((ReferenceChange)child).getReference());
+ assertTrue(adaptAsITreItemContentProvider(child).getChildren(child).isEmpty());
+
+ ReferenceChange titleReferenceChange = getReferenceChangeWithFeatureValue(book_MatchChildren, "name",
+ "title");
+ Collection<?> titleReferenceChange_Children = adaptAsITreItemContentProvider(titleReferenceChange)
+ .getChildren(titleReferenceChange);
+ assertEquals(1, titleReferenceChange_Children.size());
+ child = (Notifier)get(titleReferenceChange_Children, 0);
+ assertTrue(child instanceof ReferenceChange);
+ assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, ((ReferenceChange)child).getReference());
+ assertTrue(adaptAsITreItemContentProvider(child).getChildren(child).isEmpty());
+
+ ReferenceChange titledItemReferenceChange = getReferenceChangeWithFeatureValue(book_MatchChildren,
+ "name", "TitledItem");
+ Collection<?> titledItemReferenceChange_Children = adaptAsITreItemContentProvider(
+ titledItemReferenceChange).getChildren(titledItemReferenceChange);
+ assertEquals(0, titledItemReferenceChange_Children.size());
+ }
+
+ @Test
+ public void testGetChildren_Borrowable() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+ Match borrowableCategory_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name",
+ "Borrowable");
+ Collection<?> borrowable_MatchChildren = adaptAsITreItemContentProvider(borrowableCategory_Match)
+ .getChildren(borrowableCategory_Match);
+
+ assertEquals(3, borrowable_MatchChildren.size());
+ }
+
+ @Test
+ public void testGetChildren_BookCategory() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+ Match bookCategory_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "BookCategory");
+ Collection<?> bookCategory_MatchChildren = adaptAsITreItemContentProvider(bookCategory_Match)
+ .getChildren(bookCategory_Match);
+
+ ReferenceChange dictionaryReferenceChange = getReferenceChangeWithFeatureValue(
+ bookCategory_MatchChildren, "name", "Dictionary");
+ ReferenceChange encyclopediaReferenceChange = getReferenceChangeWithFeatureValue(
+ bookCategory_MatchChildren, "name", "Encyclopedia");
+ ReferenceChange mangaReferenceChange = getReferenceChangeWithFeatureValue(bookCategory_MatchChildren,
+ "name", "Manga");
+ ReferenceChange manhwaReferenceChange = getReferenceChangeWithFeatureValue(
+ bookCategory_MatchChildren, "name", "Manhwa");
+
+ assertTrue(adaptAsITreItemContentProvider(dictionaryReferenceChange).getChildren(
+ dictionaryReferenceChange).isEmpty());
+ assertTrue(adaptAsITreItemContentProvider(encyclopediaReferenceChange).getChildren(
+ encyclopediaReferenceChange).isEmpty());
+ assertTrue(adaptAsITreItemContentProvider(mangaReferenceChange).getChildren(mangaReferenceChange)
+ .isEmpty());
+ assertTrue(adaptAsITreItemContentProvider(manhwaReferenceChange).getChildren(manhwaReferenceChange)
+ .isEmpty());
+ }
+
+ @Test
+ public void testGetChildren_Magazine1() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+
+ Collection<?> magazineChildren = null;
+ for (ReferenceChange referenceChange : filter(ePackage_MatchChildren, ReferenceChange.class)) {
+ EClass eClass = (EClass)referenceChange.getValue();
+ if ("Magazine".equals(eClass.getName())
+ && "CirculatingItem".equals(eClass.getESuperTypes().get(0).getName())) {
+ magazineChildren = adaptAsITreItemContentProvider(referenceChange).getChildren(
+ referenceChange);
+ assertEquals(3, magazineChildren.size());
+ break;
+ }
+ }
+ ReferenceChange magazineSuperTypeChange = getReferenceChangeWithFeatureValue(magazineChildren,
+ "name", "CirculatingItem");
+ assertTrue(adaptAsITreItemContentProvider(magazineSuperTypeChange).getChildren(
+ magazineSuperTypeChange).isEmpty());
+
+ ReferenceChange magazineSFChange1 = getReferenceChangeWithFeatureValue(magazineChildren, "name",
+ "pages");
+ assertEquals(1, adaptAsITreItemContentProvider(magazineSFChange1).getChildren(magazineSFChange1)
+ .size());
+
+ ReferenceChange magazineSFChange2 = getReferenceChangeWithFeatureValue(magazineChildren, "name",
+ "title");
+ assertEquals(1, adaptAsITreItemContentProvider(magazineSFChange2).getChildren(magazineSFChange2)
+ .size());
+ }
+
+ @Test
+ public void testGetChildren_Magazine2() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+
+ Collection<?> magazineChildren = null;
+ for (ReferenceChange referenceChange : filter(ePackage_MatchChildren, ReferenceChange.class)) {
+ EClass eClass = (EClass)referenceChange.getValue();
+ if ("Magazine".equals(eClass.getName())
+ && "Periodical".equals(eClass.getESuperTypes().get(0).getName())) {
+ magazineChildren = adaptAsITreItemContentProvider(referenceChange).getChildren(
+ referenceChange);
+ assertEquals(1, magazineChildren.size());
+ break;
+ }
+ }
+ ReferenceChange magazineSuperTypeChange = getReferenceChangeWithFeatureValue(magazineChildren,
+ "name", "Periodical");
+ assertTrue(adaptAsITreItemContentProvider(magazineSuperTypeChange).getChildren(
+ magazineSuperTypeChange).isEmpty());
+ }
+
+ @Test
+ public void testGetChildren_Periodical() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+ ReferenceChange periodical_ReferenceChange = getReferenceChangeWithFeatureValue(
+ ePackage_MatchChildren, "name", "Periodical");
+ Collection<?> periodical_ReferenceChangeChildren = adaptAsITreItemContentProvider(
+ periodical_ReferenceChange).getChildren(periodical_ReferenceChange);
+
+ assertEquals(5, periodical_ReferenceChangeChildren.size());
+
+ ReferenceChange issuesPerYearChange = getReferenceChangeWithFeatureValue(
+ periodical_ReferenceChangeChildren, "name", "issuesPerYear");
+
+ ReferenceChange itemChange = getReferenceChangeWithFeatureValue(periodical_ReferenceChangeChildren,
+ "name", "Item");
+ ReferenceChange titledItemChange = getReferenceChangeWithFeatureValue(
+ periodical_ReferenceChangeChildren, "name", "TitledItem");
+
+ Collection<?> issuesPerYearChildren = adaptAsITreItemContentProvider(issuesPerYearChange)
+ .getChildren(issuesPerYearChange);
+ assertEquals(1, issuesPerYearChildren.size());
+ ReferenceChange issuePerYearChild = (ReferenceChange)issuesPerYearChildren.iterator().next();
+ assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, issuePerYearChild.getReference());
+
+ assertTrue(adaptAsITreItemContentProvider(itemChange).getChildren(itemChange).isEmpty());
+ assertTrue(adaptAsITreItemContentProvider(titledItemChange).getChildren(titledItemChange).isEmpty());
+ }
+
+ @Test
+ public void testGetChildren_Person() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+ Match person_Match = getMatchWithFeatureValue(ePackage_MatchChildren, "name", "Person");
+ Collection<?> person_MatchChildren = adaptAsITreItemContentProvider(person_Match).getChildren(
+ person_Match);
+
+ assertEquals(3, person_MatchChildren.size());
+
+ ReferenceChange issuesPerYearChange = getReferenceChangeWithFeatureValue(person_MatchChildren,
+ "name", "firstName");
+ Collection<?> firstNameChildren = adaptAsITreItemContentProvider(issuesPerYearChange).getChildren(
+ issuesPerYearChange);
+ assertEquals(1, firstNameChildren.size());
+ ReferenceChange firstNameChild = (ReferenceChange)firstNameChildren.iterator().next();
+ assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, firstNameChild.getReference());
+
+ ReferenceChange fullNameChange = getReferenceChangeWithFeatureValue(person_MatchChildren, "name",
+ "fullName");
+ Collection<?> fullNameChildren = adaptAsITreItemContentProvider(fullNameChange).getChildren(
+ fullNameChange);
+ assertEquals(1, fullNameChildren.size());
+ ReferenceChange fullNameChild = (ReferenceChange)fullNameChildren.iterator().next();
+ assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, fullNameChild.getReference());
+
+ ReferenceChange lastNameChange = getReferenceChangeWithFeatureValue(person_MatchChildren, "name",
+ "lastName");
+ Collection<?> lastNameChildren = adaptAsITreItemContentProvider(lastNameChange).getChildren(
+ lastNameChange);
+ assertEquals(2, lastNameChildren.size());
+ Iterator<?> lastNameiterator = lastNameChildren.iterator();
+ ReferenceChange lastName1stChild = (ReferenceChange)lastNameiterator.next();
+ AttributeChange lastName2ndChild = (AttributeChange)lastNameiterator.next();
+ assertEquals(EcorePackage.Literals.ETYPED_ELEMENT__ETYPE, lastName1stChild.getReference());
+ assertEquals(EcorePackage.Literals.ENAMED_ELEMENT__NAME, lastName2ndChild.getAttribute());
+ }
+
+ @Test
+ public void testGetChildren_TitledItem() throws IOException {
+ Match ePackageMatch = TestMatchItemProviderSpec.getEcoreA1_EPackageMatch();
+
+ Collection<?> ePackage_MatchChildren = adaptAsITreItemContentProvider(ePackageMatch).getChildren(
+ ePackageMatch);
+
+ ReferenceChange titledItem_ReferenceChange = getReferenceChangeWithFeatureValue(
+ ePackage_MatchChildren, "name", "TitledItem");
+ Collection<?> titledItem_ReferenceChangeChildren = adaptAsITreItemContentProvider(
+ titledItem_ReferenceChange).getChildren(titledItem_ReferenceChange);
+ assertEquals(1, titledItem_ReferenceChangeChildren.size());
+
+ ReferenceChange title_Change = (ReferenceChange)titledItem_ReferenceChangeChildren.iterator().next();
+ Collection<?> title_ChangeChildren = adaptAsITreItemContentProvider(title_Change).getChildren(
+ title_Change);
+ assertEquals(1, title_ChangeChildren.size());
+
+ ReferenceChange eType_Change = (ReferenceChange)title_ChangeChildren.iterator().next();
+ assertTrue(adaptAsITreItemContentProvider(eType_Change).getChildren(eType_Change).isEmpty());
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
index f13261d4e..11126127c 100644
--- a/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.tests/src/org/eclipse/emf/compare/tests/postprocess/data/TestPostProcessor.java
@@ -80,4 +80,15 @@ public class TestPostProcessor implements IPostProcessor {
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postComparison(Comparison comparison, Monitor monitor) {
+ // TODO Auto-generated method stub
+
+ }
+
}
diff --git a/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF
index f30c893a2..e57f8ca77 100644
--- a/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.edit/META-INF/MANIFEST.MF
@@ -18,6 +18,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.uml2.uml.edit;bundle-version="4.0.0",
org.eclipse.emf.compare.edit
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
org.eclipse.emf.compare.provider
Export-Package: org.eclipse.emf.compare.uml2.provider
diff --git a/plugins/org.eclipse.emf.compare.uml2.edit/plugin.properties b/plugins/org.eclipse.emf.compare.uml2.edit/plugin.properties
index e6a12fb89..9bf4daea9 100644
--- a/plugins/org.eclipse.emf.compare.uml2.edit/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.uml2.edit/plugin.properties
@@ -8,7 +8,7 @@
# Contributors:
# Obeo - initial API and implementation
################################################################################
-pluginName = UML2Diff Edit Support
+pluginName = EMF Compare UML2 Comparison Edit Support
providerName = Eclipse Modeling Project
_UI_CreateChild_text = {0}
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.ide.ui/META-INF/MANIFEST.MF
index 5eb08e336..597f97259 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.ui/META-INF/MANIFEST.MF
@@ -13,7 +13,7 @@ Require-Bundle: org.eclipse.emf.compare.uml2.edit;bundle-version="2.0.1",
org.eclipse.emf.compare.rcp.ui;bundle-version="2.0.1",
org.eclipse.core.runtime;bundle-version="3.5.0",
org.eclipse.uml2.uml;bundle-version="4.0.0"
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.properties b/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.properties
index ccf8f7d1f..7eea1c84a 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.properties
@@ -8,6 +8,6 @@
# Contributors:
# Obeo - initial API and implementation
################################################################################
-pluginName = EMF Compare UML2 Support IDE UI Integration
+pluginName = EMF Compare UML2 Comparison Support IDE UI Integration
providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml b/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml
index 344b27f8c..af129b3ed 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.ui/plugin.xml
@@ -16,4 +16,12 @@
ranking="21">
</factory>
</extension>
+ <extension
+ point="org.eclipse.emf.compare.rcp.ui.filters">
+ <filter
+ activeByDefault="true"
+ class="org.eclipse.emf.compare.uml2.ide.ui.structuremergeviewer.filters.UMLRefinedElementsFilter"
+ label="UML refined elements">
+ </filter>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide.ui/src/org/eclipse/emf/compare/uml2/ide/ui/structuremergeviewer/filters/UMLRefinedElementsFilter.java b/plugins/org.eclipse.emf.compare.uml2.ide.ui/src/org/eclipse/emf/compare/uml2/ide/ui/structuremergeviewer/filters/UMLRefinedElementsFilter.java
new file mode 100644
index 000000000..108240cce
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.ide.ui/src/org/eclipse/emf/compare/uml2/ide/ui/structuremergeviewer/filters/UMLRefinedElementsFilter.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.uml2.ide.ui.structuremergeviewer.filters;
+
+import static com.google.common.base.Predicates.instanceOf;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.AbstractDifferenceFilter;
+import org.eclipse.emf.compare.scope.IComparisonScope;
+import org.eclipse.emf.compare.uml2.UMLDiff;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+
+/**
+ * A filter used by default that to filtered out refined UML differences.
+ *
+ * @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
+ * @since 3.0
+ */
+public class UMLRefinedElementsFilter extends AbstractDifferenceFilter {
+
+ /**
+ * The predicate use by this filter when it is selected.
+ */
+ private static final Predicate<? super EObject> predicateWhenSelected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ if (input instanceof Diff) {
+ Diff diff = (Diff)input;
+ return Iterables.any(diff.getRefines(), instanceOf(UMLDiff.class));
+ }
+ return false;
+ }
+ };
+
+ /**
+ * The predicate use by this filter when it is unselected.
+ */
+ private static final Predicate<? super EObject> predicateWhenUnselected = new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ EPackage p = input.eClass().getEPackage();
+ if (p != null) {
+ return p.getNsURI().startsWith("http://www.eclipse.org/emf/compare/uml2"); //$NON-NLS-1$
+ }
+ return false;
+ }
+ };
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#isEnabled(org.eclipse.emf.compare.scope.IComparisonScope,
+ * org.eclipse.emf.compare.Comparison)
+ */
+ @Override
+ public boolean isEnabled(IComparisonScope scope, Comparison comparison) {
+ if (scope != null) {
+ for (String nsURI : scope.getNsURIs()) {
+ if (nsURI.matches("http://www\\.eclipse\\.org/uml2/.*/UML")) { //$NON-NLS-1$
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenSelected()
+ */
+ @Override
+ public Predicate<? super EObject> getPredicateWhenSelected() {
+ return predicateWhenSelected;
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.structuremergeviewer.filters.IDifferenceFilter#getPredicateWhenUnselected()
+ */
+ @Override
+ public Predicate<? super EObject> getPredicateWhenUnselected() {
+ return predicateWhenUnselected;
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF
index 48ef0f6d7..c14581a3d 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.ide/META-INF/MANIFEST.MF
@@ -11,4 +11,4 @@ Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Import-Package: com.google.common.collect;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.collect;version="[11.0.0,15.0.0)"
diff --git a/plugins/org.eclipse.emf.compare.uml2.ide/plugin.properties b/plugins/org.eclipse.emf.compare.uml2.ide/plugin.properties
index 390296b33..3c1fe58f6 100644
--- a/plugins/org.eclipse.emf.compare.uml2.ide/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.uml2.ide/plugin.properties
@@ -8,6 +8,6 @@
# Contributors:
# Obeo - initial API and implementation
################################################################################
-pluginName = EMF Compare diff engine for UML2 (IDE extension)
+pluginName = EMF Compare UML2 Comparison Support IDE Integration
providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
index 519d50f1a..8837b7cc4 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
@@ -20,6 +20,6 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.compare.tests;bundle-version="2.0.1",
org.eclipse.uml2.uml.edit;bundle-version="4.0.0"
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)"
Bundle-Activator: org.eclipse.emf.compare.uml2.tests.EMFCompareUML2TestsPlugin
diff --git a/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF
index 88c7c6410..aa5906613 100644
--- a/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2/META-INF/MANIFEST.MF
@@ -25,6 +25,6 @@ Export-Package: org.eclipse.emf.compare.uml2,
org.eclipse.emf.compare.uml2.merge,
org.eclipse.emf.compare.uml2.util
Bundle-Activator: org.eclipse.emf.compare.uml2.UMLDiffEnginePlugin
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)",
- com.google.common.primitives;version="[10.0.0,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)",
+ com.google.common.primitives;version="[11.0.0,15.0.0)"
diff --git a/plugins/org.eclipse.emf.compare.uml2/about.ini b/plugins/org.eclipse.emf.compare.uml2/about.ini
new file mode 100644
index 000000000..eec22440e
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2/about.ini
@@ -0,0 +1,14 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
diff --git a/plugins/org.eclipse.emf.compare.uml2/about.properties b/plugins/org.eclipse.emf.compare.uml2/about.properties
new file mode 100644
index 000000000..ff75e735f
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2/about.properties
@@ -0,0 +1,26 @@
+# /**
+# * <copyright>
+# *
+# * Copyright (c) 2006, 2012 Obeo and others.
+# * All rights reserved. This program and the accompanying materials
+# * are made available under the terms of the Eclipse Public License v1.0
+# * which accompanies this distribution, and is available at
+# * http://www.eclipse.org/legal/epl-v10.html
+# *
+# * Contributors:
+# * Obeo - Initial API and implementation
+# *
+# * </copyright>
+# */
+
+# NLS_MESSAGEFORMAT_VAR
+
+featureName=EMF Compare UML2 Integration
+
+featureText=EMF Compare - UML Comparison Support\n\
+Version: {featureVersion}\n\
+\n\
+(c) Copyright Obeo and others. 2006, 2012. All rights reserved.\n\
+\n\
+EMF Compare brings comparison to the Eclipse Modeling Framework\n\
+Visit http://www.eclipse.org/emf/compare
diff --git a/plugins/org.eclipse.emf.compare.uml2/build.properties b/plugins/org.eclipse.emf.compare.uml2/build.properties
index ec9849411..a48d99ecd 100644
--- a/plugins/org.eclipse.emf.compare.uml2/build.properties
+++ b/plugins/org.eclipse.emf.compare.uml2/build.properties
@@ -13,10 +13,16 @@ bin.includes = .,\
META-INF/,\
plugin.xml,\
plugin.properties,\
- about.html
+ about.html,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
jars.compile.order = .
source.. = src-gen/,\
src/
output.. = bin/
src.includes = about.html,\
- model/
+ model/,\
+ about.ini,\
+ about.properties,\
+ modeling32.png
diff --git a/plugins/org.eclipse.emf.compare.uml2/modeling32.png b/plugins/org.eclipse.emf.compare.uml2/modeling32.png
new file mode 100644
index 000000000..6b08de2ad
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.compare.uml2/plugin.properties b/plugins/org.eclipse.emf.compare.uml2/plugin.properties
index 4ba5481e9..644e7a6f1 100644
--- a/plugins/org.eclipse.emf.compare.uml2/plugin.properties
+++ b/plugins/org.eclipse.emf.compare.uml2/plugin.properties
@@ -8,6 +8,6 @@
# Contributors:
# Obeo - initial API and implementation
################################################################################
-pluginName = EMF Compare diff engine for UML2
+pluginName = EMF Compare UML2 Comparison Support
providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
index 4cdbf59f7..01ddf86b4 100644
--- a/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare.uml2/src/org/eclipse/emf/compare/uml2/diff/UMLDiffExtensionPostProcessor.java
@@ -226,6 +226,15 @@ public class UMLDiffExtensionPostProcessor implements IPostProcessor {
}
/**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.extension.IPostProcessor#postComparison(org.eclipse.emf.compare.Comparison,
+ * org.eclipse.emf.common.util.Monitor)
+ */
+ public void postComparison(Comparison comparison, Monitor monitor) {
+ }
+
+ /**
* Creates the difference extensions in relation to the existing {@link DiffElement}s.
*
* @param element
diff --git a/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
index 7ec5cba29..94a2c36a6 100644
--- a/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare/META-INF/MANIFEST.MF
@@ -26,7 +26,7 @@ Export-Package: org.eclipse.emf.compare,
Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="2.5.0"
Bundle-ActivationPolicy: lazy
-Import-Package: com.google.common.base;version="[10.0.0,11.0.0)",
- com.google.common.cache;version="[10.0.1,11.0.0)",
- com.google.common.collect;version="[10.0.0,11.0.0)",
- com.google.common.util.concurrent;version="[10.0.1,11.0.0)"
+Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
+ com.google.common.cache;version="[11.0.0,15.0.0)",
+ com.google.common.collect;version="[11.0.0,15.0.0)",
+ com.google.common.util.concurrent;version="[11.0.0,15.0.0)"
diff --git a/plugins/org.eclipse.emf.compare/about.mappings b/plugins/org.eclipse.emf.compare/about.mappings
deleted file mode 100644
index a28390a75..000000000
--- a/plugins/org.eclipse.emf.compare/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/plugins/org.eclipse.emf.compare/about.properties b/plugins/org.eclipse.emf.compare/about.properties
index f4451d287..76b7ed663 100644
--- a/plugins/org.eclipse.emf.compare/about.properties
+++ b/plugins/org.eclipse.emf.compare/about.properties
@@ -19,7 +19,6 @@ featureName=EMF Compare
featureText=EMF Compare - Model Comparison\n\
Version: {featureVersion}\n\
-Build id: {0}\n\
\n\
(c) Copyright Obeo and others. 2006, 2012. All rights reserved.\n\
\n\
diff --git a/plugins/org.eclipse.emf.compare/build.properties b/plugins/org.eclipse.emf.compare/build.properties
index 4708577f6..38d28d23d 100644
--- a/plugins/org.eclipse.emf.compare/build.properties
+++ b/plugins/org.eclipse.emf.compare/build.properties
@@ -13,7 +13,6 @@ bin.includes = .,\
plugin.properties,\
about.html,\
about.ini,\
- about.mappings,\
about.properties,\
modeling32.png
jars.compile.order = .
@@ -22,7 +21,6 @@ source.. = src-gen/,\
output.. = bin/
src.includes = about.html,\
about.ini,\
- about.mappings,\
about.properties,\
modeling32.png,\
model/
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
index 67eff7801..db03a30b1 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/EMFCompare.java
@@ -207,6 +207,10 @@ public class EMFCompare {
}
}
+ for (IPostProcessor iPostProcessor : postProcessors) {
+ iPostProcessor.postComparison(comparison, monitor);
+ }
+
return comparison;
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java
index 0d0309966..9ef25d788 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/extension/IPostProcessor.java
@@ -29,6 +29,7 @@ public interface IPostProcessor {
* The comparison after the match step.
* @param monitor
* The monitor to report progress or to check for cancellation
+ * @since 3.0
*/
void postMatch(Comparison comparison, Monitor monitor);
@@ -40,6 +41,7 @@ public interface IPostProcessor {
* The comparison after the difference step.
* @param monitor
* The monitor to report progress or to check for cancellation
+ * @since 3.0
*/
void postDiff(Comparison comparison, Monitor monitor);
@@ -51,6 +53,7 @@ public interface IPostProcessor {
* The comparison after the requirements step.
* @param monitor
* The monitor to report progress or to check for cancellation
+ * @since 3.0
*/
void postRequirements(Comparison comparison, Monitor monitor);
@@ -62,6 +65,7 @@ public interface IPostProcessor {
* The comparison after the equivalences step.
* @param monitor
* The monitor to report progress or to check for cancellation
+ * @since 3.0
*/
void postEquivalences(Comparison comparison, Monitor monitor);
@@ -73,7 +77,20 @@ public interface IPostProcessor {
* The comparison after the conflicts step.
* @param monitor
* The monitor to report progress or to check for cancellation
+ * @since 3.0
*/
void postConflicts(Comparison comparison, Monitor monitor);
+ /**
+ * This will be called by EMF Compare in order to execute the specified behavior after a comparison, from
+ * a <code>comparison</code>.
+ *
+ * @param comparison
+ * The comparison after the all steps.
+ * @param monitor
+ * The monitor to report progress or to check for cancellation
+ * @since 3.0
+ */
+ void postComparison(Comparison comparison, Monitor monitor);
+
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/MatchSpec.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/MatchSpec.java
index de955baea..9fcde8d5b 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/MatchSpec.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/internal/spec/MatchSpec.java
@@ -105,7 +105,7 @@ public class MatchSpec extends MatchImpl {
*
* @see org.eclipse.emf.ecore.impl.BasicEObjectImpl#toString()
*/
- @SuppressWarnings({"boxing", "nls" })
+ @SuppressWarnings("nls")
@Override
public String toString() {
// @formatter:off
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java
index bdf897c5b..1d86178d6 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/DefaultEqualityHelperFactory.java
@@ -10,8 +10,8 @@
*******************************************************************************/
package org.eclipse.emf.compare.match;
-import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
+import com.google.common.cache.LoadingCache;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.compare.utils.EqualityHelper;
@@ -50,7 +50,7 @@ public class DefaultEqualityHelperFactory implements IEqualityHelperFactory {
* @see org.eclipse.emf.compare.match.IEqualityHelperFactory#createEqualityHelper()
*/
public IEqualityHelper createEqualityHelper() {
- Cache<EObject, URI> cache = EqualityHelper.createDefaultCache(getCacheBuilder());
+ LoadingCache<EObject, URI> cache = EqualityHelper.createDefaultCache(getCacheBuilder());
IEqualityHelper equalityHelper = new EqualityHelper(cache);
return equalityHelper;
}
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ByTypeIndex.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ByTypeIndex.java
index a9114072d..32237ea77 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ByTypeIndex.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/ByTypeIndex.java
@@ -11,9 +11,9 @@
package org.eclipse.emf.compare.match.eobject;
import com.google.common.base.Function;
-import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
@@ -37,7 +37,7 @@ class ByTypeIndex implements EObjectIndex {
/**
* All the type specific indexes, created on demand.
*/
- private Cache<String, EObjectIndex> allIndexes;
+ private LoadingCache<String, EObjectIndex> allIndexes;
/**
* The distance function to use to create the delegates indexes.
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
index 8587631e5..4aa9fdcc2 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/EditionDistance.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.compare.match.eobject;
import com.google.common.base.Predicate;
-import com.google.common.cache.Cache;
+import com.google.common.cache.LoadingCache;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.Sets;
@@ -96,7 +96,7 @@ public class EditionDistance implements DistanceFunction {
IEqualityHelperFactory fakeEqualityHelperFactory = new DefaultEqualityHelperFactory() {
@Override
public IEqualityHelper createEqualityHelper() {
- final Cache<EObject, URI> cache = EqualityHelper.createDefaultCache(getCacheBuilder());
+ final LoadingCache<EObject, URI> cache = EqualityHelper.createDefaultCache(getCacheBuilder());
return new EqualityHelper(cache) {
@Override
protected boolean matchingURIs(EObject object1, EObject object2) {
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/URIDistance.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/URIDistance.java
index d5c4c0ef4..30f6c6b59 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/URIDistance.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/match/eobject/URIDistance.java
@@ -12,9 +12,9 @@ package org.eclipse.emf.compare.match.eobject;
import com.google.common.base.Function;
import com.google.common.base.Optional;
-import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
import com.google.common.collect.Iterables;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
@@ -40,12 +40,12 @@ public class URIDistance implements Function<EObject, Iterable<String>> {
/**
* A computing cache for the locations.
*/
- private Cache<EObject, Iterable<String>> locationCache;
+ private LoadingCache<EObject, Iterable<String>> locationCache;
/**
* A computing cache for the uri fragments.
*/
- private Cache<EObject, String> fragmentsCache;
+ private LoadingCache<EObject, String> fragmentsCache;
/**
* An optional comparison to retrieve matches already computed. This will impact the way the uri is
diff --git a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
index fa3b67675..5efeb2ef4 100644
--- a/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
+++ b/plugins/org.eclipse.emf.compare/src/org/eclipse/emf/compare/utils/EqualityHelper.java
@@ -14,6 +14,7 @@ import com.google.common.base.Function;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
+import com.google.common.cache.LoadingCache;
import java.lang.reflect.Array;
import java.util.concurrent.ExecutionException;
@@ -35,7 +36,7 @@ import org.eclipse.emf.ecore.util.FeatureMap;
*/
public class EqualityHelper extends AdapterImpl implements IEqualityHelper {
/** A cache keeping track of the URIs for EObjects. */
- private final Cache<EObject, URI> uriCache;
+ private final LoadingCache<EObject, URI> uriCache;
/**
* Creates a new EqualityHelper.
@@ -54,7 +55,7 @@ public class EqualityHelper extends AdapterImpl implements IEqualityHelper {
* @param uriCache
* the cache to be used for {@link EcoreUtil#getURI(EObject)} calls.
*/
- public EqualityHelper(Cache<EObject, URI> uriCache) {
+ public EqualityHelper(LoadingCache<EObject, URI> uriCache) {
this.uriCache = uriCache;
}
@@ -285,7 +286,7 @@ public class EqualityHelper extends AdapterImpl implements IEqualityHelper {
* The builder to use to instantiate the cache.
* @return the new cache.
*/
- public static Cache<EObject, URI> createDefaultCache(CacheBuilder<Object, Object> cacheBuilder) {
+ public static LoadingCache<EObject, URI> createDefaultCache(CacheBuilder<Object, Object> cacheBuilder) {
return cacheBuilder.build(CacheLoader.from(new URICacheFunction()));
}

Back to the top