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 Details

    • COMPLETION_PROCESSOR

      public static final String COMPLETION_PROCESSOR
      String constant for codeCompletionProvider extension point.
      See Also:
      Constant Field Values
    • ATTRIBUTE_SCRIPT_TYPE

      public static final String ATTRIBUTE_SCRIPT_TYPE
      String constant for script type attribute of codeCompletionProvider extension.
      See Also:
      Constant Field Values
    • ATTRIBUTE_CLASS

      public static final String ATTRIBUTE_CLASS
      String constant for class attribute of codeCompletionProvider extension.
      See Also:
      Constant Field Values
  • Constructor Details

    • CodeCompletionAggregator

      public CodeCompletionAggregator()
  • Method Details

    • setCodeParser

      public void setCodeParser​(ICodeParser codeParser)
      Setter method for ICompletionAnalyzer.
      Parameters:
      codeParser - ICodeParser for completion calculation.
    • getActivationChars

      public char[] getActivationChars()
    • setScriptEngine

      public void setScriptEngine​(IScriptEngine scriptEngine)
      Sets the given script engine for all registered completion providers.
      Parameters:
      scriptEngine - IScriptEngine to be set.
    • setScriptType

      public void setScriptType​(ScriptType scriptType)
    • addCompletionProvider

      public void addCompletionProvider​(ICompletionProvider completionProvider)
    • 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 be null
      relevantText - text that is relevant for completion calculation
      insertOffset - cursor position within relevatText
      selectionRange -
      monitor - job monitor for calculation termination
      Returns:
    • getProposals

      public org.eclipse.jface.fieldassist.IContentProposal[] getProposals​(String contents, int position)
      Specified by:
      getProposals in interface org.eclipse.jface.fieldassist.IContentProposalProvider