Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problems displaying EMF-Properties in GMF-PropertiesView
Problems displaying EMF-Properties in GMF-PropertiesView [message #70529] Fri, 27 October 2006 03:10 Go to next message
Eclipse UserFriend
Hi,

I've got a GMF-generated Editor working with my EMF-generated Modelcode.
I extended some of the EMF-PropertyProviders to show some more
Properties (eg. Properties of subnodes that don't have a graphical
Representation). I used IItemPropertyDescriptorDecorators for adding the
Properties that I want to the parentNodes-PropertyDescriptorArray.
My XYItemPropertyProvider are stateful.

When I use the EMF-editor, the Properties are all displayed, but when I
mark the same node in the diagram of the GMF-Editor, only one of the
added Properties gets displayed.

I debugged the code and found the following method where the error occurs:
The method
protected Map getLocalDescriptors() {
if (descriptors == null) {
descriptors = new HashMap();
features = new HashMap();
super.getPropertyDescriptors(); *<-- gives correct amount of
Descriptors (amount is 7)
}
return descriptors;
}
in
org.eclipse.gmf.runtime.emf.ui.properties.descriptors.EMFCom positePropertySource
got me the correct amount of PropertyDescriptors from the superclass
(see *), but the descriptors-HashMap contains only three of them!!
Although the descriptors-HashMap has a size of 16, only three items are
not null.

Could anyone please tell me how or where in the code the
PropertyDescriptors of the superclass are mapped to the
descriptors-HashMap? Debugging did not give me answers at all.

Did anyone encounter a similar problem?

Any help is very much appreciated!!

Greets Alex Haag
Re: Problems displaying EMF-Properties in GMF-PropertiesView [message #71064 is a reply to message #70529] Fri, 27 October 2006 14:59 Go to previous messageGo to next message
Eclipse UserFriend
Looks like the call to super.getPropertyDescriptors() (in
#getLocalDescriptors) calls the polymorphic #createPropertyDescriptor,
which is implemented by EMFCompositePropertySource to cache the
descriptor in its local HashMap.

--Linda

Alex Haag wrote:
> Hi,
>
> I've got a GMF-generated Editor working with my EMF-generated Modelcode.
> I extended some of the EMF-PropertyProviders to show some more
> Properties (eg. Properties of subnodes that don't have a graphical
> Representation). I used IItemPropertyDescriptorDecorators for adding the
> Properties that I want to the parentNodes-PropertyDescriptorArray.
> My XYItemPropertyProvider are stateful.
>
> When I use the EMF-editor, the Properties are all displayed, but when I
> mark the same node in the diagram of the GMF-Editor, only one of the
> added Properties gets displayed.
>
> I debugged the code and found the following method where the error occurs:
> The method
> protected Map getLocalDescriptors() {
> if (descriptors == null) {
> descriptors = new HashMap();
> features = new HashMap();
> super.getPropertyDescriptors(); *<-- gives correct amount of
> Descriptors (amount is 7)
> }
> return descriptors;
> }
> in
> org.eclipse.gmf.runtime.emf.ui.properties.descriptors.EMFCom positePropertySource
>
> got me the correct amount of PropertyDescriptors from the superclass
> (see *), but the descriptors-HashMap contains only three of them!!
> Although the descriptors-HashMap has a size of 16, only three items are
> not null.
>
> Could anyone please tell me how or where in the code the
> PropertyDescriptors of the superclass are mapped to the
> descriptors-HashMap? Debugging did not give me answers at all.
>
> Did anyone encounter a similar problem?
>
> Any help is very much appreciated!!
>
> Greets Alex Haag
Re: Problems displaying EMF-Properties in GMF-PropertiesView [message #73755 is a reply to message #71064] Fri, 03 November 2006 03:16 Go to previous message
Eclipse UserFriend
Hi Linda,

thanks for your answer! I'm sorry that I'm answering so late, but I've
been on holidays for four days.

Back to the problem:
I know now, that the problem is the HashMap you proposed or rather the
features that are used to add the propertyDescriptors into the HashMap.
These features are all the same for my added properties, because they
all come from the same property but from a different childnode.

I think I can solve the problem by overriding the getFeature(Object o)
-method in the XYZItemPropertyDescriptorDecorator, but I don't know what
exactly I should return then?
Should I just change the name of the feature or what else could I do to
make the feature unique?
Do I really need to return a feature or would a String-Object be enough?

Thanks for your help

Greets Alex Haag

Linda Damus wrote:
> Looks like the call to super.getPropertyDescriptors() (in
> #getLocalDescriptors) calls the polymorphic #createPropertyDescriptor,
> which is implemented by EMFCompositePropertySource to cache the
> descriptor in its local HashMap.
>
> --Linda
>
Previous Topic:edit Figures at runtime with external program
Next Topic:GMF editor with EMF page
Goto Forum:
  


Current Time: Sat Jul 12 17:13:02 EDT 2025

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

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

Back to the top