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.FieldDeclaration; 15 import org.eclipse.jdt.internal.compiler.lookup.MethodScope; 16 17 public class CompletionOnFieldName extends FieldDeclaration { 18 private static final char[] FAKENAMESUFFIX = " ".toCharArray(); public char[] realName; 20 public CompletionOnFieldName(char[] name, int sourceStart, int sourceEnd) { 21 super(CharOperation.concat(name, FAKENAMESUFFIX), sourceStart, sourceEnd); 22 this.realName = name; 23 } 24 25 public StringBuffer printStatement(int tab, StringBuffer output) { 26 27 printIndent(tab, output).append("<CompleteOnFieldName:"); if (type != null) type.print(0, output).append(' '); 29 output.append(realName); 30 if (initialization != null) { 31 output.append(" = "); initialization.printExpression(0, output); 33 } 34 return output.append(">;"); } 36 37 public void resolve(MethodScope initializationScope) { 38 super.resolve(initializationScope); 39 40 throw new CompletionNodeFound(this, initializationScope); 41 } 42 } 43 44 | Popular Tags |