Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Forms] Tree Master Detail Recursion(My Tree Master Detail recurses even with <filter ...> in extension )
icon5.gif  [EMF Forms] Tree Master Detail Recursion [message #1745700] Fri, 14 October 2016 17:33 Go to next message
Bob Bobson is currently offline Bob BobsonFriend
Messages: 13
Registered: April 2016
Junior Member
Hi Everyone,

Im having a problem with using a Tree Master Detail View to display properly and would greatly appreciate any help you could offer.

The TL;DR version of my problem:

The tree master detail view recursively opens nested versions of itself for branch nodes, despite me defining two view models for the branch type (as per the tutorial) and including the the following in my plugin.xml:

<file filePath="model/TestCaseGroupDetail.view">
	<filter key="root" value="true">
   	</filter>
</file>

<file filePath="model/TestCaseGroupTreeMaster.view">


In mode detail:

I have a tree data structure defined in my model. Each node implements TestCase. Branches are instances of TestCaseGroup; leafs are ExampleTestCase.

I have one view model defined for ExampleTestCase

I have two defined for TestCase Group (TestCaseGroupDetail.view and TestCaseGroupTreeMaster.view)

TestCaseGroupDetail.view contains:

<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/170" xmi:id="_B-60kJIdEeaEPv13gebBNw" name="TestCaseGroup" ecorePath="/com.dnvgl.csec.jtf.core.model/model/model.ecore">
  <rootEClass href="http://www.example.org/model#//TestCaseGroup"/>
  <children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_B-_tEJIdEeaEPv13gebBNw" name="Control Name">
    <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_B-_tEZIdEeaEPv13gebBNw">
      <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.example.org/model#//TestCase/Name"/>
    </domainModelReference>
  </children>
  <children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_B-_tEpIdEeaEPv13gebBNw" name="Control Description">
    <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_B-_tE5IdEeaEPv13gebBNw">
      <domainModelEFeature xsi:type="ecore:EAttribute" href="http://www.example.org/model#//TestCase/Description"/>
    </domainModelReference>
  </children>
  <children xsi:type="org.eclipse.emf.ecp.view.model:Control" xmi:id="_B-_tFJIdEeaEPv13gebBNw" name="Control Tests">
    <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference" xmi:id="_B-_tFZIdEeaEPv13gebBNw">
      <domainModelEFeature xsi:type="ecore:EReference" href="http://www.example.org/model#//TestCaseGroup/Tests"/>
    </domainModelReference>
  </children>
</org.eclipse.emf.ecp.view.model:View>


TestCaseGroupTreeMaster.view: contains:

<?xml version="1.0" encoding="ASCII"?>
<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model/170" xmlns:org.eclipse.emf.ecp.view.treemasterview.model="http://org/eclipse/emf/ecp/view/treemasterview/model" xmi:id="_3w2eEJIcEeaEPv13gebBNw" name="TestCaseGroup" ecorePath="/com.dnvgl.csec.jtf.core.model/model/model.ecore">
  <rootEClass href="http://www.example.org/model#//TestCaseGroup"/>
  <children xsi:type="org.eclipse.emf.ecp.view.treemasterview.model:TreeMasterDetail" xmi:id="_MDYjIJIdEeaEPv13gebBNw" name="Test Tree"/>
</org.eclipse.emf.ecp.view.model:View>


The view of the initial TestGroup is displayed as desired. However, clicking on child TestGroup's opens a whole nested TreeMasterDetail view in the details panel (i.e recursion). I thought this was what the <filter ..> stuff in the extension point was meant to prevent?

I'm relatively new to EMF and EMF forms and so may be doing something stupid. Am i missing something?

Thanks in advance for your help!

Re: [EMF Forms] Tree Master Detail Recursion [message #1745753 is a reply to message #1745700] Mon, 17 October 2016 08:16 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 125
Registered: May 2015
Senior Member
Hi Bob,
Your setup looks correct.
Could you share your model and view model so I can take a look at this?

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Tree Master Detail Recursion [message #1745763 is a reply to message #1745753] Mon, 17 October 2016 10:12 Go to previous messageGo to next message
Bob Bobson is currently offline Bob BobsonFriend
Messages: 13
Registered: April 2016
Junior Member
Hi Eugen,


Thanks for the speedy reply Smile

Attached are my model and two view models, let me know if you need more information.
Re: [EMF Forms] Tree Master Detail Recursion [message #1745831 is a reply to message #1745700] Tue, 18 October 2016 07:30 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 125
Registered: May 2015
Senior Member
Hi Bob,
I created two projects out of your provided files. (see attached zip)
For me everything works as expected.
index.php/fa/27390/0/

Can you please check your view registration?

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Tree Master Detail Recursion [message #1746003 is a reply to message #1745831] Thu, 20 October 2016 10:37 Go to previous messageGo to next message
Bob Bobson is currently offline Bob BobsonFriend
Messages: 13
Registered: April 2016
Junior Member
Hi Eugen,

Thanks again for the reply.

I have copied the copied and pasted the extension point info from your exmple view project without change.

Unfortunatly the problem still occurs. The top Group in the tree displays as expected, but nested sub groups cause nested/recursive views. As per this screenshot:

index.php/fa/27400/0/

  • Attachment: Capture.PNG
    (Size: 27.12KB, Downloaded 143 times)
Re: [EMF Forms] Tree Master Detail Recursion [message #1746014 is a reply to message #1746003] Thu, 20 October 2016 13:08 Go to previous messageGo to next message
Eugen Neufeld is currently offline Eugen NeufeldFriend
Messages: 125
Registered: May 2015
Senior Member
Hi Bob,

I think you found an error in the docu.
You are using root = true as filter. It must be detail = true.

I hope this will fix the behavior.
If so please let me know, so that we can fix the docu asap.

Cheers,
Eugen


--
Eugen Neufeld

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: [EMF Forms] Tree Master Detail Recursion [message #1746029 is a reply to message #1746014] Thu, 20 October 2016 16:13 Go to previous message
Bob Bobson is currently offline Bob BobsonFriend
Messages: 13
Registered: April 2016
Junior Member
Hi Eugen,

Fixed!

As you suggested i changed "root = true" to "detail = true" and it now works perfectly Smile

Thanks for your help in figuring this out!

Bob
Previous Topic:[EMFStore] Incorrect behavior of merge and commit
Next Topic:[TEXO][ACCELEO] Web-form Vaadin editor for Texo JPA classes
Goto Forum:
  


Current Time: Tue Sep 19 11:52:19 GMT 2017

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

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