Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Filter EObject-Tree shown in aird Editor
Filter EObject-Tree shown in aird Editor [message #1804404] Mon, 25 March 2019 14:32 Go to next message
Konrad Jünemann is currently offline Konrad JünemannFriend
Messages: 93
Registered: December 2018
Member
Hi,

I have a large XText-Model that consists of several, cross-linked files. Loading all of them into an aird-file takes a long time and result in crashes, as too many GUID objects are created (I assume for the tree control).

I would like to tackle this problem with 2 ideas:
1. I would like to restrict the kind of EObjects are shown in the tree view and only show the "top-level" EObjects (it's just one per file) and omit its children.
2. I would like to restrict which resources are loaded into an aird-file when an EObject is added. Currently, almost the whole model is loaded. I would rather work with mutliple, smaller aird-files (and thus sessions) which are only created when they are really needed. Each aird-File should contain only a subset of the whole model.

My questions are as follows:
Regarding 1.: Is it correct, that I could achieve something like this (i.e., restricting the kind of EObjects shown in the aird-File by extension the Common Navigator Framework (CNF) extension point? If not, what would be the best approach to achive my goal?

Regarding 2.: How can I achieve to load not all referenced Resources when adding an EObject to a session? My idea was to overwrite
DAnalysisSessionImpl.collectAllReferencedResources
and filter the returned resources. Is this the right idea or is there a better way?

Thanks!
Re: Filter EObject-Tree shown in aird Editor [message #1804405 is a reply to message #1804404] Mon, 25 March 2019 15:07 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 516
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Konrad,

1- Using the CNF can allow you to reduce the amount of data displayed in the Model Explorer view, another idea could be to activate the "groups" as described in the Model Explorer part of the User manual [1]. Note that this will have no impact on the load mecanisms. But both solutions could help to reduce the amount of time required to build de explorer view content (and reduce the amount of SWT handles).

2- Sirius needs the whole domain model to be loaded and resolved to work correctly (stable and safe result for the evaluation of interpreted expressions used to define the modeler, use of the cross references, ..) . When Sirius opens a session
, it loads and resolve all the referenced semantic/domain resources. If you split your project and the aird into several aird files, it could have an impact but only if the load/resolve of the reference Xtext files triggers the load of a subset of your files.
Note that regarding the changes you will make from one of this session, it could break the other aird files which will not be loaded (they might reference elements whose uri/uriFragment will change due to modifications done in one of the "sub" aird).

Overriding DAnalysisSessionImpl.collectAllReferencedResource is not a good idea. I have update my answer on your other post to add references to the slides of the video.

[1] https://www.eclipse.org/sirius/doc/user/general/Modeling%20Project.html#ModelExplorer


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Filter EObject-Tree shown in aird Editor [message #1804406 is a reply to message #1804405] Mon, 25 March 2019 15:27 Go to previous messageGo to next message
Konrad Jünemann is currently offline Konrad JünemannFriend
Messages: 93
Registered: December 2018
Member
Hi Maxime,

thanks for your reply, I did not realize you answered to my other question.

Regarding 1: Thanks for that advice, I will look into both options.

Regarding 2: I've looked into all of these resources before, although I did not study the examples provided by Cedric in greater detail (FowlerDsl, etc.) I will do this as a next step.
- However, most reasons seem to be related to the problem of enabling the user to modify the same model by XText and Sirius - in my case I only want the user to modify the model through XText. This should simplify the issue, as the Sirius model can never be dirty, should it not?
- Furthermore, if Entity A references a Library Function L but not Entity B, while B references L as well, there is a transitive relation between A and B, but I would not want to load B automatically when I load A. Imagine L is Type "String": I would not want to automatically load all other Strings into the model, just because A is a String, right? What would be the correct way to achieve this behavior, if the mentioned collectAllReferencedResource is not the right way? My Idea was to stop the transitive cross-reference-resolution at library types, e.g., at the mentioned String-Resource.

Thank you very much for your help, I was beginning to think I am alone on this. :-)

Konrad
Re: Filter EObject-Tree shown in aird Editor [message #1804595 is a reply to message #1804406] Fri, 29 March 2019 07:46 Go to previous message
Konrad Jünemann is currently offline Konrad JünemannFriend
Messages: 93
Registered: December 2018
Member
Wuick Follow-up question regarding Topic 1):

How can I prevent EObjects from being shown in the aird-Editor / Model Explorer? The sirius UI plugin does not seem to provide an extension point for doing so, and I think the CNF only allows me to add content to those views. Temporarily, I was able to prevent all EObject-Items from being generated in those views by simply using the already provided filters, but however I now do not have any Entries shown in those views...

The group feature unfortunately did not help to resolve my issue either, as the group's child elements still seemed to be created in an eager fashion.
Previous Topic:Tree Representation: delete sub-element reference
Next Topic:Diagram sirius and progress bar
Goto Forum:
  


Current Time: Sat Apr 20 03:54:46 GMT 2024

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

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

Back to the top