Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Grouping items in a table
Grouping items in a table [message #1710735] Thu, 08 October 2015 18:23 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 672
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I have a Table line that contains a lot of elements, each of which are
related to a year: S1 contains S2 and S2 has a feature referencing S3
which has a year. The S3 object are contained elsewhere (in S1's
parent). I would like show the S2 object under S1, but group them under
S3s, so that I get another level:
- S1
--S3
---S2

Is it possible to group element in a list this way?

I can easily create a Semantic Candidate to get the S3s in a line
underneath the S1s. But then I have problems getting the S2s that both
are related to S2 and contained in the S1 at the top. Is it possible
for a Semantic Candidate Expression to refer to both the target element
(i.e. self in this context) AND its parent? Then I can do something
like parent.s2s.filter(s2|s2.s3 = self).

Hallvard
--
Hallvard Trætteberg (hal@xxxxxxxx.no)
Associate Professor, IS group, Dept. of Computer and Information
Science at the
Norwegian Univ. of Science and Technology
Re: Grouping items in a table [message #1711395 is a reply to message #1710735] Thu, 15 October 2015 14:23 Go to previous message
Laurent Fasani is currently offline Laurent FasaniFriend
Messages: 177
Registered: October 2014
Senior Member
Le 08/10/2015 20:23, Hallvard Trætteberg a écrit :
> Hi,
>
> I have a Table line that contains a lot of elements, each of which are
> related to a year: S1 contains S2 and S2 has a feature referencing S3
> which has a year. The S3 object are contained elsewhere (in S1's
> parent). I would like show the S2 object under S1, but group them under
> S3s, so that I get another level:
> - S1
> --S3
> ---S2
>
> Is it possible to group element in a list this way?

yes it is.
You can either write you own expression query or call a service

If you work on Sirius 3, I advise that you use AQL as query language.
It is the recommended and the simplier one. Here is the doc [1]
You can use standard aql services filter, including or eInverse(to get
the inverse references) etc

If you think the query is too complicated you can call a java service
that will return the candidates elements. See doc [2]

>
> I can easily create a Semantic Candidate to get the S3s in a line
> underneath the S1s. But then I have problems getting the S2s that both
> are related to S2 and contained in the S1 at the top. Is it possible for
> a Semantic Candidate Expression to refer to both the target element
> (i.e. self in this context) AND its parent? Then I can do something like
> parent.s2s.filter(s2|s2.s3 = self).
>
> Hallvard

[1] https://www.eclipse.org/acceleo/documentation/aql.html
[2]
http://help.eclipse.org/mars/topic/org.eclipse.sirius.doc/doc/specifier/general/Writing_Queries.html?cp=69_2_7_6#service_methods


Laurent Fasani - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:How to hide selected items in Pane Based Selection Wizard?
Next Topic:External Java action when changing context of an element
Goto Forum:
  


Current Time: Mon Mar 08 07:44:10 GMT 2021

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

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

Back to the top