Bug 126839 [DataBinding] IObservable refactoring
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/viewers/TreeViewerUpdatableTree.java
}
	
	
	protected int addElement(final Object parentElement, int index, final Object value, final boolean fire) {				
		TreeNode parentNode = getTreeNode(parentElement);
		if (parentNode == null) {
			return -1;
		}
			
		if (!hasChildren(parentElement) && parentNode.getChildren()==null) {
			parentNode.setChildren(new ArrayList());
		}
		List list = parentNode.getChildren();
		int addedIndex = -1;
		if (!list.contains(value)) {
			addedIndex = primAddChildElement(list, value, index);
			TreeNode valueNode = new TreeNode(parentElement);
			nodes.put(value, valueNode);
			final int fireIndex=addedIndex;
			updateViewer(new Runnable() {			
				public void run() {
					viewer.add(parentElement == null ? viewerInput : parentElement,
							value);			
					if (fire) {
						fireChangeEvent(ChangeEvent.ADD, null, value, parentElement, fireIndex);
					}						
				}			
			});			
		}
		return addedIndex;