How to obtain an EAttributes property name? [message #423579] |
Thu, 02 October 2008 10:29  |
Eclipse User |
|
|
|
Dear all,
let's assume I have an Editor generated out of an Ecore model with
several parameters (EAttributes).
Within a method I obtain an EAttribute of a specific type. I would like
to present the EAttribute's name to the user. Hence if I use the
EAttribute.getName() method I only get the "models" EAttribute name
(like "myParam") but not the representation as e.g. in the generated
PropertySheet of the editor.
I realise that this is related to the EObject's PropertyDescriptors and
what I am looking for is what's e.g. in the
"_UI_[ObjectType]_[Feature]_feature" constant in the plugin.properties
file of the object providers (e.g. [ObjectType]ItemProvider). I just
don't know how to access this "string" given an EAttribute and the
related EObject.
An help?!
With regards, Morten.
|
|
|
Re: How to obtain an EAttributes property name? [message #423587 is a reply to message #423579] |
Thu, 02 October 2008 11:46  |
Eclipse User |
|
|
|
Morten,
Comments below.
Morten MacFly wrote:
> Dear all,
>
> let's assume I have an Editor generated out of an Ecore model with
> several parameters (EAttributes).
> Within a method I obtain an EAttribute of a specific type. I would like
> to present the EAttribute's name to the user. Hence if I use the
> EAttribute.getName() method I only get the "models" EAttribute name
> (like "myParam") but not the representation as e.g. in the generated
> PropertySheet of the editor.
> I realise that this is related to the EObject's PropertyDescriptors and
> what I am looking for is what's e.g. in the
> "_UI_[ObjectType]_[Feature]_feature" constant in the plugin.properties
> file of the object providers (e.g. [ObjectType]ItemProvider). I just
> don't know how to access this "string" given an EAttribute and the
> related EObject.
>
If you know there is a property descriptor for it, you could adapt the
owner object to IItemPropertySource (AdapteFactoryContentProvider
supports that), use getPropertyDescriptor with the feature object as the
ID, and then call getDisplayName.
> An help?!
>
> With regards, Morten.
>
|
|
|
Powered by
FUDForum. Page generated in 0.03116 seconds