|
Re: EMF GMF integration [message #220913 is a reply to message #220267] |
Tue, 10 March 2009 13:10 |
Alexander Shatalin Messages: 2928 Registered: July 2009 |
Senior Member |
|
|
Hello Daniel,
> Does any one have an idea that explain that? If they use the same
> editing domain, shouldnt the transactional editing domain make use of
> the adapter factory. That should be the way the
Yes, it should. This is current implementation of TransactionalEditingDomainImpl.FactoryImpl.createEditingDoma in()
method (will be executed on calling TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain()):
public synchronized TransactionalEditingDomain createEditingDomain() {
TransactionalEditingDomain result = new TransactionalEditingDomainImpl(new
ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Reg istry.INSTANCE));
mapResourceSet(result);
return result;
}
So, as you can see, newly created ComposedAdapterFactory will be actually
passed into TransactionalEditingDomainImpl constructor. This ComposedAdapterFactory
will be composed of all the AdapterFactories registered using “org.eclipse.emf.edit.itemProviderAdapterFactories”
ension-point.
In other words, answering your question, created TransactionalEditingDomainImpl
instance will make use of EMF-generated ItemProviders from EMF .edit plugin
indirectly because appropriate AdapterFactory will be registered in EMF-generated
..edit plugin using “org.eclipse.emf.edit.itemProviderAdapterFactories” extension-point.
Here is a javadoc for ComposedAdapterFactory.Descriptor.Registry.INSTANCE:
/**
* The global registry typically populated by plugin registration.
*/
This is my understanding of the situation. And, yes, all the code around
“ComposedAdapterFactory” is useless with TransactionalEditingDomain + you
can file a bugzilla request to create another factory method for TransactionalEditingDomain
like:
TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain(AdapterFactory
factory)
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.01870 seconds