1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 import org.eclipse.jdt.core.compiler.CharOperation; 14 import org.eclipse.jdt.internal.compiler.ast.Argument; 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.MethodScope; 18 import org.eclipse.jdt.internal.compiler.lookup.TypeBinding; 19 20 21 public class CompletionOnArgumentName extends Argument { 22 23 private static final char[] FAKENAMESUFFIX = " ".toCharArray(); public char[] realName; 25 public boolean isCatchArgument = false; 26 27 public CompletionOnArgumentName(char[] name , long posNom , TypeReference tr , int modifiers){ 28 29 super(CharOperation.concat(name, FAKENAMESUFFIX), posNom, tr, modifiers); 30 this.realName = name; 31 } 32 33 public void bind(MethodScope scope, TypeBinding typeBinding, boolean used) { 34 35 super.bind(scope, typeBinding, used); 36 throw new CompletionNodeFound(this, scope); 37 } 38 39 public StringBuffer print(int indent, StringBuffer output) { 40 41 printIndent(indent, output); 42 output.append("<CompleteOnArgumentName:"); if (this.type != null) this.type.print(0, output).append(' '); 44 output.append(this.realName); 45 if (this.initialization != null) { 46 output.append(" = "); this.initialization.printExpression(0, output); 48 } 49 return output.append('>'); 50 } 51 52 public void resolve(BlockScope scope) { 53 54 super.resolve(scope); 55 throw new CompletionNodeFound(this, scope); 56 } 57 } 58 59 | Popular Tags |