1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 35 36 import org.eclipse.jdt.internal.compiler.ast.*; 37 import org.eclipse.jdt.internal.compiler.lookup.*; 38 39 public class CompletionOnQualifiedNameReference extends QualifiedNameReference { 40 public char[] completionIdentifier; 41 public boolean isInsideAnnotationAttribute; 42 public CompletionOnQualifiedNameReference(char[][] previousIdentifiers, char[] completionIdentifier, long[] positions, boolean isInsideAnnotationAttribute) { 43 super(previousIdentifiers, positions, (int) (positions[0] >>> 32), (int) positions[positions.length - 1]); 44 this.completionIdentifier = completionIdentifier; 45 this.isInsideAnnotationAttribute = isInsideAnnotationAttribute; 46 } 47 public StringBuffer printExpression(int indent, StringBuffer output) { 48 49 output.append("<CompleteOnName:"); for (int i = 0; i < tokens.length; i++) { 51 output.append(tokens[i]); 52 output.append('.'); 53 } 54 output.append(completionIdentifier).append('>'); 55 return output; 56 } 57 public TypeBinding resolveType(BlockScope scope) { 58 binding = scope.getBinding(tokens, this); 60 if (!binding.isValidBinding()) { 61 if (binding instanceof ProblemFieldBinding) { 62 scope.problemReporter().invalidField(this, (FieldBinding) binding); 63 } else if (binding instanceof ProblemReferenceBinding) { 64 scope.problemReporter().invalidType(this, (TypeBinding) binding); 65 } else { 66 scope.problemReporter().unresolvableReference(this, binding); 67 } 68 69 if (binding.problemId() == ProblemReasons.NotFound) { 70 throw new CompletionNodeFound(this, binding, scope); 71 } 72 73 throw new CompletionNodeFound(); 74 } 75 76 throw new CompletionNodeFound(this, binding, scope); 77 } 78 } 79 | Popular Tags |