Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327182 - Custom label on connection fails to generate createContents()
Summary: Custom label on connection fails to generate createContents()
Status: NEW
Alias: None
Product: GMF-Tooling
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-07 02:22 EDT by Dennis Hendriks CLA
Modified: 2010-10-07 02:26 EDT (History)
1 user (show)

See Also:


Attachments
MultilineWrappingLabel.java: multiline wrapping label figure class (616 bytes, text/plain)
2010-10-07 02:23 EDT, Dennis Hendriks CLA
no flags Details
gmfgen.diff: Diff between gmfgen before and after the change (1.29 KB, text/plain)
2010-10-07 02:24 EDT, Dennis Hendriks CLA
no flags Details
gmfgen.diff: Diff between gmfgen before and after the change (1.29 KB, text/plain)
2010-10-07 02:26 EDT, Dennis Hendriks CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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 "
" 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.