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

Bug 482831

Summary: Make it easier to leverage EMF.Edit customizations from Sirius representations
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: CoreAssignee: Pierre-Charles David <pierre-charles.david>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: enhancement    
Priority: P3 CC: felix.dorner, florian.barbin, laurent.fasani, laurent.redor
Version: 3.0.0Keywords: triaged
Target Milestone: 4.0.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/63873
https://git.eclipse.org/r/71694
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a1eb96a92a216a922f9cafe4b964affd5a29e113
https://git.eclipse.org/r/72871
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=3440ae5433156a880f1297f094ab7c9ae0f27631
https://git.eclipse.org/r/73813
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6dfbad649980487be4656ccd45c3b3ed6ae3f17d
Whiteboard: needtest

Description Pierre-Charles David CLA 2015-11-23 07:38:29 EST
EMF.Edit has direct support for many operations which are also conceptually available in Sirius representations, for example ItemProvider.getText() to render an EObject as plain text, which is similar to Sirius's various 'Label Expressions'.

Sophisticated EMF users with complex metamodels tend to heavily customize the generated item providers, and expect these customizations to apply as transparently as possible in all EMF-powered applications, including Sirius. While it is possible right now to delegate to the ItemProvider from Sirius, it involves writing a lot of custom Java code in the form of services to invoke from interpreted expressions.

The goal is to make it easier (maybe even the default in some cases) for specifiers to use the behavior they have specified/customized in their ItemProviders directly from Sirius representations wherever it makes sense.

Note that an important conceptual difference between the two approaches is that the behavior ItemProviders usually only depends on the underlying EObject, and is fixed (i.e. the same EObject renders as the same text in all contexts, at least when using the same ItemProvider), while in Sirius the equivalent behavior can be highly context-dependent (the same semantic elements may render in completely different ways in different representations, or even in the same representation depending on this like which viewpoints or layers are enabled).

The precise list of "operations" to take into account is yet to be determined, and not all may be implemented in the first iteration.
Comment 1 Pierre-Charles David CLA 2016-01-08 04:03:08 EST
See https://sbegaudeau.github.io/eef/specifications/emf-integration.html for initial requirements.
Comment 2 Eclipse Genie CLA 2016-02-10 05:23:22 EST
New Gerrit change created: https://git.eclipse.org/r/63873
Comment 3 Felix Dorner CLA 2016-04-08 15:41:56 EDT
Here is another example: I have used EMF.Edit to implement edge connection preconditions: For reference-based edges, the target connect precondition uses a java service method which queries the item provider to get a property descriptor for the reference and then verify whether the target object is in the list of choices for the reference.
Comment 4 Eclipse Genie CLA 2016-04-29 09:48:27 EDT
New Gerrit change created: https://git.eclipse.org/r/71694
Comment 6 Pierre-Charles David CLA 2016-05-13 11:08:54 EDT
Fixed by a1eb96a92a216a922f9cafe4b964affd5a29e113, but still missing tests.
Comment 7 Eclipse Genie CLA 2016-05-17 03:59:12 EDT
New Gerrit change created: https://git.eclipse.org/r/72871
Comment 9 Florian Barbin CLA 2016-05-26 11:06:11 EDT
The org.eclipse.sirius.ext.emf.edit.EditingDomainServices.performCommand(EObject, Class<? extends Command>, CommandParameter) method does not seem to work. In debug mode, if 'self' is type of EClass for instance, getItemProviderAdapter returns null.
Comment 10 Eclipse Genie CLA 2016-05-27 09:20:19 EDT
New Gerrit change created: https://git.eclipse.org/r/73813
Comment 12 Pierre-Charles David CLA 2016-05-27 11:28:19 EDT
Commit 6dfbad649980487be4656ccd45c3b3ed6ae3f17d fixes the issue detected with commands.
Comment 13 Pierre-Charles David CLA 2016-06-24 08:01:33 EDT
Available in Sirius 4.0.0.