Procedural UC's SCL code is shown as property view title
Steps to reproduce:
- Make change to code.
- Save code.
- Select "Code" in Model Browser.
- Property View's title is now the Procedural UC's full SCL code.
The harder to fix problem is actually already documented in https://gitlab.simantics.org/simantics/platform/-/blob/master/bundles/org.simantics.selectionview/src/org/simantics/selectionview/StandardPropertyPage.java#L146-151. What happens here is that when a new selection comes in to PropertyPageView.doSelectionChanged
it currently has two jobs:
- update the part's name
- reset the input of the property page through
PropertyPage.sourceSelectionChanged
The property page is made up of a TabbedPropertyTable which contains an arbitrary amount of IPropertyTab
implementations. IPropertyTab
implementations do not have the chance to affect the view title. However, this responsibility is delegated to IPropertyTab2
implementations at which point it becomes a problem because the title update is performed before the new input has been set and the property view UI has been re-configured to show data for the new input selection. The actual workbench selection that comes through to PropertyPageView
will not be in use by IPropertyTab2
implementations when IPropertyTab2.updatePartName
is first invoked after the selection change.
The corollary of this is that after focusing another view and returning the focus to Model Browser, the same previously active IPropertyTab2
will get its updatePartName
invoked but this time with a different current input than previously. For this reason, the title will change strangely just by "clicking around".