Model questions [message #104261] |
Tue, 30 August 2005 05:52  |
Eclipse User |
|
|
|
Hi all,
I put the adapter on my model object so I can access to the attributes of
that object. I want to know where I find attribute "field name" shown in
"properties view" of the component.
QUESTION: Where I find "field name" attribute at the IJavaInstance of my
component, which is put for example in JPanel instance?
If I cannot find it at IJavaInstance model of my component please tell me
where I can find it.
Thank you in advance,
John Cage
|
|
|
Re: Model questions [message #104341 is a reply to message #104261] |
Tue, 30 August 2005 10:04  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
It is actually stored in another place, called the AnnotationEMF
instance. The reason for this is because fieldName is not really a
property of the java instance (like "background" color of an AWT object
is a true property of the java instance). It is an annotation stored
separately from the instance.
If all you want to do is to get the name, and not change it, then do:
IPropertySource ps =
ECoreUtil.getExistingAdapter(ijavainstance.eAdapters(),
IPropertySource.class);
IPropertyDescriptor namePD =
org.eclipse.ve.internal.cde.properties.PropertySourceAdapter .getDescriptorForID(ps,
NameInCompositionPropertyDescriptor.NAME_IN_COMPOSITION_KEY) ;
if (namePD != null)
String name = (String) ps.getPropertyValue(namePD):
--
Thanks,
Rich Kulp
|
|
|
Re: Model questions [message #610443 is a reply to message #104261] |
Tue, 30 August 2005 10:04  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
It is actually stored in another place, called the AnnotationEMF
instance. The reason for this is because fieldName is not really a
property of the java instance (like "background" color of an AWT object
is a true property of the java instance). It is an annotation stored
separately from the instance.
If all you want to do is to get the name, and not change it, then do:
IPropertySource ps =
ECoreUtil.getExistingAdapter(ijavainstance.eAdapters(),
IPropertySource.class);
IPropertyDescriptor namePD =
org.eclipse.ve.internal.cde.properties.PropertySourceAdapter .getDescriptorForID(ps,
NameInCompositionPropertyDescriptor.NAME_IN_COMPOSITION_KEY) ;
if (namePD != null)
String name = (String) ps.getPropertyValue(namePD):
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.03302 seconds