Sirius Tree Description [message #1804209] |
Wed, 20 March 2019 09:20  |
Eclipse User |
|
|
|
Hi all,
I am using Eclipse Sirius to create a tree representation and I am facing an ordering problem in the resulting XML file of the representation of my model.
Lets imagine I have the following tree:
Section 1
Section 2
...
Section n
----- Under-section 1
----- Under-section 2
----- Under-section 3
....
In the representation, the difference sections are re-organized (when I refresh the tree) in the same order of definition as in the creation in the *.odesign (which seems logical).
1st question: How can I modify the code to keep the order of creation of the user rather than the order defined in the *.odesign?
Secondary problem, in the output XML file corresponding to my representation, the order of the "Under-section" is not the same as in the repesentation: they are sorted alphabetically.
2nd question: How can I modify it and have the same order as in the representation ?
I hope my message is clear enough.
Thanks in advance
Remi
|
|
|
Re: Sirius Tree Description [message #1804217 is a reply to message #1804209] |
Wed, 20 March 2019 11:30   |
Eclipse User |
|
|
|
Hello,
Concerning your first question, as you said the order is defined by the order of the mappings. If you want different type of elements to be displayed, you will need to have only one mapping where the Domain Class will be a common superclass (the Domain Class can be an abstract class) and a semantic candidate expression that return the element in this order. This may implies change in your metamodel to have this level of abstraction. For exemple, let's say that we have a family metamodel. If your metamodel has 3 class Family, Man and Woman where Family has 2 references men and women, then in your odesign you are stuck with 2 mappings, one for Man and one for Woman and they will be displayed separatly. Instead you update the metamodel with 4 class Family, FamilyMember, Man and Woman where Man and Woman inherits FamilyMember and Family only has 1 reference familyMembers. In your odesign under Family, you don't have 2 mappings but only one on FamilyMember and the members will be presented in the order of creation instead of one kind after the other.
I am not sure to understand your second question. The order of the elements displayed by a mapping is determined by the semantic candidate expression. The order displayed should be the same has the order serialized in the aird file.
Regards,
Steve
|
|
|
|
Re: Sirius Tree Description [message #1804263 is a reply to message #1804219] |
Thu, 21 March 2019 09:23  |
Eclipse User |
|
|
|
Hello,
You do not need a fake level, you just need a mapping (and a submapping for your sublevel) with a domain class and semantic candidates expression matching all the element you want to present. The semantic candidates expression can be a reference (even derived if needed) an EOperation or a service.
If in your semantic model the sub-sections are listed in alphabetical order instead of the creation order, you must have changed how element are indexed in your metamodel or by custom code I guess. If in your odesign the semantic candidate expression calls the same process then it will be displayed in the same order. The displayed order does not have to be the same as the semantic order.
If when you add a new element, you need to refresh to have the element move to its correct position, you may be in manual refresh. Can you check in Preference/Sirius if the Automatic refresh property is checked. If it's in automatic refresh, it's strange but you can force having a refresh by checking the "force refresh" property on the creation tool of your Tree Description in the odesign file.
Regards,
Steve
|
|
|
Powered by
FUDForum. Page generated in 0.04402 seconds