Project: Eclipse_Platform_UI
Bug 79957 [Viewers] NPE changing input usingTableViewer and virtual
Reported: 2004-12-02 00:47:23 | Status: verified fixed

I'm using the latest code for Table viewer with a private virtual manager class in table viewer. i've straight forward code ... <code> Table table=new Table(shell,SWT.VIRTUAL); TableViewer tv=new TableViewer(table); tv.setContentProvider(new NetworkContentProvider()); tv.setLabelProvider(new NetworkLabelProvider()); tv.setInput(model); . . . in a selection event handler for a button, i've to reset the model input . . tv.setInput(model1); . . Same code works fine without the SWT.VIRTUAL style bit,but when VIRTUAL is set it throws a null pointer exception... the stack trace was java.lang.NullPointerException at org.eclipse.jface.viewers.TableViewer$1.handleEvent(TableViewer.java:103) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:796) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:820) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:805) at org.eclipse.swt.widgets.Table.wmNotifyChild(Table.java:3158) at org.eclipse.swt.widgets.Control.WM_NOTIFY(Control.java:4040) at org.eclipse.swt.widgets.Composite.WM_NOTIFY(Composite.java:722) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3025) at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1400) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3349) at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method) at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1403) at org.eclipse.swt.widgets.Table.callWindowProc(Table.java:137) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3056) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3349) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1479) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2440) at jface.viewers.TestJfaceVirtual.main(TestJfaceVirtual.java:49)

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/VirtualTableViewerTest.java