Dynamic EMF with EditingDomain [message #1233767] |
Mon, 20 January 2014 07:31  |
Eclipse User |
|
|
|
Hi,
I couldn't find any proper solution and do not if there is any.
I've got created dynamically EClasses and DynamicEObjects for these classes.
What I would like to do is to somehow create dynamic editing domain for my EObjects.
This is an example:
EClass eClass = ...;
DynamicEObjectImpl domainObject = new DynamicEObjectImpl( eClass );
ReflectiveItemProviderAdapterFactory reflectiveItemProviderAdapterFactory =
new ReflectiveItemProviderAdapterFactory();
ComposedAdapterFactory copm =
new ComposedAdapterFactory( ComposedAdapterFactory.Descriptor.Registry.INSTANCE );
copm.addAdapterFactory( reflectiveItemProviderAdapterFactory );
AdapterFactoryEditingDomain editingDomain =
new AdapterFactoryEditingDomain( copm, new BasicCommandStack() );
domainObject .eAdapters().add( new AdapterFactoryEditingDomain.EditingDomainProvider( editingDomain ) );
I don't have any resource for where object could be contained.
Even if I created one, still doesn't work.
My main idea to is to be able to open EMF Client Platform editor using dynamic EMF.
Any ideas what I am doing wrong?
Cheers,
Paweł.
|
|
|
|
|
Re: Dynamic EMF with EditingDomain [message #1233898 is a reply to message #1233879] |
Mon, 20 January 2014 14:42  |
Eclipse User |
|
|
|
> EcoreUtil.create() in the end does the same for me as new
> DynamicEObject(eClass).
Still it looks weird :p
> It is hard to say what doesn't work exactly. I know that resource is
> needed so I did eventually. I've been trying to open ECP editor which
> occurred to be empty. When I had EMF.edit plugin provided then
> everything worked fine of course.
I have no idea what ECP is. Did you try to open your model with the
reflective emf model editor? If that works, it's an ECP thing..
IIRC, the reflective model editor (actually, all EMF generated editors)
requires an URIEditorInput and manages the resource loading itself, you
cannot pass it an already loaded resource without customisation. Maybe
the same thing happens for ECP.. Did you try to save your resource and
then pass it to the editor?
|
|
|
Powered by
FUDForum. Page generated in 0.04049 seconds