Class QlProposalProvider

  • All Implemented Interfaces:
    org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalFactory, org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider
    Direct Known Subclasses:
    AbstractQlDcsProposalProvider, AbstractRightQlProposalProvider

    public class QlProposalProvider
    extends AbstractQlProposalProvider
    This class defines proposals for Ql language See http://www.eclipse.org/Xtext/documentation.html#contentAssist on how to customize content assistant
    • Field Detail

      • isRussian

        protected boolean isRussian
      • lastObject

        protected org.eclipse.emf.ecore.EObject lastObject
      • allowedInFilter

        protected boolean allowedInFilter
      • allowedAnotherRule

        protected boolean allowedAnotherRule
    • Constructor Detail

      • QlProposalProvider

        public QlProposalProvider()
    • Method Detail

      • createProposals

        public void createProposals​(org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                    org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Start method of creating proposals
        Specified by:
        createProposals in interface org.eclipse.xtext.ui.editor.contentassist.IContentProposalProvider
        Overrides:
        createProposals in class org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider
      • completeQuerySchema_Queries

        public void completeQuerySchema_Queries​(org.eclipse.emf.ecore.EObject model,
                                                org.eclipse.xtext.Assignment assignment,
                                                org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for start query
        Overrides:
        completeQuerySchema_Queries in class AbstractQlProposalProvider
      • completeAbstractQuerySchemaSource_Alias

        public void completeAbstractQuerySchemaSource_Alias​(org.eclipse.emf.ecore.EObject model,
                                                            org.eclipse.xtext.Assignment assignment,
                                                            org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                            org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for writing alias of section 'FROM'
        Overrides:
        completeAbstractQuerySchemaSource_Alias in class AbstractQlProposalProvider
      • completeQuerySchemaSource_Source

        public void completeQuerySchemaSource_Source​(org.eclipse.emf.ecore.EObject model,
                                                     org.eclipse.xtext.Assignment assignment,
                                                     org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                     org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for creating source section of query
        Overrides:
        completeQuerySchemaSource_Source in class AbstractQlProposalProvider
      • completeCommonExpression_Content

        public void completeCommonExpression_Content​(org.eclipse.emf.ecore.EObject model,
                                                     org.eclipse.xtext.Assignment assignment,
                                                     org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                     org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for common expression
        Overrides:
        completeCommonExpression_Content in class AbstractQlProposalProvider
      • completeBracketCommonExpression_Content

        public void completeBracketCommonExpression_Content​(org.eclipse.emf.ecore.EObject model,
                                                            org.eclipse.xtext.Assignment assignment,
                                                            org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                            org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for common expression
        Overrides:
        completeBracketCommonExpression_Content in class AbstractQlProposalProvider
      • completeAbstractQuerySchemaTable_TableName

        public void completeAbstractQuerySchemaTable_TableName​(org.eclipse.emf.ecore.EObject model,
                                                               org.eclipse.xtext.Assignment assignment,
                                                               org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                               org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for table name
        Overrides:
        completeAbstractQuerySchemaTable_TableName in class AbstractQlProposalProvider
      • completeAbstractQuerySchemaTableWithoutServiceWords_TableName

        public void completeAbstractQuerySchemaTableWithoutServiceWords_TableName​(org.eclipse.emf.ecore.EObject model,
                                                                                  org.eclipse.xtext.Assignment assignment,
                                                                                  org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                                                  org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for table name
        Overrides:
        completeAbstractQuerySchemaTableWithoutServiceWords_TableName in class AbstractQlProposalProvider
      • completeFunctionInvocationExpression_FunctionType

        public void completeFunctionInvocationExpression_FunctionType​(org.eclipse.emf.ecore.EObject model,
                                                                      org.eclipse.xtext.Assignment assignment,
                                                                      org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                                      org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for functions
        Overrides:
        completeFunctionInvocationExpression_FunctionType in class AbstractQlProposalProvider
      • complete_AbstractExpression

        public void complete_AbstractExpression​(org.eclipse.emf.ecore.EObject model,
                                                org.eclipse.xtext.RuleCall ruleCall,
                                                org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for all type of expression
        Overrides:
        complete_AbstractExpression in class AbstractQlProposalProvider
      • completeQuerySchemaAnythingExpression_Expression

        public void completeQuerySchemaAnythingExpression_Expression​(org.eclipse.emf.ecore.EObject model,
                                                                     org.eclipse.xtext.Assignment assignment,
                                                                     org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                                     org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for all type of expression
        Overrides:
        completeQuerySchemaAnythingExpression_Expression in class AbstractQlProposalProvider
      • completeCastOperationExpression_TypeCast

        public void completeCastOperationExpression_TypeCast​(org.eclipse.emf.ecore.EObject model,
                                                             org.eclipse.xtext.Assignment assignment,
                                                             org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                             org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for type of 'CAST' expression
        Overrides:
        completeCastOperationExpression_TypeCast in class AbstractQlProposalProvider
      • completeCaseOperationExpression_Body

        public void completeCaseOperationExpression_Body​(org.eclipse.emf.ecore.EObject model,
                                                         org.eclipse.xtext.Assignment assignment,
                                                         org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                         org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for body of 'CASE' expression
        Overrides:
        completeCaseOperationExpression_Body in class AbstractQlProposalProvider
      • completeQuerySchemaTotalControlPoint_Periods

        public void completeQuerySchemaTotalControlPoint_Periods​(org.eclipse.emf.ecore.EObject model,
                                                                 org.eclipse.xtext.Assignment assignment,
                                                                 org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                                 org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for 'PERIODS' in 'TOTALS'
        Overrides:
        completeQuerySchemaTotalControlPoint_Periods in class AbstractQlProposalProvider
      • createLiteralProposals

        public void createLiteralProposals​(org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                           org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for LiteralExpression
        Parameters:
        context - - current context of document
        acceptor - - current ICompletionProposalAcceptor
      • completeInExpression_Query

        public void completeInExpression_Query​(org.eclipse.emf.ecore.EObject model,
                                               org.eclipse.xtext.Assignment assignment,
                                               org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                               org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for 'IN' expression with nested query
        Overrides:
        completeInExpression_Query in class AbstractQlProposalProvider
      • completeKeyword

        public void completeKeyword​(org.eclipse.xtext.Keyword keyword,
                                    org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext contentAssistContext,
                                    org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Filtering keyword proposals
        Overrides:
        completeKeyword in class org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider
      • complete_IDENT_SPEC_MULTI

        public void complete_IDENT_SPEC_MULTI​(org.eclipse.emf.ecore.EObject model,
                                              org.eclipse.xtext.RuleCall ruleCall,
                                              org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                              org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for MultiPartCommonExpression
      • complete_IDENT_SPEC_MULTI_TABLE

        public void complete_IDENT_SPEC_MULTI_TABLE​(org.eclipse.emf.ecore.EObject model,
                                                    org.eclipse.xtext.RuleCall ruleCall,
                                                    org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                    org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for MultiPartQuerySchemaTable
      • completeQuerySchemaTableParameter_Expression

        public void completeQuerySchemaTableParameter_Expression​(org.eclipse.emf.ecore.EObject model,
                                                                 org.eclipse.xtext.Assignment assignment,
                                                                 org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                                 org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for QuerySchemaTableParameter
        Overrides:
        completeQuerySchemaTableParameter_Expression in class AbstractQlProposalProvider
      • completeParameterExpression_Name

        public void completeParameterExpression_Name​(org.eclipse.emf.ecore.EObject model,
                                                     org.eclipse.xtext.Assignment assignment,
                                                     org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                     org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for ParameterExpression
        Overrides:
        completeParameterExpression_Name in class AbstractQlProposalProvider
      • complete_ParameterExpression

        public void complete_ParameterExpression​(org.eclipse.emf.ecore.EObject model,
                                                 org.eclipse.xtext.RuleCall ruleCall,
                                                 org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                 org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for ParameterExpression
        Overrides:
        complete_ParameterExpression in class AbstractQlProposalProvider
      • complete_QuerySchemaTableForUpdate

        public void complete_QuerySchemaTableForUpdate​(org.eclipse.emf.ecore.EObject model,
                                                       org.eclipse.xtext.RuleCall ruleCall,
                                                       org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                       org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Overrides:
        complete_QuerySchemaTableForUpdate in class AbstractQlProposalProvider
      • completeTopSelector_SelectFields

        public void completeTopSelector_SelectFields​(org.eclipse.emf.ecore.EObject model,
                                                     org.eclipse.xtext.Assignment assignment,
                                                     org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                     org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Overrides:
        completeTopSelector_SelectFields in class AbstractQlProposalProvider
      • completeValueLiteralExpression_Values

        public void completeValueLiteralExpression_Values​(org.eclipse.emf.ecore.EObject model,
                                                          org.eclipse.xtext.Assignment assignment,
                                                          org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                          org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for ValueLiteralExpression
        Overrides:
        completeValueLiteralExpression_Values in class AbstractQlProposalProvider
      • completeTypeLiteralExpression_Table

        public void completeTypeLiteralExpression_Table​(org.eclipse.emf.ecore.EObject model,
                                                        org.eclipse.xtext.Assignment assignment,
                                                        org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                        org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for TypeLiteralExpression
        Overrides:
        completeTypeLiteralExpression_Table in class AbstractQlProposalProvider
      • completeQuerySchemaTotalControlPoint_PeriodAdditionBegin

        public void completeQuerySchemaTotalControlPoint_PeriodAdditionBegin​(org.eclipse.emf.ecore.EObject model,
                                                                             org.eclipse.xtext.Assignment assignment,
                                                                             org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                                             org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for 'begin' parameters of periods in QuerySchemaTotalControlPoint
        Overrides:
        completeQuerySchemaTotalControlPoint_PeriodAdditionBegin in class AbstractQlProposalProvider
      • completeQuerySchemaTotalControlPoint_PeriodAdditionEnd

        public void completeQuerySchemaTotalControlPoint_PeriodAdditionEnd​(org.eclipse.emf.ecore.EObject model,
                                                                           org.eclipse.xtext.Assignment assignment,
                                                                           org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                                           org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Creates proposals for 'end' parameters of periods in QuerySchemaTotalControlPoint
        Overrides:
        completeQuerySchemaTotalControlPoint_PeriodAdditionEnd in class AbstractQlProposalProvider
      • completeFieldWithCasting_Table

        public void completeFieldWithCasting_Table​(org.eclipse.emf.ecore.EObject model,
                                                   org.eclipse.xtext.Assignment assignment,
                                                   org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                   org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        proposals for FieldWithCasting
        Overrides:
        completeFieldWithCasting_Table in class AbstractQlProposalProvider
      • isValidProposal

        protected boolean isValidProposal​(String proposal,
                                          String prefix,
                                          org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context)
        Overrides:
        isValidProposal in class org.eclipse.xtext.ui.editor.contentassist.AbstractCompletionProposalFactory
      • doCreateProposal

        protected org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal doCreateProposal​(String proposal,
                                                                                                            StyledString displayString,
                                                                                                            org.eclipse.swt.graphics.Image image,
                                                                                                            int priority,
                                                                                                            org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context)
        Overrides:
        doCreateProposal in class org.eclipse.xtext.ui.editor.contentassist.AbstractCompletionProposalFactory
      • isMultiPartCommonExpressionWithoutContent

        protected boolean isMultiPartCommonExpressionWithoutContent​(org.eclipse.emf.ecore.EObject object)
        Checks that object corresponding to the MultiPartCommonExpression with empty last segment
        Parameters:
        object - checking object, can't be null
        Returns:
        true if object corresponding to the MultiPartCommonExpression with empty last segment, false otherwise
      • createProposalsForBeginQuery

        protected void createProposalsForBeginQuery​(org.eclipse.emf.ecore.EObject model,
                                                    org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                    org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for start of query
        Parameters:
        model - - current model object
        context - - current context of document
        acceptor - - current ICompletionProposalAcceptor
      • createProposalsForSource

        protected void createProposalsForSource​(org.eclipse.emf.ecore.EObject model,
                                                org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for section 'FROM'
        Parameters:
        model - - current model object
        context - - current context of document
        acceptor - - current ICompletionProposalAcceptor
      • createLinkedModeModel

        protected void createLinkedModeModel​(org.eclipse.xtext.ui.editor.model.IXtextDocument doc,
                                             org.eclipse.jface.text.link.LinkedPosition[] linkedPos,
                                             int stopPos,
                                             org.eclipse.jface.text.ITextViewer viewer,
                                             String text)
        Create LinkedModemodel for proposals
        Parameters:
        doc - - document that defines the LinkedModeModel
        linkedPos - - position of LinkedModeModel
        stopPos - - offset of position of cursor after that LinkedModeModel will be closed
        viewer - - current viewer
        text - - text which will be marked
        See Also:
        LinkedModeModel
      • createProposalsForNestedQuery

        protected void createProposalsForNestedQuery​(org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                     org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor)
        Create proposals for nested query
        Parameters:
        context - - current context of document
        acceptor - - current ICompletionProposalAcceptor
      • initFiltering

        protected void initFiltering()
        Initialize of filter for proposals
      • allowedKeywordProposalLang

        protected boolean allowedKeywordProposalLang​(String keyword)
        Check language of keyword
        Parameters:
        keyword - checking keyword
        Returns:
        true if language of keyword equals of configuration language, false otherwise
      • getParametersNames

        protected List<String> getParametersNames​(org.eclipse.emf.ecore.EObject model,
                                                  boolean needTable,
                                                  String additionalPrefix)
        Gets names of the ParameterExpression
        Parameters:
        model - current Ql model element, can't be null
        additionalPrefix - additional prefix for add to parameters name, can be null
        Returns:
        list of found parameters names, never null
      • proposalsFromScopeForFields

        protected void proposalsFromScopeForFields​(org.eclipse.xtext.scoping.IScope scope,
                                                   org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext context,
                                                   org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor acceptor,
                                                   boolean addToFilter,
                                                   boolean onlyTableAllowed)
        Creates proposals for elements from scope
        Parameters:
        scope - actual scope, can't be null
        context - actual ContentAssistContext, can't be null
        acceptor - actual ICompletionProposalAcceptor, can't be null
        addToFilter - true if we need to add elements from scope to special filter, false otherwise
        onlyTableAllowed - true if we need only elements corresponding to tables, false otherwise
      • isTableContainingObject

        protected boolean isTableContainingObject​(org.eclipse.emf.ecore.EObject obj)
        Checks that obj can contains AbstractQuerySchemaTable semantic element
        Parameters:
        obj - checking object, can't be null
        Returns:
        true if obj can contains AbstractQuerySchemaTable semantic element, false otherwise
      • isLegalPartForCommonExpression

        protected boolean isLegalPartForCommonExpression​(org.eclipse.emf.ecore.EObject obj)
        Checks that obj can contains CommonExpression semantic element
        Parameters:
        obj - checking object, can't be null
        Returns:
        true if obj can contains CommonExpression semantic element, false otherwise