Cross-referencing over models #203
Replies: 2 comments 1 reply
-
Hi, Sure, this is certainly possible. Both editors (graphical and tree editor) are eventually talking to a backend that loads EMF models. In EMF, every object is referenced via URI. For file-internal references, the URI is typically only a fragment pointing to an object (e.g. #id). For cross-file references, the URI points to another file plus the fragment to identify the object within this other file. When you load a resource in EMF, initially all cross-file references are not resolved, but proxies are installed where the referenced object would go. The proxy contains the URI that is needed to eventually resolve the reference. Once you access it or do a resolveAll (see EcoreUtils), the referenced resource is loaded into the resource set and all proxies pointing to that resource are replaced with the actual objects. For the clients, such as GLSP or tree editor, all of that doesn't really matter, because they just request a URI and get the model. The EMF Model Server deals with loading the files into the resource set and potentially resolving cross file references and returns the resulting model in the respective format (JSON or XMI). |
Beta Was this translation helpful? Give feedback.
-
Thank you for the helpful response. I am aware that the backend is capable of loading arbitrary EMF data into a workspace. What I wanted to know was if the system is able to create those cross references in The user interface. So what I am trying to say is: is there a capability much like the one in the reflective Ecore editor in the current user-interface that allows to set and commit cross-references? |
Beta Was this translation helpful? Give feedback.
-
I am trying to create cross-resource cross-references in the graphical or tree editor. Is this possible? How does it work?
Beta Was this translation helpful? Give feedback.
All reactions