package cn.com.origin.autocodemanager.common.tree;

import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class ORTreeContentProvider implements ITreeContentProvider {

	public Object[] getChildren(Object parentObj) {
		return ((AbstractTreeData) parentObj).getChildrenTreeData();

	}

	public Object getParent(Object element) {
		return ((AbstractTreeData) element).getParentTreeData();

	}

	public boolean hasChildren(Object element) {
		boolean flag = false;
		if (((AbstractTreeData) element) != null && ((AbstractTreeData) element).getChildrenTreeData() != null && ((AbstractTreeData) element).getChildrenTreeData().length > 0) {
			flag = true;
		}
		return flag;
	}

	public Object[] getElements(Object inputElement) {
		// TODO Auto-generated method stub
		return (Object[]) inputElement;
	}

	public void dispose() {
		// TODO Auto-generated method stub

	}

	public void inputChanged(Viewer arg0, Object obj1, Object obj2) {
		// TODO Auto-generated method stub

	}

}
