Example usage for org.eclipse.jdt.internal.core JavaProject findType

List of usage examples for org.eclipse.jdt.internal.core JavaProject findType

Introduction

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

Prototype

@Override
public IType findType(String fullyQualifiedName) throws JavaModelException 

Source Link

Usage

From source file:org.eclipse.e4.xwt.tools.ui.designer.editor.text.XWTContentAssistProcessor.java

License:Open Source License

private List<String> getJavaMethods(JavaProject javaProject, String className) {
    if (javaProject == null || className == null) {
        return Collections.emptyList();
    }/*from  ww w  .  jav  a  2  s. c om*/
    List<String> javaMethods = new ArrayList<String>();
    try {
        IType type = javaProject.findType(className);
        IMethod[] methods = type.getMethods();
        for (int i = 0; i < methods.length; i++) {
            IMethod method = methods[i];
            String methodName = method.getElementName();
            javaMethods.add(methodName);
        }
    } catch (JavaModelException e) {
        e.printStackTrace();
    }
    return javaMethods;
}

From source file:org.eclipse.e4.xwt.ui.editor.XWTContentAssistProcessor.java

License:Open Source License

private List<String> getJavaMethods(JavaProject javaProject, String className) {
    List<String> javaMethods = new ArrayList<String>();
    try {//www  . ja v  a  2 s  .c o  m
        IType type = javaProject.findType(className);
        IMethod[] methods = type.getMethods();
        for (int i = 0; i < methods.length; i++) {
            IMethod method = methods[i];
            String methodName = method.getElementName();
            javaMethods.add(methodName);
        }
    } catch (JavaModelException e) {
        e.printStackTrace();
    }
    return javaMethods;
}