1 11 package org.eclipse.jdt.internal.codeassist.complete; 12 13 import org.eclipse.jdt.internal.compiler.ast.JavadocAllocationExpression; 14 15 public class CompletionOnJavadocAllocationExpression extends JavadocAllocationExpression implements CompletionOnJavadoc { 16 public int completionFlags = JAVADOC; 17 public int separatorPosition; 18 19 public CompletionOnJavadocAllocationExpression(JavadocAllocationExpression allocation, int position) { 20 super(allocation.sourceStart, allocation.sourceEnd); 21 this.arguments = allocation.arguments; 22 this.type = allocation.type; 23 this.tagValue = allocation.tagValue; 24 this.sourceEnd = allocation.sourceEnd; 25 this.separatorPosition = position; 26 this.qualification = allocation.qualification; 27 } 28 29 public CompletionOnJavadocAllocationExpression(JavadocAllocationExpression allocation, int position, int flags) { 30 this(allocation, position); 31 this.completionFlags |= flags; 32 } 33 34 37 public void addCompletionFlags(int flags) { 38 this.completionFlags |= flags; 39 } 40 41 public boolean completeAnException() { 42 return (this.completionFlags & EXCEPTION) != 0; 43 } 44 45 public boolean completeInText() { 46 return (this.completionFlags & TEXT) != 0; 47 } 48 49 public boolean completeBaseTypes() { 50 return (this.completionFlags & BASE_TYPES) != 0; 51 } 52 53 public boolean completeFormalReference() { 54 return (this.completionFlags & FORMAL_REFERENCE) != 0; 55 } 56 57 62 public int getCompletionFlags() { 63 return this.completionFlags; 64 } 65 66 69 public StringBuffer printExpression(int indent, StringBuffer output) { 70 output.append("<CompleteOnJavadocAllocationExpression:"); super.printExpression(indent, output); 72 indent++; 73 if (this.completionFlags > 0) { 74 output.append('\n'); 75 for (int i=0; i<indent; i++) output.append('\t'); 76 output.append("infos:"); char separator = 0; 78 if (completeAnException()) { 79 output.append("exception"); separator = ','; 81 } 82 if (completeInText()) { 83 if (separator != 0) output.append(separator); 84 output.append("text"); separator = ','; 86 } 87 if (completeBaseTypes()) { 88 if (separator != 0) output.append(separator); 89 output.append("base types"); separator = ','; 91 } 92 if (completeFormalReference()) { 93 if (separator != 0) output.append(separator); 94 output.append("formal reference"); separator = ','; 96 } 97 output.append('\n'); 98 } 99 indent--; 100 for (int i=0; i<indent; i++) output.append('\t'); 101 return output.append('>'); 102 } 103 } 104 | Popular Tags |