1 11 package org.eclipse.jdt.internal.codeassist.select; 12 13 import org.eclipse.jdt.core.compiler.CharOperation; 14 import org.eclipse.jdt.internal.compiler.ast.ParameterizedQualifiedTypeReference; 15 import org.eclipse.jdt.internal.compiler.ast.TypeReference; 16 import org.eclipse.jdt.internal.compiler.lookup.BlockScope; 17 import org.eclipse.jdt.internal.compiler.lookup.ClassScope; 18 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; 19 20 public class SelectionOnParameterizedQualifiedTypeReference extends ParameterizedQualifiedTypeReference { 21 public SelectionOnParameterizedQualifiedTypeReference(char[][] previousIdentifiers, char[] selectionIdentifier, TypeReference[][] typeArguments, TypeReference[] assistTypeArguments, long[] positions) { 22 super( 23 CharOperation.arrayConcat(previousIdentifiers, selectionIdentifier), 24 typeArguments, 25 0, 26 positions); 27 int length = this.typeArguments.length; 28 System.arraycopy(this.typeArguments, 0, this.typeArguments = new TypeReference[length + 1][], 0, length); 29 this.typeArguments[length] = assistTypeArguments; 30 } 31 32 public TypeBinding resolveType(BlockScope scope, boolean checkBounds) { 33 super.resolveType(scope, checkBounds); 34 throw new SelectionNodeFound(this.resolvedType); 40 } 41 42 public TypeBinding resolveType(ClassScope scope) { 43 super.resolveType(scope); 44 throw new SelectionNodeFound(this.resolvedType); 50 } 51 52 public StringBuffer printExpression(int indent, StringBuffer output) { 53 output.append("<SelectOnType:"); int length = tokens.length; 55 for (int i = 0; i < length; i++) { 56 if(i != 0) { 57 output.append('.'); 58 } 59 output.append(tokens[i]); 60 TypeReference[] typeArgument = typeArguments[i]; 61 if (typeArgument != null) { 62 output.append('<'); 63 int max = typeArgument.length - 1; 64 for (int j = 0; j < max; j++) { 65 typeArgument[j].print(0, output); 66 output.append(", "); } 68 typeArgument[max].print(0, output); 69 output.append('>'); 70 } 71 72 } 73 output.append('>'); 74 return output; 75 } 76 } 77 | Popular Tags |