Bug 79957 [Viewers] NPE changing input usingTableViewer and virtual
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)
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/TableViewer.java
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.viewers;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import org.eclipse.jface.util.Assert;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.TableEditor;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Widget;
/**