Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Display Diagram Content in form of Tree View
Display Diagram Content in form of Tree View [message #647439] Thu, 06 January 2011 11:22 Go to next message
nattamol  is currently offline nattamol Friend
Messages: 6
Registered: September 2010
Junior Member
Dear Guys,

I'm new for GMF. I try to create tree view to show my diagram content beside the diagram editor.

I have searched for solution and I found "Project Explorer" that can solve my requirement

But....

I have tried to "add GenNavigator to the GMF GenModel" follow this link
( http://wiki.eclipse.org/GMF_2.0_New_and_Noteworthy#Diagram_C ontent_Navigator)

But....

What I found in my RCP Diagram Editor Application, only possibility to display "Project Explorer" view beside properties view, no content inside.

I tried to debug into the codes in xxx.diagram.navigator package. But no method is called. I'm so confuse. Why?


So please.... Crying or Very Sad

People who have ever succeeded with Tree View or Project Explorer. Please tell me the steps and configurations.


Thank you in advance. Razz
Nattamol Vittayakasemsont
Re: Display Diagram Content in form of Tree View [message #647746 is a reply to message #647439] Sat, 08 January 2011 14:41 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

displaying the structure in project explorer is not that complicated and you can press that button in the upper right of the view to sync your project explorer selection with the editor selection. Here is how it works:

To get a automatic generation of this
1) Open your gmfgen model
2) Right click the Gen Editor node
3) Select New Child
4) Select Gen Navigator
5) Create a new genmodel from your gmfmap
6) GMF should add child entries to the Gen Navigator node
7) Feel free to customize this and ask question

A better way to do this would be using a model to model transformation. But I cannot get that run.

Ralph
Re: Display Diagram Content in form of Tree View [message #647752 is a reply to message #647746] Sat, 08 January 2011 15:11 Go to previous messageGo to next message
nattamol  is currently offline nattamol Friend
Messages: 6
Registered: September 2010
Junior Member
Dear Ralph,

Thank you very much for replying.

I used to try all of those step. But it doesn't work and I'm wondering that I must do something wrongly.

So these are my question according to my mistakes (maybe).

1. Is this work only when create a new genmodel from your gmfmap without selecting "Generate RCP application", right???

2. I'm not sure that what are correct child entries of the Gen Navigator node. Would you please give me an example??

This is what I put in my GenNavigator.

<navigator>
<childReferences
child="//@diagram"/>
<childReferences
parent="//@diagram/@topLevelNodes.0"
child="//@diagram/@childNodes.0"/>
<childReferences
parent="//@diagram"
child="//@diagram/@topLevelNodes.0"/>
<childReferences
parent="//@diagram"
child="//@diagram/@topLevelNodes.1"/>
<childReferences
parent="//@diagram"
child="//@diagram/@links.0"
groupName="links"
groupIcon="icons/linksNavigatorGroup.gif"/>
<childReferences
parent="//@diagram/@links.0"
child="//@diagram/@topLevelNodes.1"
referenceType="out_target"
groupName="target"
groupIcon="icons/linkTargetNavigatorGroup.gif"/>
<childReferences
parent="//@diagram/@topLevelNodes.1"
child="//@diagram/@links.0"
referenceType="in_source"
groupName="incoming links"
groupIcon="icons/incomingLinksNavigatorGroup.gif"/>
<childReferences
parent="//@diagram/@links.0"
child="//@diagram/@topLevelNodes.0"
referenceType="in_source"
groupName="source"
groupIcon="icons/linkSourceNavigatorGroup.gif"/>
<childReferences
parent="//@diagram/@topLevelNodes.0"
child="//@diagram/@links.0"
referenceType="out_target"
groupName="outgoing links"
groupIcon="icons/outgoingLinksNavigatorGroup.gif"/>
</navigator>

Is it correct or not?


Thanks in advance again
Nattamol
Re: Display Diagram Content in form of Tree View [message #647755 is a reply to message #647752] Sat, 08 January 2011 15:34 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi,

I have this running:

<navigator>
    <childReferences
        child="//@diagram"/>
    <childReferences
        parent="//@diagram"
        child="//@diagram/@topLevelNodes.0"
        hideIfEmpty="false"/>
  </navigator>


I do not know if it is running with the RCP option, but it should not make a difference. Do you use the Project Explorer View? Other views like navigator do not show the tree structure.

Ralph

Re: Display Diagram Content in form of Tree View [message #647759 is a reply to message #647755] Sat, 08 January 2011 16:37 Go to previous messageGo to next message
nattamol  is currently offline nattamol Friend
Messages: 6
Registered: September 2010
Junior Member
Dear Ralph,

I exactly create new GMF Project with only one Item in diagram. And then I create everything simply (with all default values). And then when I reach step "5) Create a new genmodel from your gmfmap" I select RCP Application.

For step "6) GMF should add child entries to the Gen Navigator node"

I added



<navigator>
<childReferences
child="//@diagram"
hideIfEmpty="false"/>
<childReferences
child="//@diagram/@topLevelNodes.0"
hideIfEmpty="false"/>
</navigator>

But when I run my xxx.diagram project as "Eclipse Application", I got diagram (correctly) but I didn't have any content in my Project Explorer.


This is so confusing me, I think I do everything right but I can't display it. Now I'm using Eclipse Galileo : Eclipse Modeling Tools (includes Incubating components) Which version of eclipse are you using ? Is the issue of eclipse version be able to cause the problem to me?


Moreover, Is it possible that you send me the small successful project to me? I would like to try in my local machine.

Thanks again and again in advance.
Nattamol
Re: Display Diagram Content in form of Tree View [message #647877 is a reply to message #647759] Mon, 10 January 2011 09:41 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Quote:
For step "6) GMF should add child entries to the Gen Navigator node"

I added


Did you try running what GMF generated without modifying this? GMF should automatically add child references to a gen navigator as described in http://wiki.eclipse.org/GMF_Diagram_Navigator_Use_Cases .

Ralph

[Updated on: Mon, 10 January 2011 09:44]

Report message to a moderator

Re: Display Diagram Content in form of Tree View [message #647892 is a reply to message #647877] Mon, 10 January 2011 10:59 Go to previous message
nattamol  is currently offline nattamol Friend
Messages: 6
Registered: September 2010
Junior Member
Yes, I have already tried.

But when I didn't selected "RCP Application option", and then generated diagram project. After that I run it, I can't create new diagram. (Maybe I don't know the correct way to run diagram as plugin.)

Can you tell me how? I only work with selected the RCP Application option.

Thanks
Nattamol
Previous Topic:How to run Extra in-place gmfgen transformation after a reconcile step
Next Topic:From EditingDomain to EditPart
Goto Forum:
  


Current Time: Tue Apr 30 12:52:58 GMT 2024

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

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

Back to the top