Model Resolving step [message #1698967] |
Fri, 19 June 2015 08:25 |
Gabriel Pascual Messages: 31 Registered: April 2013 Location: Laval, France |
Member |
|
|
Hi,
I would access to step of Model Resolving [1] programmatically but, after reading the documentation, the only thing I can do is to extend the normal behaviour with both extension points.
For example before run a comparison, I would launch the Model Resolving step which uses IModelResolver and IResourceDependencyProvider
and other interesting classes but all is in internal scope. Otherwise, this step could be interesting to detect which are resources might be impacted by the next action.
I saw also that in RCP EMF Compare plugin, several registry(DiffEngine, PostProcessor, ....) are accessible.
In the same way, it would be interesting to access to step of Model Resolving.
Regards
Gabriel
1: https://www.eclipse.org/emf/compare/documentation/latest/developer/developer-guide.html#Model_Resolving
Software Development Engineer
|
|
|
Re: Model Resolving step [message #1699284 is a reply to message #1698967] |
Tue, 23 June 2015 08:51 |
|
Hi Gabriel,
The model resolving has internal details that we do not plan on making public API, but you should still be able to access this step programmatically from the facades available.
If you have a model file as a starting point, you might want to start from platform :
final IModelProviderDescriptor[] descriptors = ModelProvider.getModelProviderDescriptors();
ModelProvider modelProvider = null;
for (IModelProviderDescriptor desc : descriptors) {
if ("org.eclipse.emf.compare.model.provider".equals(desc.getId())) {
modelProvider = desc;
}
}
ResourceMapping[] mappings = desc.getMappings(file, ResourceMappingContext.LOCAL_CONTEXT, new NullProgressMonitor());
Since this will give you the "emf" model provider (ours), the "mappings" array will contain a single EMFResourceMapping. call "getTraversals" on that for the list of files related to the one you gave as input.
You could also simply rely on EMF Compare to build your scope for you.... And writing this answer, I now understand what you mean, there are no API ways to create default instances of our IModelResolver and IModelMinimizer subclasses needed by the ComparisonScopeBuilder. Please open an enhancement request against EMF Compare for this on the bugzilla
Laurent Goubet
Obeo
[Updated on: Tue, 23 June 2015 08:52] Report message to a moderator
|
|
|
Re: Model Resolving step [message #1699659 is a reply to message #1699284] |
Thu, 25 June 2015 15:21 |
Gabriel Pascual Messages: 31 Registered: April 2013 Location: Laval, France |
Member |
|
|
Hi Laurent,
Thanks for your help, I created the bug.
Indeed, if I combine your solution to access to IModelResolver and the extension point, I will be able to use my implementation of IModelResolver.
In fact, I needed to replace EMF Compare Scope (Workspace, Project, ...) by mine. To succeed, I had to override different internal implementations (ThreadedModelResolver, ResourceDependencyResolver and DefaultResolutionContext).
Regards
Gabriel
Software Development Engineer
|
|
|
Powered by
FUDForum. Page generated in 0.03198 seconds