Examples of SelectionRequestor


Examples of org.aspectj.org.eclipse.jdt.internal.core.SelectionRequestor

/**
* @see org.aspectj.org.eclipse.jdt.core.eval.IEvaluationContext#codeSelect(String, int, int, WorkingCopyOwner)
*/
public IJavaElement[] codeSelect(String codeSnippet, int offset, int length, WorkingCopyOwner owner) throws JavaModelException {
  SearchableEnvironment environment = this.project.newSearchableNameEnvironment(owner);
  SelectionRequestor requestor= new SelectionRequestor(environment.nameLookup, null); // null because there is no need to look inside the code snippet itself
  this.context.select(
    codeSnippet.toCharArray(),
    offset,
    offset + length - 1,
    environment,
    requestor,
    this.project.getOptions(true)
  );
  return requestor.getElements();
}
View Full Code Here

Examples of org.eclipse.jdt.internal.core.SelectionRequestor

    return null;
  }
 
  private Object findMethodWithAttachedDocInHierarchy(final MethodBinding method) throws JavaModelException {
    ReferenceBinding type= method.declaringClass;
    final SelectionRequestor requestor1 = (SelectionRequestor) this.requestor;
    return new InheritDocVisitor() {
      public Object visit(ReferenceBinding currType) throws JavaModelException {
        MethodBinding overridden =  findOverriddenMethodInType(currType, method);
        if (overridden == null)
          return InheritDocVisitor.CONTINUE;
        TypeBinding args[] = overridden.parameters;
        String names[] = new String[args.length];
        for (int i = 0; i < args.length; i++) {
          names[i] = Signature.createTypeSignature(args[i].sourceName(), false);
        }
        IMember member = (IMember) requestor1.findMethodFromBinding(overridden, names, overridden.declaringClass);
        if (member == null)
          return InheritDocVisitor.CONTINUE;
        if (member.getAttachedJavadoc(null) != null ) { 
          // for binary methods with attached javadoc and no source attached
          return overridden;
View Full Code Here

Examples of org.eclipse.jdt.internal.core.SelectionRequestor

    return null;
  }
 
  private Object findMethodWithAttachedDocInHierarchy(final MethodBinding method) throws JavaModelException {
    ReferenceBinding type= method.declaringClass;
    final SelectionRequestor requestor1 = (SelectionRequestor) this.requestor;
    return new InheritDocVisitor() {
      public Object visit(ReferenceBinding currType) throws JavaModelException {
        MethodBinding overridden =  findOverriddenMethodInType(currType, method);
        if (overridden == null)
          return InheritDocVisitor.CONTINUE;
        TypeBinding args[] = overridden.parameters;
        String names[] = new String[args.length];
        for (int i = 0; i < args.length; i++) {
          names[i] = Signature.createTypeSignature(args[i].sourceName(), false);
        }
        IMember member = (IMember) requestor1.findMethodFromBinding(overridden, names, overridden.declaringClass);
        if (member == null)
          return InheritDocVisitor.CONTINUE;
        if (member.getAttachedJavadoc(null) != null ) { 
          // for binary methods with attached javadoc and no source attached
          return overridden;
View Full Code Here

Examples of org.eclipse.jdt.internal.core.SelectionRequestor

    return null;
  }
 
  private Object findMethodWithAttachedDocInHierarchy(final MethodBinding method) throws JavaModelException {
    ReferenceBinding type= method.declaringClass;
    final SelectionRequestor requestor1 = (SelectionRequestor) this.requestor;
    return new InheritDocVisitor() {
      public Object visit(ReferenceBinding currType) throws JavaModelException {
        MethodBinding overridden =  findOverriddenMethodInType(currType, method);
        if (overridden == null)
          return InheritDocVisitor.CONTINUE;
        TypeBinding args[] = overridden.parameters;
        String names[] = new String[args.length];
        for (int i = 0; i < args.length; i++) {
          names[i] = Signature.createTypeSignature(args[i].sourceName(), false);
        }
        IMember member = (IMember) requestor1.findMethodFromBinding(overridden, names, overridden.declaringClass);
        if (member == null)
          return InheritDocVisitor.CONTINUE;
        if (member.getAttachedJavadoc(null) != null ) { 
          // for binary methods with attached javadoc and no source attached
          return overridden;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.