Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 337916

Summary: EMFCompare does not work with resources that use content types
Product: [Modeling] EMFCompare Reporter: John Conlon <jconlon>
Component: CoreAssignee: EMF Compare <emf.compare-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jconlon, laurent.goubet
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description John Conlon CLA 2011-02-22 17:28:49 EST
Build Identifier: M20100909-0800

When EMF model plugins have registered extension points for org.eclipse.core.contenttype.contentTypes/contentType for model resources (in an RCP running EMF 2.6.0/Helios SR1)

Comparing two model resources, only shows a text compare not EMFCompare (1.1.1)  even though the file extension is defined in the user Preferences for EMFCompare. 

If the contentType definition in the model is removed EMFCompare works.


Reproducible: Always

Steps to Reproduce:
1. Create an RCP that uses EMF
2. Register org.eclipse.core.contenttype.contentTypes/contentType extension point for the EMF resource.
3. Launch the RCP, define an EMFCompare user preference for the model file extension and compare two instance of that EMF model resource.
Comment 1 Laurent Goubet CLA 2011-05-03 08:30:04 EDT
This is (or at least, was) due to Platform/Compare only considering the very first content type it finds when searching for comparison viewers; we have no way to influence this. However, IIRC, they added a drop-down list to allow users to switch from one viewer to the other (Text to EMF in your case) and back on the compare editor that opens up.

For the time being, you can try and bind your own content types to EMF Compare's viewers (note that if you do, registering your extension in the preference for EMF Compare is no longer needed) :

<extension point="org.eclipse.compare.contentMergeViewers">
  <contentTypeBinding
    contentMergeViewerId="org.eclipse.emf.compare.ui.contentmergeviewer.ModelContentMergeViewer"
    contentTypeId="my.content.type.id"/>
</extension>
<extension point="org.eclipse.compare.structureMergeViewers">
  <contentTypeBinding
    structureMergeViewerId="org.eclipse.emf.compare.ui.structuremergeviewer.ModelStructureMergeViewer"
    contentTypeId="my.content.type.id"/>
</extension>
Comment 2 Laurent Goubet CLA 2011-05-03 08:30:37 EDT
Closing as wontfix as we cannot do any more to influence this.