	private void bindToViewer(final Tree control) {
		viewer = new TreeViewer(control);
		Realm realm = Realm.getDefault();
		IObservableFactory listFactory = BeansObservables.listFactory(realm, childrenAccessor, treeElementClass);
		TreeStructureAdvisor structureAdvisor = new GenericTreeStructureAdvisor(parentAccessor, treeElementClass);
		TreeContentProvider viewerCP = new TreeContentProvider(listFactory, structureAdvisor);
		viewerCP.getKnownElements().addSetChangeListener(new TreeContentChangeListener(viewerCP, structureAdvisor));
		viewer.setContentProvider(viewerCP);
		IObservableMap[] attributeMap = BeansObservables.observeMaps(viewerCP.getKnownElements(), treeElementClass,
				valueAccessors);
		ILabelProvider viewerLP = new TreeRidgetLabelProvider(viewer, attributeMap);
		viewer.setLabelProvider(viewerLP);
		if (showRoots) {
			viewer.setInput(treeRoots);
		} else {
			final Object root0 = treeRoots[0];
			final String accessor = "get" + capitalize(childrenAccessor);
			List root0Children = ReflectionUtils.invoke(root0, accessor);
			final List inputList = new ArrayList(root0Children);
			viewer.setInput(inputList);
			PropertyChangeListener listener = new PropertyChangeListener() {
				private String ACCESSOR = childrenAccessor.toUpperCase();
				public void propertyChange(PropertyChangeEvent evt) {
					if (evt.getPropertyName().toUpperCase().endsWith(ACCESSOR)) {
						List root0Children = ReflectionUtils.invoke(root0, accessor);
						inputList.clear();
						for (Object child : root0Children) {
							inputList.add(child);
						}
						viewer.setInput(inputList);
					}
				}
			};
			ReflectionUtils.invoke(root0, "addPropertyChangeListener", listener);
		}
	}

	private void bindToViewer(final Tree control) {
		viewer = new TreeViewer(control);
		Realm realm = Realm.getDefault();
		IObservableFactory listFactory = BeansObservables.listFactory(realm, childrenAccessor, treeElementClass);
		TreeStructureAdvisor structureAdvisor = new GenericTreeStructureAdvisor(parentAccessor, treeElementClass);
		TreeContentProvider viewerCP = new TreeContentProvider(listFactory, structureAdvisor);
		viewerCP.getKnownElements().addSetChangeListener(new TreeContentChangeListener(viewerCP, structureAdvisor));
		viewer.setContentProvider(viewerCP);
		IObservableMap[] attributeMap = BeansObservables.observeMaps(viewerCP.getKnownElements(), treeElementClass,
				valueAccessors);
		ILabelProvider viewerLP = new TreeRidgetLabelProvider(viewer, attributeMap);
		viewer.setLabelProvider(viewerLP);
		if (showRoots) {
			viewer.setInput(treeRoots);
		} else {
			final Object root0 = treeRoots[0];
			final String accessor = "get" + capitalize(childrenAccessor);
			List root0Children = ReflectionUtils.invoke(root0, accessor);
			final List inputList = new ArrayList(root0Children);
			viewer.setInput(inputList);
			PropertyChangeListener listener = new PropertyChangeListener() {
				private String ACCESSOR = childrenAccessor.toUpperCase();
				public void propertyChange(PropertyChangeEvent evt) {
					if (evt.getPropertyName().toUpperCase().endsWith(ACCESSOR)) {
						List root0Children = ReflectionUtils.invoke(root0, accessor);
						inputList.clear();
						inputList.addAll(root0Children);
						viewer.refresh();
					}
				}
			};
			ReflectionUtils.invoke(root0, "addPropertyChangeListener", listener);
		}
	}
