Skip to main content



      Home
Home » Archived » Visual Editor (VE) » Model questions
Model questions [message #104261] Tue, 30 August 2005 05:52 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:BeanInfo attributes
Next Topic:Indexed Propeties to be Supported?
Goto Forum:
  


Current Time: Mon Jul 14 11:34:47 EDT 2025

Powered by FUDForum. Page generated in 0.03302 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top