Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354246 - ClassCastException when calling setVisible on an AbstractSWTWidgetRidget
Summary: ClassCastException when calling setVisible on an AbstractSWTWidgetRidget
Status: NEW
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-09 09:22 EDT by Sabine Achilles CLA
Modified: 2011-08-09 09:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sabine Achilles CLA 2011-08-09 09:22:12 EDT
I have a Ridget that extends the AbstractValueRidget. But when I call setVisible on it I get a ClassCastException

java.lang.ClassCastException: de.compeople.scrumbox.client.ridgets.TimeSeriesChartRidget cannot be cast to org.eclipse.riena.ui.ridgets.IMarkableRidget
	at org.eclipse.riena.ui.ridgets.swt.MarkerSupport.getRidget(MarkerSupport.java:281)
	at org.eclipse.riena.ui.ridgets.swt.MarkerSupport.getRidget(MarkerSupport.java:1)
	at org.eclipse.riena.ui.ridgets.AbstractMarkerSupport.getUIControl(AbstractMarkerSupport.java:300)
	at org.eclipse.riena.ui.ridgets.swt.BasicMarkerSupport.getUIControl(BasicMarkerSupport.java:156)
	at org.eclipse.riena.ui.ridgets.swt.BasicMarkerSupport.init(BasicMarkerSupport.java:66)
	at org.eclipse.riena.ui.ridgets.swt.AbstractSWTWidgetRidget.createMarkerSupport(AbstractSWTWidgetRidget.java:399)
	at org.eclipse.riena.ui.ridgets.swt.AbstractSWTWidgetRidget.addMarker(AbstractSWTWidgetRidget.java:108)
	at org.eclipse.riena.ui.ridgets.swt.AbstractSWTWidgetRidget.setVisible(AbstractSWTWidgetRidget.java:304)
	
The reason for this exception is, that AbstractSWTWidgetRidget only implements IBasicMarkableRidget instead of IMarkableRidget. So if you call setVisible a hiddenMarker is about to be added to the List of markers, but the MarkerSupport always thinks the Ridget is an IMarkableRidget, so it crashes.

I think either AbstractSWTWidgetRidget should implement IMarkableRidget or the cast in MarkerSupport should be made to IBasicMarkableRidget so that both sides fit together.