Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Control order of table lines when sublines are reused
Control order of table lines when sublines are reused [message #1836809] Thu, 14 January 2021 12:44 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Hi, I have a simple recursive tree structure, think folders and files.

I want to show this in a sirius table, so that a folder shows its files first, and then its subfolders.

I have a linemapping for folder, and a linemapping for file. In folder, I add the folder mapping to 'reused sublines', so that nested folders/files are displayed in the table. However, I now no longer have control over which elements come first for a given folder. It looks like sirius always renders the reused lines first, and then the explicitly modeled lines, and I want it the other way round in this case. Is there a trick I can use? A viewer sorter? something?

Thanks,
Felix




Re: Control order of table lines when sublines are reused [message #1836907 is a reply to message #1836809] Mon, 18 January 2021 13:27 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hi Felix,

I tested (see sample in attachment) with EPackage/Eclass to reproduce the idea. On my EPackage linemapping, for the "Reused sub line" field, I added the EPackage linemapping and then the EClass linemapping. On my table, sub levels are displayed with EPackage first and EClass afterward.
Does this answer your issue or I missed something?

Best regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Control order of table lines when sublines are reused [message #1837106 is a reply to message #1836907] Fri, 22 January 2021 09:05 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Exactly the same issue. What if you want the EClasses first and then the packages? I think for full control, we'd need either to have an element "ReusedLineMapping", so we can put it in a list together with the other "real" linemappings" to control the ordering, or maybe have the ability to sort elements with the help of a code contribution, like a viewer sorter.

[Updated on: Fri, 22 January 2021 09:18]

Report message to a moderator

Re: Control order of table lines when sublines are reused [message #1837136 is a reply to message #1837106] Fri, 22 January 2021 14:56 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

I replied too quickly, what I meant is, if I add the mapping on EClass, before the mapping on EPackage, then I do have the EClasses displayed first.

EPackage first:
index.php/fa/39803/0/

EClass first:
index.php/fa/39802/0/

I only used the "Reused Sub Lines" field, not the Reusing in Mappings one (But adding the mapping on EPackage to "Reused Sub Lines"did also add it to "Reused in Mappings".

Best regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Control order of table lines when sublines are reused [message #1837218 is a reply to message #1837136] Mon, 25 January 2021 10:54 Go to previous message
Felix Dorner is currently offline Felix DornerFriend
Messages: 392
Registered: December 2015
Senior Member
Ok, so you have both linemappings as direct children of the table and then reuse both in the folder mapping, and then you can control the order via the order of elements in reused submappings.

I myself created the folder mapping as a direct child of the root, and a file mapping as a child of the folder mapping. I then set the folder mapping to reuse itself. And here I can't control the order any more. Looking at how everything works in code I found that LineMappingSpec.getAllSublines() is written so that first the owned sublines and then the reused sublines are shown:

https://github.com/pcdavid/org.eclipse.sirius/blob/ce6a436eb21c004d35011fd5cf66b070a920f5dd/plugins/org.eclipse.sirius.table/src/org/eclipse/sirius/table/business/internal/metamodel/description/spec/LineMappingSpec.java#L38

That's what I mean with there's way of controlling the order. I might get around that with your "trick" though.





Previous Topic:Understanding Etypes for attribute in Ecore
Next Topic:[Acceleo] - How to bundle Acceleo with Sirius
Goto Forum:
  


Current Time: Fri Apr 19 16:44:23 GMT 2024

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

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

Back to the top