Control order of table lines when sublines are reused [message #1836809] |
Thu, 14 January 2021 07:44  |
Eclipse User |
|
|
|
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 #1837218 is a reply to message #1837136] |
Mon, 25 January 2021 05:54  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03996 seconds