Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 322216

Summary: XWT - Eclipse RCP : ComboViewer use singleSelection
Product: [Technology] XWT Reporter: Benjamin Algrain <benjamin.algrain>
Component: CoreAssignee: Project Inbox <e4.xwt-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3 CC: yves.yang
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Benjamin Algrain CLA 2010-08-10 07:05:30 EDT
Build Identifier: 20100617-1415

In simple mode XWT, no problem
When I use it through Eclipse RCP, I have a bug

xwt
-----
....
<ComboViewer name="ComboViewer" Input="{Binding Source={StaticResource chapterDao} ,Path=chapters}">
<ComboViewer.singleSelection>
	<Binding path="chapter"></Binding>
</ComboViewer.singleSelection>
		
<ComboViewer.contentProvider>
<ObservableListContentProvider/>
</ComboViewer.contentProvider>
			
<ComboViewer.labelProvider>
<p:ChapterLabelProvider/>
</ComboViewer.labelProvider>
			
<ComboViewer.control.layoutData>
<GridData horizontalAlignment="FILL" verticalAlignment="FILL" grabExcessHorizontalSpace="true" grabExcessVerticalSpace="true"/>
</ComboViewer.control.layoutData>
</ComboViewer>
...


Bug localized : 
org.eclipse.e4.xwt.databinding.JFaceXWTDataBinding

SimpleValueProperty property = (SimpleValueProperty) viewerProperties.singleSelection();

Stack : 
-------
org.eclipse.jface.internal.databinding.viewers.SelectionProviderSingleSelectionProperty cannot be cast to org.eclipse.core.databinding.property.value.SimpleValueProperty
java.lang.ClassCastException: org.eclipse.jface.internal.databinding.viewers.SelectionProviderSingleSelectionProperty cannot be cast to org.eclipse.core.databinding.property.value.SimpleValueProperty
	at org.eclipse.e4.xwt.databinding.JFaceXWTDataBinding.observePropertyValue(JFaceXWTDataBinding.java:312)
	at org.eclipse.e4.xwt.databinding.JFaceXWTDataBinding.observeWidget(JFaceXWTDataBinding.java:278)
	at org.eclipse.e4.xwt.internal.core.ScopeManager$ObservableValueBuilder.createValueProperty(ScopeManager.java:323)
	at org.eclipse.e4.xwt.internal.core.ScopeManager$ObservableValueBuilder.resolveObservablevalue(ScopeManager.java:274)
	at org.eclipse.e4.xwt.internal.core.ScopeManager$ObservableValueBuilder.observe(ScopeManager.java:212)
	at org.eclipse.e4.xwt.internal.core.ScopeManager.observe(ScopeManager.java:434)
	at org.eclipse.e4.xwt.databinding.DataBinding.getObservableWidget(DataBinding.java:187)
	at org.eclipse.e4.xwt.databinding.DataBinding.getValue(DataBinding.java:56)
	at org.eclipse.e4.xwt.internal.core.Binding.getValue(Binding.java:241)
	at org.eclipse.e4.xwt.converters.BindingToObject.convert(BindingToObject.java:26)
	at org.eclipse.e4.xwt.javabean.ResourceLoader.initSegmentAttribute(ResourceLoader.java:1733)

Reproducible: Always
Comment 1 Yves YANG CLA 2010-08-10 09:03:45 EDT
It is strange. In my environment (eclipse Version: 3.6.0
Build id: I20100608-0911), SelectionProviderSingleSelectionProperty is a subclass of SimpleValueProperty.
Comment 2 Yves YANG CLA 2010-08-11 01:14:04 EDT
Can you provide a testcase with a simple RCP application ?
Comment 3 Benjamin Algrain CLA 2010-11-02 05:57:14 EDT
The problem came from a classloader conflict