public class CodeCompletionAggregator
extends java.lang.Object
implements org.eclipse.jface.fieldassist.IContentProposalProvider
ICompletionProvider objects to get the ICompletionContext for the desired line.
Then uses all registered ICompletionProvider objects to calculate the IContentProposal array for getProposals(String, int).
TODO: Refactor to use multi-threading.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTRIBUTE_CLASS
String constant for class attribute of codeCompletionProvider extension.
|
static java.lang.String |
ATTRIBUTE_SCRIPT_TYPE
String constant for script type attribute of codeCompletionProvider extension.
|
static java.lang.String |
COMPLETION_PROCESSOR
String constant for codeCompletionProvider extension point.
|
| Constructor and Description |
|---|
CodeCompletionAggregator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCompletionProvider(ICompletionProvider completionProvider) |
char[] |
getActivationChars() |
java.util.List<org.eclipse.jface.text.contentassist.ICompletionProposal> |
getCompletionProposals(java.lang.Object resource,
java.lang.String relevantText,
int insertOffset,
int selectionRange,
org.eclipse.core.runtime.IProgressMonitor monitor)
Calculate relevant completion proposals.
|
org.eclipse.jface.fieldassist.IContentProposal[] |
getProposals(java.lang.String contents,
int position) |
void |
setCodeParser(ICodeParser codeParser)
Setter method for ICompletionAnalyzer.
|
void |
setScriptEngine(IScriptEngine scriptEngine)
Sets the given script engine for all registered completion providers.
|
void |
setScriptType(ScriptType scriptType) |
public static final java.lang.String COMPLETION_PROCESSOR
public static final java.lang.String ATTRIBUTE_SCRIPT_TYPE
public static final java.lang.String ATTRIBUTE_CLASS
public void setCodeParser(ICodeParser codeParser)
codeParser - ICodeParser for completion calculation.public char[] getActivationChars()
public void setScriptEngine(IScriptEngine scriptEngine)
ICompletionProvider#setScriptEngine(IScriptEngine).scriptEngine - IScriptEngine to be set.public void setScriptType(ScriptType scriptType)
public void addCompletionProvider(ICompletionProvider completionProvider)
public java.util.List<org.eclipse.jface.text.contentassist.ICompletionProposal> getCompletionProposals(java.lang.Object resource,
java.lang.String relevantText,
int insertOffset,
int selectionRange,
org.eclipse.core.runtime.IProgressMonitor monitor)
resource - resource that contains relevantText. May be nullrelevantText - text that is relevant for completion calculationinsertOffset - cursor position within relevatTextselectionRange - monitor - job monitor for calculation terminationpublic org.eclipse.jface.fieldassist.IContentProposal[] getProposals(java.lang.String contents,
int position)
getProposals in interface org.eclipse.jface.fieldassist.IContentProposalProvider