Bug 127861 [DataBinding] Mark API provisional
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/databinding/viewers/UpdatableSetContentProvider.java
return elements;
    }
    
    public void dispose() {
        setInput(null);
    }
    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        this.viewer = viewer;
        if (!(viewer instanceof TableViewer || viewer instanceof AbstractListViewer)) {
        	throw new IllegalArgumentException("This content provider only works with TableViewer of AbstractListViewer"); 
        }
        if (newInput != null && !(newInput instanceof IReadableSet)) {
        	throw new IllegalArgumentException("This content provider only works with input of type IReadableSet"); 
        }
        
        setInput((IReadableSet) newInput);
    }
    private void setInput(IReadableSet newSet) {
    	boolean updateViewer = true;
        if (newSet == null) {
            newSet = EmptyReadableSet.getInstance();
            
            updateViewer = false;
        }
        
        boolean wasStale = false;
        if (readableSet != null) {
        	readableSet.removeChangeListener(listener);
        	wasStale = readableSet.isStale();
        }