Bug 570214

Summary: [Databinding] WorkbenchProperties#singleSelection does not work for sets and lists
Product: [Eclipse Project] Platform Reporter: Jens Lideström <jens>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.19   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=570059
Whiteboard:

Description Jens Lideström CLA 2021-01-09 08:21:27 EST
SelectionServiceListener has a bug whereby it incorrectly passes a IWorkbenchPart instead of a ISelectionService as the source object to fireChange.

This has no consequences for the standard case, when WorkbenchProperties#singleSelection is used to produce an observable value, because SimplePropertyObservableValue ignores the source parameter.

But when WorkbenchProperties#singleSelection is used to produce a observable list of set it results in ClassCastExceptions in SelectionServiceListener, when the source is cased to ISelectionService.

The fundamental problem is that there is no good way to use SimpleValueProperty when the listener does not have access to the source object.