Bug 15844 [Exception Handling] SelectionChange events and NPE
Build 20020508 Due to new global actions there are now more objects listening to selection changes send out by a JFace viewer. We now had the case that one of the listener generated a NPE. As a result all listeners registered after that one didn't receive the selection change event. StructuredViewers should be more fault tolorant to exceptions when informing listeners.
bundles/org.eclipse.jface/src/org/eclipse/jface/viewers/AbstractTreeViewer.java
add(parentElement, new Object[] { childElement });
}
/**
 * Adds the given SWT selection listener to the given SWT control.
 *
 * @param control the SWT control
 * @param listener the SWT selection listener
 * 
 * @deprecated
 */
protected void addSelectionListener(Control control, SelectionListener listener) {}
/**
 * Adds a listener for expand and collapse events in this viewer.
 * Has no effect if an identical listener is already registered.
 *
 * @param listener a tree viewer listener
 */
public void addTreeListener(ITreeViewerListener listener) {
	treeListeners.add(listener);
}
/**
 * Adds the given SWT tree listener to the given SWT control.
 *
 * @param control the SWT control
 * @param listener the SWT tree listener
 */
protected abstract void addTreeListener(Control control, TreeListener listener);
/**
 * Collapses all nodes of the viewer's tree, starting with the root.
 * This method is equivalent to <code>collapseToLevel(ALL_LEVELS)</code>.