Project explorer display problem [message #904333] |
Tue, 28 August 2012 05:04  |
Eclipse User |
|
|
|
Hi,
At the end of the mindmap tutorial, a screenshot shows an elements tree under the diagram file name in the project explorer.
But, I created a basic example with GMF and surprisingly, the elements tree gets displayed under the domain file...
Running in debug mode, it appears that methods like xxxNavigatorContentProvider#hasChildren are invoked if I try to expand the tree below the domain file but nothing happens when doing the same on the diagram file name in the project explorer.
Is somehow the GMF generated code "attached" to the wrong file name ?
Is there something I should change in the generated gmfgen file ?
Maybe the Gen Navigator properties regarding the content provider ?
I'm stuck. Help would be highly appreciated...
Regards,
Laurent
|
|
|
|
Re: Project explorer display problem [message #904926 is a reply to message #904450] |
Wed, 29 August 2012 07:55  |
Eclipse User |
|
|
|
Hi,
After some more investigation, it appears that the GMF templates for code generation sensibly changed since the mindmap tutorial...
The element tree under the diagram file name is not displayed because one generated line has been removed from xxNavigatorContentProvider#getChildren, just before the "return result.toArray()" statement :
result.addAll(createNavigatorItems(selectViewsByType(topViews, xxEditPart.MODEL_ID), file, false));
This causes the method to return an empty array.
When corrected, another problem appears. The "root" element name as well as the links names are left empty in the project explorer tree.
This is due to the corresponding getxxText() methods in xxNavigatorLabelProvider that systematically return an empty string.
This also differs from the former generated code in the mindmap example.
Providing the root element name and the links names solves the unnamed tree nodes problem.
I'll fill a report with the two attached files as example.
Kind regards,
Laurent
|
|
|
Powered by
FUDForum. Page generated in 0.26573 seconds