/**
 * @author tyl
 * @Action  ini
 * 2011-3-15
 */
package cn.com.origin.autocodemanager.common.treetable;

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

import cn.com.origin.autocodemanager.common.tree.AbstractTreeData;

public class ORTreeTableContentProvider implements ITreeContentProvider {

	public Object[] getChildren(Object parentObj) {
		// TODO Auto-generated method stub
		return ((AbstractTreeData) parentObj).getChildrenTreeData();

	}

	public Object getParent(Object element) {
		// TODO Auto-generated method stub
		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) {
		return (Object[]) inputElement;
	}

	public void dispose() {

	}

	public void inputChanged(Viewer arg0, Object obj1, Object obj2) {

	}
}
