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