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

Bug 346184

Summary: PropertySheetViewer bug, Widget is disposed
Product: [Eclipse Project] Platform Reporter: Tigo <269100815>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: 269100815, eclipse.felipe, prakash, remy.suen
Version: 3.4.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Tigo CLA 2011-05-17 22:59:41 EDT
Build Identifier: M20090211-1700

org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:3777)
	at org.eclipse.swt.SWT.error(SWT.java:3695)
	at org.eclipse.swt.SWT.error(SWT.java:3666)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:463)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:336)
	at org.eclipse.swt.widgets.Widget.getData(Widget.java:521)
	at org.eclipse.ui.views.properties.PropertySheetViewer.handleSelect(PropertySheetViewer.java:720)

Reproducible: Always

Steps to Reproduce:
1.enter cell editor of one property entry
2.change it's value, for me , this will cause some property be removed.
3.then if i stop editing by click entry which was remove by previous editing, exception popup.
Comment 1 Remy Suen CLA 2011-05-18 13:26:17 EDT
Is this in some plug-in you have written? Please attach some code to reproduce the problem.
Comment 2 Tigo CLA 2011-05-19 02:33:23 EDT
public class DataEntryPropertySource implements IPropertySource {
        ....
      	@Override
	public IPropertyDescriptor[] getPropertyDescriptors() {
		List<IPropertyDescriptor> list = new ArrayList<IPropertyDescriptor>();
                .....
//I create some Descriptors to input or edit each element of an array.(int array for example).
//if element is set to -1 by cell editor, i will remove this element, when property sheet refresh,
//count of Descriptor will reduce, some widget will be disposed.
//if I exit editing by click the Tree Item which will just be removed, this exception popup.
//I think this is because property sheet page refresh before handling tree item click.
//PropertySheetViewer line 720, Object object = sel[0].getData(); sel[0] is TreeItem, it should check disposed before get data.
                .....
        }
        ....
}

hope this help.
Comment 3 Tigo CLA 2011-05-19 02:36:44 EDT
o, if i exit editing by click tree item which will not be removed(presents element in array which will not be removed), no exception occur.
Comment 4 Prakash Rangaraj CLA 2011-06-03 02:07:48 EDT
Please provide us the correct steps with sample code to reproduce the problem.