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

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

Introduction

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

Prototype

@Override
public IType[] getAllTypes() throws JavaModelException 

Source Link

Usage

From source file:ch.powerunit.poweruniteclipse.PowerunitlaunchConfigurationShortcut.java

License:Open Source License

@Override
protected IType[] findTypes(Object[] elements, IRunnableContext context)
        throws InterruptedException, CoreException {
    if (elements[0] instanceof JavaProject) {

    }//  w  w w.  j  a v  a  2s . c  o  m
    CompilationUnit cu = (CompilationUnit) elements[0];// TODO support
                                                       // JavaProject
    IType type = Arrays.stream(cu.getAllTypes()).findFirst().orElse(null);
    return new IType[] { type };
}