Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327182

Summary: Custom label on connection fails to generate createContents()
Product: [Modeling] GMF-Tooling Reporter: Dennis Hendriks <dh_tue>
Component: CoreAssignee: Project Inbox <gmp.gmf-tooling-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: dh_tue
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
MultilineWrappingLabel.java: multiline wrapping label figure class
none
gmfgen.diff: Diff between gmfgen before and after the change
none
gmfgen.diff: Diff between gmfgen before and after the change none

Description Dennis Hendriks CLA 2010-10-07 02:22:28 EDT
Build Identifier: Build id: 20100917-0705 (Helios Service Release 1)

to get around GMF missing a wrappinglabel with multiline functionality that works without custom code changes, I created a MultilineWrappingLabel that has this code:

(see MultilineWrappingLabel.java attachment)

In my .gmfgraph file, I replaced the labels within the figure descriptor by custom figures, with nl.tue.gmf.figures.MultilineWrappingLabel as the 'qualified class name'. I updated the child access accordingly.

I then updated the gmfgen by regenerating it from the gmfmap. For most labels (the ones contained in rectangles), this works very well, and the setTextWrap is indeed called.

However, one of my labels is contained in a 'Polyline Connection'. I did the same: I replaced the label by a custom figure. When I generate a diff between the gmfgen before and after the change, I see this (note that I replaced "&#xA;" by actual newlines to get a readable diff):

(see gmfgen.diff attachment)

The interesting change is that within the EdgeFigure constructor, the createContents method is no longer called, and that the createContents() method is no longer generated at all. This cases the label not to be created, resulting in NullPointerExceptions at runtime.

Reproducible: Always
Comment 1 Dennis Hendriks CLA 2010-10-07 02:23:52 EDT
Created attachment 180389 [details]
MultilineWrappingLabel.java: multiline wrapping label figure class
Comment 2 Dennis Hendriks CLA 2010-10-07 02:24:58 EDT
Created attachment 180390 [details]
gmfgen.diff: Diff between gmfgen before and after the change
Comment 3 Dennis Hendriks CLA 2010-10-07 02:26:53 EDT
Created attachment 180391 [details]
gmfgen.diff: Diff between gmfgen before and after the change

The diff was wrong: switched the two files.