Deterministic source ordering for Annotation selection tab
|Assignee:||Tuukka Lehtonen||% Done:|
|Category:||Annotations||Spent time:||2.00 hours|
|Release notes:||Changed Annotations property tab to always show annotation sources in the same order (Component, Element) if there are many sources|
|Velocity based estimate||-|
|Release||Simantics 1.13.4||Release relationship||Auto|
The Annotation selection view tab annotation source combo box data order currently depends on the input received. The selection view framework always calculates selection tabs and their inputs in a random order and this is currently rather difficult to change. For example, regardless of whether the user selects a configuration component from the model browser or a diagram element source:foundation/browsing/trunk/org.simantics.selectionview/src/org/simantics/selectionview/StandardSelectionProcessor.java will calculate both inputs the configuration component and the mapped diagram element Variable and then create an Annotation org.simantics.selectionview.TypedVariableTabContributor for both of these inputs. The order of the tab contributions will be random and there's currently no clear way of prioritizing the inputs since StandardSelectionProcessor treats them as plain Objects.
Due to these circumstances, this issue changes the annotation view source calculation to always produce result in the order (Component, Element).
Changed annotation SCL functions to return available annotation sources always in the same order regardless of the original input (configuration component or diagram element).
StandardSelectionProcessor can't guarantee anything about contribution/input order right now so these changes work around the ordering problem.