Class TemplateContentAssistProcessor

  • All Implemented Interfaces:
    org.eclipse.jface.text.contentassist.IContentAssistProcessor

    public class TemplateContentAssistProcessor
    extends Object
    implements org.eclipse.jface.text.contentassist.IContentAssistProcessor
    Default content assist processor for preference page used for pattern editor. Can create proposals of the variables provided by IFactoryServiceProvider
    • Constructor Detail

      • TemplateContentAssistProcessor

        public TemplateContentAssistProcessor​(String languages,
                                              boolean isRu)
        Creates new instance of this processor to process variables, available the given language
        Parameters:
        languages - The language of the variables that can be provided to the preference page
    • Method Detail

      • computeCompletionProposals

        public org.eclipse.jface.text.contentassist.ICompletionProposal[] computeCompletionProposals​(org.eclipse.jface.text.ITextViewer viewer,
                                                                                                     int offset)
        Specified by:
        computeCompletionProposals in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
      • getCompletionProposalAutoActivationCharacters

        public char[] getCompletionProposalAutoActivationCharacters()
        Specified by:
        getCompletionProposalAutoActivationCharacters in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
      • getContextInformationAutoActivationCharacters

        public char[] getContextInformationAutoActivationCharacters()
        Specified by:
        getContextInformationAutoActivationCharacters in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
      • getErrorMessage

        public String getErrorMessage()
        Specified by:
        getErrorMessage in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
      • getContextInformationValidator

        public org.eclipse.jface.text.contentassist.IContextInformationValidator getContextInformationValidator()
        Specified by:
        getContextInformationValidator in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
      • computeContextInformation

        public org.eclipse.jface.text.contentassist.IContextInformation[] computeContextInformation​(org.eclipse.jface.text.ITextViewer viewer,
                                                                                                    int offset)
        Specified by:
        computeContextInformation in interface org.eclipse.jface.text.contentassist.IContentAssistProcessor
      • getFactoryServiceProvider

        protected IFactoryServiceProvider getFactoryServiceProvider()
        Returns the factory service provider to get factories and presentations from
        Returns:
        The factory service provider, cannot be null
      • createProposal

        protected org.eclipse.jface.text.contentassist.ICompletionProposal createProposal​(org.eclipse.jface.text.ITextViewer viewer,
                                                                                          IVariablePresentation presentation,
                                                                                          org.eclipse.jface.text.IRegion region)
        Creates variable proposal from given parameters. Proposals should implement Comparable
        Parameters:
        viewer - The viewer that called for proposal, cannot be null
        presentation - The presentation of the called proposal, cannot be null
        region - The region to create proposal, cannot be null
        Returns:
        The newly created proposal, cannot be null