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

import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;

public class ORTreeLabelProvider implements ILabelProvider {

	public Image getImage(Object obj) {
		if (obj instanceof AbstractTreeData) {
			AbstractTreeData codeTreeData = (AbstractTreeData) obj;
			return codeTreeData.getImage();
		} else {
			return null;
		}
	}

	public String getText(Object obj) {
		String nodeName = "";
		if (obj instanceof AbstractTreeData) {
			AbstractTreeData treeData = ((AbstractTreeData) obj);
			if (treeData.getPackCodeNodeInfo() != null) {
				nodeName = treeData.getPackCodeNodeInfo().getNode_name();
			}
		}
		return nodeName;
	}

	public void addListener(ILabelProviderListener listener) {

	}

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

	}

	public boolean isLabelProperty(Object obj, String s) {
		// TODO Auto-generated method stub
		return false;
	}

	public void removeListener(ILabelProviderListener label) {
		// TODO Auto-generated method stub

	}

}
