public class JavaContentAssistInvocationContext extends ContentAssistInvocationContext
Clients may use but not subclass this class.
| Constructor and Description |
|---|
JavaContentAssistInvocationContext(ICompilationUnit unit)
Creates a new context.
|
JavaContentAssistInvocationContext(ITextViewer viewer,
int offset,
IEditorPart editor)
Creates a new context.
|
| Modifier and Type | Method and Description |
|---|---|
ICompilationUnit |
getCompilationUnit()
Returns the compilation unit that content assist is invoked in,
null if there
is none. |
CompletionContext |
getCoreContext()
Returns the
core completion context if available, null
otherwise. |
IType |
getExpectedType()
Returns the expected type if any,
null otherwise. |
float |
getHistoryRelevance(String qualifiedTypeName)
Returns an float in [0.0, 1.0] based on whether the type has been recently used as a
right hand side for the type expected in the current context. 0 signals that the
qualifiedTypeName does not match the expected type, while 1.0 signals that
qualifiedTypeName has most recently been used in a similar context. |
IJavaCompletionProposal[] |
getKeywordProposals()
Returns the keyword proposals that are available in this context, possibly none.
|
CompletionProposalLabelProvider |
getLabelProvider()
Returns a label provider that can be used to compute proposal labels.
|
IJavaProject |
getProject()
Returns the project of the compilation unit that content assist is invoked in,
null if none. |
computeIdentifierPrefix, equals, getDocument, getInvocationOffset, getViewer, hashCodepublic JavaContentAssistInvocationContext(ITextViewer viewer, int offset, IEditorPart editor)
viewer - the viewer used by the editoroffset - the invocation offseteditor - the editor that content assist is invoked inpublic JavaContentAssistInvocationContext(ICompilationUnit unit)
unit - the compilation unit in documentpublic ICompilationUnit getCompilationUnit()
null if there
is none.nullpublic IJavaProject getProject()
null if none.nullpublic IJavaCompletionProposal[] getKeywordProposals()
public CompletionContext getCoreContext()
core completion context if available, null
otherwise.null otherwisepublic float getHistoryRelevance(String qualifiedTypeName)
qualifiedTypeName does not match the expected type, while 1.0 signals that
qualifiedTypeName has most recently been used in a similar context.qualifiedTypeName - the type name of the type of interestpublic IType getExpectedType()
null otherwise.null otherwisepublic CompletionProposalLabelProvider getLabelProvider()
Copyright (c) IBM Corp. and others 2000, 2006. All Rights Reserved.