Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322216 - XWT - Eclipse RCP : ComboViewer use singleSelection
Summary: XWT - Eclipse RCP : ComboViewer use singleSelection
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: XWT
Classification: Technology
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-10 07:05 EDT by Benjamin Algrain CLA
Modified: 2013-01-24 15:32 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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