Package org.eclipse.ease.ui.completion
Class CodeCompletionAggregator
java.lang.Object
org.eclipse.ease.ui.completion.CodeCompletionAggregator
- All Implemented Interfaces:
org.eclipse.jface.fieldassist.IContentProposalProvider
public class CodeCompletionAggregator extends Object implements org.eclipse.jface.fieldassist.IContentProposalProvider
Dispatcher class create code completion proposals.
First checks all registered
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.-
Field Summary
Fields Modifier and Type Field Description static StringATTRIBUTE_CLASSString constant for class attribute of codeCompletionProvider extension.static StringATTRIBUTE_SCRIPT_TYPEString constant for script type attribute of codeCompletionProvider extension.static StringCOMPLETION_PROCESSORString constant for codeCompletionProvider extension point. -
Constructor Summary
Constructors Constructor Description CodeCompletionAggregator() -
Method Summary
Modifier and Type Method Description voidaddCompletionProvider(ICompletionProvider completionProvider)char[]getActivationChars()List<org.eclipse.jface.text.contentassist.ICompletionProposal>getCompletionProposals(Object resource, String relevantText, int insertOffset, int selectionRange, org.eclipse.core.runtime.IProgressMonitor monitor)Calculate relevant completion proposals.org.eclipse.jface.fieldassist.IContentProposal[]getProposals(String contents, int position)voidsetCodeParser(ICodeParser codeParser)Setter method for ICompletionAnalyzer.voidsetScriptEngine(IScriptEngine scriptEngine)Sets the given script engine for all registered completion providers.voidsetScriptType(ScriptType scriptType)
-
Field Details
-
COMPLETION_PROCESSOR
String constant for codeCompletionProvider extension point.- See Also:
- Constant Field Values
-
ATTRIBUTE_SCRIPT_TYPE
String constant for script type attribute of codeCompletionProvider extension.- See Also:
- Constant Field Values
-
ATTRIBUTE_CLASS
String constant for class attribute of codeCompletionProvider extension.- See Also:
- Constant Field Values
-
-
Constructor Details
-
CodeCompletionAggregator
public CodeCompletionAggregator()
-
-
Method Details
-
setCodeParser
Setter method for ICompletionAnalyzer.- Parameters:
codeParser-ICodeParserfor completion calculation.
-
getActivationChars
public char[] getActivationChars() -
setScriptEngine
Sets the given script engine for all registered completion providers.- Parameters:
scriptEngine-IScriptEngineto be set.
-
setScriptType
-
addCompletionProvider
-
getCompletionProposals
public List<org.eclipse.jface.text.contentassist.ICompletionProposal> getCompletionProposals(Object resource, String relevantText, int insertOffset, int selectionRange, org.eclipse.core.runtime.IProgressMonitor monitor)Calculate relevant completion proposals.- Parameters:
resource- resource that contains relevantText. May benullrelevantText- text that is relevant for completion calculationinsertOffset- cursor position within relevatTextselectionRange-monitor- job monitor for calculation termination- Returns:
-
getProposals
public org.eclipse.jface.fieldassist.IContentProposal[] getProposals(String contents, int position)- Specified by:
getProposalsin interfaceorg.eclipse.jface.fieldassist.IContentProposalProvider
-