|Re: Refer to an EAttribute of a different model [message #431494 is a reply to message #431492]
||Mon, 13 July 2009 14:46
| Ed Merks
Registered: July 2009
Sebastian Fuchs wrote:
> It works when I specify "modelProperty" as an EObject.
> When loading ressource
> platform:/plugin/org.eclipse.emf.ecore/model/Ecore in Editor.ecore
> to specify "modelProperty" as an EAttribute, I can't select any value
> in PersonEditor.xmi after reopening the xmi-editor.
Well, Ecore being it's own meta model does lead to some odd cases. But
I do expect your generated model to refer to the actual
EcorePackage.Literals.EATTRIBUTE instance and for loaded *.ecore models
to have objects that are an instance of that class...
> Overall it works now - thank you.
> Ed Merks schrieb:
>> In all cases, if you use Load Resource... to load a resource, the
>> objects in that resource will be available for any feature whose type
>> allows that object. So loading Person.ecore into the
>> PersonEditor.xmi shoudl make the Person EClass and the name
>> EAttribute available...
>> Sebastian Fuchs wrote:
>>> Hi Joel,
>>> Unfortunately I am not sure WHICH metamodel you mean.
>>> Here is what I want:
>>> // the metamodel for all possible editors in applications
>>> // MM2
>>> - EClass TextField
>>> - EAttribute EString 'label' // the label of the Field
>>> - EReference EAttribute 'modelProperty' // the Property of an
>>> (yet) unknown datamodel to show
>>> // the datamodel for a concrete application
>>> // M1
>>> - EClass Person
>>> - EAttribute EString 'name' // the name of a Person
>>> // model of a person editor of the concrete application
>>> // dynamic instance of Editor.ecore
>>> // M2
>>> - TextField
>>> - label = "Person's name"
>>> - modelProperty = ***Person.ecore#EAttribute('name')***
>>> So far I am not able to either select Person nor one of its attribute
>>> in the properties view of the PersonEditor.xmi-Editor.
>>> I even tried to let Person be an dynamic instance of the ecore-model
>>> (platform:/plugin/org.eclipse.emf.ecore/model/Ecore) without success.
>>> Joel Greenyer schrieb:
>>>> Hello Sebastian,
>>>> to pinpoint the attribute value, you can reference the data object
>>>> and the EAttribute in the (meta-)model.
Powered by FUDForum
. Page generated in 0.01620 seconds