| Diagram code generation generates invalid code [message #119283] | 
Fri, 13 April 2007 19:48   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: adolfo.correia.siliconstrategy.com.br 
 
I am learning about GMF and I decided to take the GMF tutorial with the  
mindmap example (http://wiki.eclipse.org/index.php/GMF_Tutorial). 
 
When I try to generate code for the diagram, eclipse (successfully)  
generates invalid code. The error is on the  
 org.eclipse.gmf.examples.mindmap.diagram.edit.parts.TopicEdi tPart  
generated class. 
 
The method in error is: 
 
protected boolean addFixedChild(EditPart childEditPart) { 
  if (childEditPart instanceof TopicNameEditPart) { 
    ((TopicNameEditPart) childEditPart).setLabel( 
      getPrimaryShape().getFigureTopicNameFigure()); 
    return true; 
  } 
  return false; 
} 
 
The return type of getPrimaryShape() is  
org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel, and there is no  
method getFigureTopicNameFigure() in this class. 
 
The strange thing is that the WrapLabel class is an API class and it would  
never have a method based on my model (TopicNameFigure is defined on the  
Graphical Definition). This seams like a bug to me, but maybe I'm wrong. 
 
Another interesting thing is that the error disappers if I remove the  
Feature Label Mapping on the Mapping Definition. So I guess this is the  
place to investigate further, but I'm clueless since I'm a GMF newbie. 
 
I'm using Eclipse 3.3M4 and GMF 2.0.0.v20070103 available on the Europa  
update site. 
 
Any suggestions on what to do now? 
 
Regards, 
Adolfo Correia
 |  
 |  
  | 
 | 
Powered by 
FUDForum. Page generated in 0.44639 seconds