Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Overriding the Model Resolver: impossible?
Overriding the Model Resolver: impossible? [message #1837864] Tue, 09 February 2021 00:22
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 402
Registered: March 2011
Senior Member
Hello. I need to override the behaviour of the model resolver on EMF Compare 3.3.7, but apparently it is impossible! Can anyone point out how/if it can be done?

There is an extension point "org.eclipse.emf.compare.ide.ui.modelResolvers" and it is used to register the default ThreadedModelResolver (org.eclipse.emf.compare.ide.ui.internal.logical.resolver.ThreadedModelResolver).

The problem is that when I try to provide my own model resolver, its registration fails in 'org.eclipse.emf.compare.rcp.EMFCompareRCPPlugin.register(IGraphConsumer)' (below), throwing an exception because the resolver's id has already been registered (the default one). The problem is that I cannot change that id in my resolver (ResourceUIUtil.RESOURCES_GRAPH_ID) because it is hardcoded in org.eclipse.emf.compare.rcp.ui.internal.util.ResourceUIUtil.getResourcesURIGraph() which is used extensively throughout EMF Compare!!!

	public void register(IGraphConsumer consumer) {
		consumer.setGraph(new Graph<URI>());
		String id = consumer.getId();
		if (graphsById.containsKey(id)) {
			throw new IllegalArgumentException(EMFCompareRCPMessages.getString("duplicate.graph.id.msg", id)); //$NON-NLS-1$
		}
		graphsById.put(id, consumer.getGraphView());
	}


So how on earth can one override the model resolver?

Thanks

Previous Topic:Load resources from revision control
Next Topic:loader constraint violation when launching an EMF compare comparison
Goto Forum:
  


Current Time: Sun Jul 25 01:03:50 GMT 2021

Powered by FUDForum. Page generated in 0.02056 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top