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

Bug 358225

Summary: [EMF Compare] Extension point for IPAF registration
Product: [Modeling] EMFCompare Reporter: Arthur Daussy <arthur.daussy>
Component: CoreAssignee: EMF Compare <emf.compare-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: cedric.brun, faure.tristan, laurent.goubet
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
a new Extension Point
none
New patch cedric.brun: iplog+

Description Arthur Daussy CLA 2011-09-20 08:09:11 EDT
Created attachment 203671 [details]
a new Extension Point

I'm currently working on specific integration of the SysML language in EMF Compare.(for this implementation I use the Papyrus implementation of SysML .That is to say UML with static SysML Profile).
 To allow this enhancement I would like to add an extension point to EMF Compare which would allow to manually register ItemProviderAdapterFactory (IPAF) into EMF Compare. I'm going to explain why:
 In the SysML language (as it is implemented in MDT Papyrus) a SysML element is an UML element stereotyped with SysML static profile. That is to say that with the current implementation of EMF Compare the IPAF used would be the UML one. The ext point I would like to add allow user to manually register IPAF into EMF Compare. This ext point also introduce a notion of priority between IPAF. For example:
   The UML IPAF is automatically register by the EMF service. So with this ext point I would be able to register my own IPAF for SysML elements which would have a higher priority than UML one.
   The ext point also handle dynamic registration ( in theory because I don't really know how to test it. If you have any idea I would be please to hear it).
   I was in contact with Mikeal Barbero and he told me to discuss with you the benefits of such an ext point.  

The result of this is quiet nice I give you a screen shoot of the result below.
   http://uploadpic.org/v.php?img=FxqvxmnJB9
I give you a patch of what I have done. Would please tell what do you think about it and if it is possible to integrate into EMF Compare.

Thanks for any help you could give me.
Arthur Daussy.
Comment 1 Arthur Daussy CLA 2011-10-11 04:43:57 EDT
Created attachment 204929 [details]
New patch

Here is a new patch for the extension point:
 -> Observation discussed with Laurent Goubet taken into account
 -> Observation discussed with Mickeal Barbero to make the extension point dynamic taken into account. (Not tested - Do not know how to test dynamic extensions registry)
Comment 2 Cedric Brun CLA 2011-10-19 05:13:50 EDT
The latest patch looks good to me, opening the CQ right now.
Comment 3 Cedric Brun CLA 2011-10-24 05:17:02 EDT
The CQ has been approved by the modeling PMC, we're now waiting for the IP team clearance.
Comment 4 Cedric Brun CLA 2011-10-26 09:01:06 EDT
The Eclipse Legal team gave clearance, I just had to add Atos as contributor on a few files (AdapterUtils and EMFComparePlugin).

It's now in the git repository (7231c670c5d63dba9741bf93d3f883e02b6fe33f)

Thanks for your work !
Comment 5 Laurent Goubet CLA 2011-11-02 09:33:19 EDT
Arthur,

Just a quick note, I slightly altered your contribution while on the process of fixing memory leaks (bug 361907). Namely :

- Renamed "RegisteredItemProviderAdapterFactoryRegistery" in "RegisteredItemProviderAdapterFactoryRegistry" (typo),
- Use static methods for the RegisteredItemProviderAdapterFactoryRegistry instead of relying on a singleton instance (basically the same, but that was easier for me while working on the memory) and
- Clear the registry when the plugin is stopped.

There is an unused methods in the registry : updateAddedElementInComposedAdapterFactory. Can I remove it or do you need it for some part of your code?
Comment 6 Arthur Daussy CLA 2011-11-04 09:42:48 EDT
Yes you can remove it.

Thanks for your help.