diff options
Diffstat (limited to 'org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java')
-rw-r--r-- | org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java index c3102c438..38e73744e 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/CompletionTestsRequestor2.java @@ -20,6 +20,9 @@ import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.core.compiler.IProblem; +import org.eclipse.jdt.internal.codeassist.InternalCompletionContext; +import org.eclipse.jdt.internal.compiler.ast.ASTNode; +import org.eclipse.jdt.internal.compiler.util.ObjectVector; import org.eclipse.jdt.internal.core.JavaElement; public class CompletionTestsRequestor2 extends CompletionRequestor { @@ -605,4 +608,54 @@ public class CompletionTestsRequestor2 extends CompletionRequestor { } return false; } + + public String getCompletionNode() { + if (this.context instanceof InternalCompletionContext) { + InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context; + ASTNode astNode = internalCompletionContext.getCompletionNode(); + if (astNode != null) return astNode.toString(); + + } + return null; + } + + public String getCompletionNodeParent() { + if (this.context instanceof InternalCompletionContext) { + InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context; + ASTNode astNode = internalCompletionContext.getCompletionNodeParent(); + if (astNode != null) return astNode.toString(); + + } + return null; + } + + public String getVisibleLocalVariables() { + if (this.context instanceof InternalCompletionContext) { + InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context; + ObjectVector locals = internalCompletionContext.getVisibleLocalVariables(); + if (locals != null) return locals.toString(); + + } + return null; + } + + public String getVisibleFields() { + if (this.context instanceof InternalCompletionContext) { + InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context; + ObjectVector fields = internalCompletionContext.getVisibleFields(); + if (fields != null) return fields.toString(); + + } + return null; + } + + public String getVisibleMethods() { + if (this.context instanceof InternalCompletionContext) { + InternalCompletionContext internalCompletionContext = (InternalCompletionContext) this.context; + ObjectVector methods = internalCompletionContext.getVisibleMethods(); + if (methods != null) return methods.toString(); + + } + return null; + } } |