Bug 127861 [DataBinding] Mark API provisional
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/viewers/TableViewerUpdatableCollection.java
this.viewer = viewer;
		viewer.setContentProvider(new IStructuredContentProvider() {
			public Object[] getElements(Object inputElement) {
				return elements.toArray();
			}
			public void dispose() {
			}
			public void inputChanged(Viewer viewer, Object oldInput,
					Object newInput) {
			}
		});
	}
	public int computeSize() {
		return elements.size();
	}
	
	public int addElement(final Object element, final int index){
		SyncRunnable runnable = new SyncRunnable(){
			public Object run(){
				return new Integer(internalAddElement(element,index));
			}
		};
		return ((Integer)runnable.runOn(viewer.getControl().getDisplay())).intValue();
	}
	private int internalAddElement(Object element, int index) {
		int position = primAddElement(element, index);
		if (position == elements.size() - 1 || viewer.getSorter() != null)
			viewer.add(element);
		else
			viewer.refresh();