Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Project explorer display problem(Diagram elements tree displayed under domain file instead of diagram file)
Project explorer display problem [message #904333] Tue, 28 August 2012 09:04 Go to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
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 #904450 is a reply to message #904333] Tue, 28 August 2012 12:50 Go to previous messageGo to next message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
Hi again,

Actually the problem seems to be the generated xxxNavigatorContentProvider#getChildren (which slightly differs from the Mindmap tutorial one...).

When clicking on the diagram file name in the project explorer, getChildren executes the first "if" block that returns an empty ArrayList of View objects...

I modified this to match the Mindmap code. And I get the diagram file content displayed (the notation elements).

Futher modification to load the domain file instead of the diagram one, displays a node tree without the node names...
So I guess other files should be modified.

Instead I decided to adapt the xxxDomainNavigatorContentProvider#getChildren to have it work for both domain and diagram files.
And the plugin.xml file to get all domain content provider files executed instead of the diagram ones.

It works ! I get the same tree displayed for both domain and diagram files.

But, this solution will not display the "links" group as it is not implemented on domain content provider side.

Unless I got it all wrong, I think a bug report should be opened to fix all the necessary content provider files on the diagram side.

Could somebody confirm ?
Re: Project explorer display problem [message #904926 is a reply to message #904450] Wed, 29 August 2012 11:55 Go to previous message
Laurent Le Moux is currently offline Laurent Le MouxFriend
Messages: 184
Registered: September 2011
Senior Member
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
Previous Topic:How to create a compartment (circle in a circle centered) ?
Next Topic:Use a model as a library
Goto Forum:
  


Current Time: Fri Apr 19 23:34:37 GMT 2024

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

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

Back to the top