Class TemplateProcessor

    • Constructor Detail

      • TemplateProcessor

        public TemplateProcessor()
    • Method Detail

      • process

        public void process​(ITemplate template,
                            org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                            org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Description copied from interface: ITemplateProcessor
        Processes template by resolving its variables with given context and accepting it with acceptor
        Specified by:
        process in interface ITemplateProcessor
        Parameters:
        template - The template to process, cannot be null
        context - The context where template is going to be applied, cannot be null
        acceptor - The acceptor of resulting proposal, cannot be null
      • createProposal

        protected org.eclipse.jface.text.contentassist.ICompletionProposal createProposal​(List<IVariable> variables,
                                                                                          ITemplate template,
                                                                                          org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context)
        Creates template proposal
        Parameters:
        variables - The list of the resolved variables, cannot be null
        template - The template that is processed, cannot be null
        context - The context of this template, cannot be null
        Returns:
        The completion proposal, that can apply this template, cannot be null
      • getFactoryServiceProvider

        protected IFactoryServiceProvider getFactoryServiceProvider()
        Returns factory to create variables
        Returns:
        The variable factory instance to create variables, cannot be null
      • getVariableFinder

        protected VariableFinder getVariableFinder()
        Returns the finder to find variables inside the template string
        Returns:
        The variable factory instance, cannot be null
      • getProgrammingLanguage

        protected abstract String getProgrammingLanguage()
        Returns the programming language that this can process
        Returns:
        The programming language this processor can process, cannot be null