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.LocalDeclaration; 15 import org.eclipse.jdt.internal.compiler.lookup.BlockScope; 16 17 18 public class CompletionOnLocalName extends LocalDeclaration { 19 private static final char[] FAKENAMESUFFIX = " ".toCharArray(); public char[] realName; 21 22 public CompletionOnLocalName(char[] name, int sourceStart, int sourceEnd){ 23 24 super(CharOperation.concat(name, FAKENAMESUFFIX), sourceStart, sourceEnd); 25 this.realName = name; 26 } 27 28 public void resolve(BlockScope scope) { 29 30 super.resolve(scope); 31 throw new CompletionNodeFound(this, scope); 32 } 33 34 public StringBuffer printAsExpression(int indent, StringBuffer output) { 35 printIndent(indent, output); 36 output.append("<CompleteOnLocalName:"); if (type != null) type.print(0, output).append(' '); 38 output.append(this.realName); 39 if (initialization != null) { 40 output.append(" = "); initialization.printExpression(0, output); 42 } 43 return output.append('>'); 44 } 45 46 public StringBuffer printStatement(int indent, StringBuffer output) { 47 this.printAsExpression(indent, output); 48 return output.append(';'); 49 } 50 } 51 52 | Popular Tags |