Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Synchronizing containment and cross reference lists
Synchronizing containment and cross reference lists [message #1766271] Mon, 19 June 2017 17:15 Go to next message
Wa Lid is currently offline Wa LidFriend
Messages: 4
Registered: April 2013
Junior Member
Hi, I am fairly new to emf and I wonder how I can sync between a containment and cross reference lists

My class structure is the following

SubComponent
component // parent component, a container reference

Input > SubComponent
Output > SubComponent

Component > subComponent //super type
subComponents : [0..*] SubComponent // a containement reference
inputs : [0..*] Input
outputs : [0..*] Output


So, in my application, sometimes I need to handle all subcomponents in a way, and sometimes I need to apply specific operations only on input and outputs.

I know I can can walk through the subcomponents list and filter on inputs and outputs, or add them by hand in each list whenever I add an input or input to a Component, but is there a way to tell emf to sync between subcomponents and inputs and outpus lists, so that when I add or remove an Input (output) from the subcomponents list, it gets removed from the inputs (outputs) list as well ?


[Updated on: Mon, 19 June 2017 17:22]

Report message to a moderator

Re: Synchronizing containment and cross reference lists [message #1766275 is a reply to message #1766271] Mon, 19 June 2017 19:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 29545
Registered: July 2009
Senior Member
No, there's nothing to automatically do that.
Re: Synchronizing containment and cross reference lists [message #1766934 is a reply to message #1766275] Wed, 28 June 2017 20:32 Go to previous message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 207
Registered: July 2009
Senior Member
You could implement an EContentAdapter to listen to model changes and add your update logic in the notification. So you do not have to take care of that at all the pieces of code where you modify the model.
Previous Topic:XText(L) -> model(L) -> JVM bytecode; which toolchain for that?
Next Topic:Remember/derive source location when loading model from xml
Goto Forum:
  


Current Time: Fri Sep 21 11:28:23 GMT 2018

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

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

Back to the top