List of usage examples for org.eclipse.jdt.internal.core IJavaElementRequestor acceptMemberType
public void acceptMemberType(IType type);
From source file:com.codenvy.ide.ext.java.server.internal.core.NameLookup.java
License:Open Source License
/** * Notifies the given requestor of all types (classes and interfaces) in the * given type with the given (possibly qualified) name. Checks * the requestor at regular intervals to see if the requestor * has canceled./* w w w . j a v a2 s . c om*/ */ protected boolean seekTypesInType(String prefix, int firstDot, IType type, IJavaElementRequestor requestor, int acceptFlags) { IType[] types = null; try { types = type.getTypes(); } catch (JavaModelException npe) { return false; // the enclosing type is not present } int length = types.length; if (length == 0) return false; String memberPrefix = prefix; boolean isMemberTypePrefix = false; if (firstDot != -1) { memberPrefix = prefix.substring(0, firstDot); isMemberTypePrefix = true; } for (int i = 0; i < length; i++) { if (requestor.isCanceled()) return false; IType memberType = types[i]; if (memberType.getElementName().toLowerCase().startsWith(memberPrefix)) if (isMemberTypePrefix) { String subPrefix = prefix.substring(firstDot + 1, prefix.length()); return seekTypesInType(subPrefix, subPrefix.indexOf('.'), memberType, requestor, acceptFlags); } else { if (acceptType(memberType, acceptFlags, true/*a source type*/)) { requestor.acceptMemberType(memberType); return true; } } } return false; }