Example usage for org.eclipse.jdt.internal.core CompilationUnit getTypeRoot

List of usage examples for org.eclipse.jdt.internal.core CompilationUnit getTypeRoot

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core CompilationUnit getTypeRoot.

Prototype

public ITypeRoot getTypeRoot() 

Source Link

Usage

From source file:org.parallelj.designer.launching.ParalleljApplicationLaunchShortcut.java

License:Open Source License

protected IType[] findTypes(Object[] elements, IRunnableContext context)
        throws InterruptedException, CoreException {
    IJavaElement[] javaElements = getJavaElements(elements);
    if (javaElements.length == 1 && javaElements[0] instanceof CompilationUnit) {
        CompilationUnit unit = (CompilationUnit) javaElements[0];
        return new IType[] { unit.getTypeRoot().findPrimaryType() };
    }//from w  ww. ja  va2 s .  c o m
    return new IType[] {};
}