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.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutlinePage.java
*/
public void addSelectionChangedListener(ISelectionChangedListener listener) {
	selectionChangedListeners.add(listener);
}
/**
 * The <code>ContentOutlinePage</code> implementation of this 
 * <code>IContentOutlinePage</code> method creates a tree viewer. Subclasses
 * must extend this method configure the tree viewer with a proper content 
 * provider, label provider, and input element.
 */
public void createControl(Composite parent) {
	treeViewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	treeViewer.addSelectionChangedListener(this);
}
/**
 * Fires a selection changed event.
 *
 * @param selction the new selection
 */
protected void fireSelectionChanged(ISelection selection) {
	
	SelectionChangedEvent event = new SelectionChangedEvent(this, selection);
	
	Object[] listeners = selectionChangedListeners.getListeners();
	for (int i = 0; i < listeners.length; ++i) {
		((ISelectionChangedListener) listeners[i]).selectionChanged(event);
	}
}
/* (non-Javadoc)
 * Method declared on IPage (and Page).