Eclipse JDT
Release 3.1

org.eclipse.jdt.ui.text.java
Class JavaContentAssistInvocationContext

java.lang.Object
  extended byorg.eclipse.jface.contentassist.ContentAssistInvocationContext
      extended byorg.eclipse.jface.text.contentassist.TextContentAssistInvocationContext
          extended byorg.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext

public class JavaContentAssistInvocationContext
extends TextContentAssistInvocationContext

Describes the context of a content assist invocation in a Java editor. The context knows the compilation unit, the proposal collector used to get Java core proposals and the core completion context received from core.

Clients may use this class.

XXX this API is provisional and may change anytime during the course of 3.2

Since:
3.2

Constructor Summary
JavaContentAssistInvocationContext(ITextViewer viewer, int offset, IEditorPart editor)
          Creates a new context.
 
Method Summary
 ICompilationUnit computeCompilationUnit()
          Returns the compilation unit that content assist is invoked in.
 CompletionProposalCollector getCollector()
          Returns the compeletion requestor that was used to get core proposals, or null if no core proposals have been requested.
 CompletionContext getContext()
          Returns the core completion context if available, null otherwise.
 void setCollector(CompletionProposalCollector collector)
          XXX internal - do not use
 
Methods inherited from class org.eclipse.jface.text.contentassist.TextContentAssistInvocationContext
computeIdentifierPrefix, equals, getDocument, getInvocationOffset, getViewer, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaContentAssistInvocationContext

public JavaContentAssistInvocationContext(ITextViewer viewer,
                                          int offset,
                                          IEditorPart editor)
Creates a new context.

Parameters:
viewer - the viewer used by the editor
offset - the invocation offset
editor - the editor that content assist is invoked in
Method Detail

computeCompilationUnit

public ICompilationUnit computeCompilationUnit()
Returns the compilation unit that content assist is invoked in.

Returns:
the compilation unit that content assist is invoked in

getCollector

public CompletionProposalCollector getCollector()
Returns the compeletion requestor that was used to get core proposals, or null if no core proposals have been requested.

Returns:
the compeletion requestor that was used to get core proposals, or null

setCollector

public void setCollector(CompletionProposalCollector collector)
XXX internal - do not use


getContext

public CompletionContext getContext()
Returns the core completion context if available, null otherwise. Shortcut for getCollector().getContext().

Returns:
the core completion context if available, null otherwise

Eclipse JDT
Release 3.1

Copyright (c) IBM Corp. and others 2000, 2005. All Rights Reserved.