Bug 90646 [Viewers] SWTException from DeferredContentProvider
20050405 I get this exception when closing the view where I have a table using the DeferredContentProvider. org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:2896) at org.eclipse.swt.SWT.error(SWT.java:2819) at org.eclipse.swt.SWT.error(SWT.java:2790) at org.eclipse.swt.widgets.Widget.error(Widget.java:393) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:295) at org.eclipse.swt.widgets.Table.getTopIndex(Table.java:1487) at org.eclipse.jface.viewers.deferred.DeferredContentProvider$TableViewerAdapter.getTopIndex(DeferredContentProvider.java:89) at org.eclipse.jface.viewers.deferred.ConcurrentTableUpdator.updateTable(ConcurrentTableUpdator.java:313) at org.eclipse.jface.viewers.deferred.ConcurrentTableUpdator.access$1(ConcurrentTableUpdator.java:299) at org.eclipse.jface.viewers.deferred.ConcurrentTableUpdator$1.run(ConcurrentTableUpdator.java:108) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:118) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:2871) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2530) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1570) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1534) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:156) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:315) at org.eclipse.core.launcher.Main.basicRun(Main.java:268) at org.eclipse.core.launcher.Main.run(Main.java:947) at org.eclipse.core.launcher.Main.main(Main.java:931)
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/deferred/BackgroundContentProvider.java
private ConcurrentTableUpdator updator;
    
    private Job sortJob = new Job(SORTING) {
        protected IStatus run(IProgressMonitor monitor) {
            doSort(monitor);
            return Status.OK_STATUS;
        }
    };
	private volatile FastProgressReporter sortMon = new FastProgressReporter();
	private volatile Range range = new Range(0,0);
    
    /**
     * Creates a new background content provider
     *  
     * @param table table that will receive updates
     * @param model data source
     * @param sortOrder initial sort order
     * @param display display
     */
    public BackgroundContentProvider(AbstractVirtualTable table, 
            IConcurrentModel model, Comparator sortOrder, 
            Display display) {
        
        updator = new ConcurrentTableUpdator(table, display);
        this.model = model;
        this.sortOrder = sortOrder;
        sortJob.setSystem(true);
        sortJob.setPriority(Job.SHORT);
        model.addListener(listener);
    }