Search in sources :

Example 1 with TypeNameMatchRequestor

use of org.eclipse.jdt.core.search.TypeNameMatchRequestor in project che by eclipse.

the class JavaDebuggerUtils method findTypeByFqn.

private List<IType> findTypeByFqn(char[][] packages, char[][] names, IJavaSearchScope scope) throws JavaModelException {
    List<IType> result = new ArrayList<>();
    SearchEngine searchEngine = new SearchEngine();
    searchEngine.searchAllTypeNames(packages, names, scope, new TypeNameMatchRequestor() {

        @Override
        public void acceptTypeNameMatch(TypeNameMatch typeNameMatch) {
            result.add(typeNameMatch.getType());
        }
    }, IJavaSearchConstants.WAIT_UNTIL_READY_TO_SEARCH, new NullProgressMonitor());
    return result;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) SearchEngine(org.eclipse.jdt.core.search.SearchEngine) TypeNameMatch(org.eclipse.jdt.core.search.TypeNameMatch) ArrayList(java.util.ArrayList) TypeNameMatchRequestor(org.eclipse.jdt.core.search.TypeNameMatchRequestor) IType(org.eclipse.jdt.core.IType)

Aggregations

ArrayList (java.util.ArrayList)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 IType (org.eclipse.jdt.core.IType)1 SearchEngine (org.eclipse.jdt.core.search.SearchEngine)1 TypeNameMatch (org.eclipse.jdt.core.search.TypeNameMatch)1 TypeNameMatchRequestor (org.eclipse.jdt.core.search.TypeNameMatchRequestor)1