package interactivefeaturelocator.model;

import interactivefeaturelocator.test.Test;

import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.zest.core.widgets.GraphNode;
import org.eclipse.zest.core.widgets.IContainer;
import org.ntlab.trace.MethodExecution;

public class CallTreeGraphNode extends GraphNode {
	private boolean current = false;
	private boolean focus = false;

	public CallTreeGraphNode(IContainer graphModel, int style, String text) {
		super(graphModel, style, text);
		// TODO Auto-generated constructor stub
	}
	
	public CallTreeGraphNode(IContainer graphModel, int style, MethodExecution method) {
		super(graphModel, style, method.getMethodName(), method);
		setSize(20.0, 5.0);
	}
		
	public void highlight() {
		this.focus = true;
		try {
			Test test = new Test();
			test.openEditor(this.getMethod());
		} catch (JavaModelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	public MethodExecution getMethod() {
		return (MethodExecution)this.getData();
	}
	
}
