Class AbstractStringLiteralProposalProvider

    • Field Detail

      • EXTERNAL_DATA_PROCESSOR_REFERENCE

        protected static final org.eclipse.emf.ecore.EReference EXTERNAL_DATA_PROCESSOR_REFERENCE
        EReference for get ExternalDataProcessor from scope
      • EXTERNAL_REPORT_REFERENCE

        protected static final org.eclipse.emf.ecore.EReference EXTERNAL_REPORT_REFERENCE
        EReference for get ExternalReport from scope
    • Constructor Detail

      • AbstractStringLiteralProposalProvider

        public AbstractStringLiteralProposalProvider()
    • Method Detail

      • hasHyperlinks

        public boolean hasHyperlinks​(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context)
        Description copied from interface: IStringLiteralHyperlinkProvider
        Checks that hyperlinks enable for current context of StringLiteral
        Specified by:
        hasHyperlinks in interface IStringLiteralHyperlinkProvider
        Parameters:
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        Returns:
        true if hyperlinks enable, false otherwise
      • createHyperlinks

        public void createHyperlinks​(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context,
                                     org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                     com.google.inject.Provider<org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink> hyperlinkProvider,
                                     org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkAcceptor acceptor)
        Description copied from interface: IStringLiteralHyperlinkProvider
        Creates hyperlinks for StringLiteral
        Specified by:
        createHyperlinks in interface IStringLiteralHyperlinkProvider
        Parameters:
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        scopeProvider - actual IScopeProvider, can't be null
        hyperlinkProvider - special provider for XtextHyperlink, can't be null
        acceptor - acceptor for collecting of all created hyperlinks, can't be null
      • addQuoteToBegin

        protected String addQuoteToBegin​(String content)
        Add '"' to content
        Parameters:
        content -
        Returns:
        new content starts with '"'
      • checkForTypeCommonMethod

        protected boolean checkForTypeCommonMethod​(org.eclipse.emf.ecore.EObject object,
                                                   String methodName,
                                                   String methodNameRu,
                                                   int paramNumber,
                                                   int expectedParamNumber)
        Checks that given object is common method in Bsl language with defined name
        Parameters:
        object - checking object, can't be null
        methodName - checked name, can't be null
        methodNameRu - checked name ru, can't be null
        paramNumber - number of string literal parameter
        expectedParamNumber - expected number of string literal parameter
        Returns:
        true if object is common method with defined name
      • checkForTypeCommonMethod

        protected boolean checkForTypeCommonMethod​(org.eclipse.emf.ecore.EObject object,
                                                   List<String> names,
                                                   int paramNumber,
                                                   int expectedParamNumber)
        Checks that given object is common method in Bsl language with defined name
        Parameters:
        object - checking object, can't be null
        names - all allowed names of method, can't be null
        paramNumber - number of string literal parameter
        expectedParamNumber - expected number of string literal parameter
        Returns:
        true if object is common method with defined name
      • checkForTypeMdObjectMethod

        protected boolean checkForTypeMdObjectMethod​(org.eclipse.emf.ecore.EObject object,
                                                     Collection<String> names,
                                                     int paramNumber,
                                                     int expectedParamNumber)
        Checks that given object is md object method in Bsl language with defined name
        Parameters:
        object - checking object, can't be null
        names - all allowed names of method, can't be null
        paramNumber - number of string literal parameter
        expectedParamNumber - expected number of string literal parameter
        Returns:
        true if object is common method with defined name
      • checkForTypeMdObjectMethod

        protected boolean checkForTypeMdObjectMethod​(org.eclipse.emf.ecore.EObject object,
                                                     String methodName,
                                                     String methodNameRu,
                                                     int paramNumber,
                                                     int expectedParamNumber)
        Checks that given object is md object method in Bsl language with defined name
        Parameters:
        object - checking object, can't be null
        methodName - checked name, can't be null
        methodNameRu - checked name ru, can't be null
        paramNumber - number of string literal parameter
        expectedParamNumber - expected number of string literal parameter
        Returns:
        true if object is common method with defined name
      • getAllChildMdObjects

        protected List<MdObject> getAllChildMdObjects​(org.eclipse.xtext.resource.IEObjectDescription parentMdObject,
                                                      org.eclipse.emf.ecore.resource.Resource resource,
                                                      org.eclipse.emf.ecore.EStructuralFeature feature)
        Gets concrete child md object from parentMdObject
        This method should be override by children class for getting needed children objects
        Parameters:
        parentMdObject - , can't be null
        resource - for resolving parentObject, can't be null
        feature - feature of children md objects, can't be null
        Returns:
        list of children objects of parentMdObject, never null
      • getActualFeatureByType

        protected org.eclipse.emf.ecore.EStructuralFeature getActualFeatureByType​(String[] typeNameSegments)
        Gets feature of needed objects by type name
        This method should be override by children class for getting needed feature
        Parameters:
        typeNameSegments - type name, can't be null
        Returns:
        EStructuralFeature, can be null
      • getActualMdObjectByType

        protected org.eclipse.xtext.resource.IEObjectDescription getActualMdObjectByType​(String[] typeNameSegments,
                                                                                         org.eclipse.emf.ecore.EObject parentObject,
                                                                                         org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
        Gets actual IEObjectDescription by type name
        Parameters:
        typeNameSegments - type name divided by segments
        parentObject - context for IScopeProvider
        scopeProvider - actual IScopeProvider, can't be null
        Returns:
        find IEObjectDescription by type name, can be null if md object wasn't found
      • getReference

        protected org.eclipse.emf.ecore.EReference getReference​(String partTypeName)
        Gets reference to configuration objects by part of type name
        Parameters:
        partTypeName - part of type name, can't be null
        Returns:
        corresponding EReference to Configuration object, can be null if reference wasn't found
      • getTypeOfPreviousElement

        protected TypeItem getTypeOfPreviousElement​(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context)
        Gets TypeItem for previous elements for parentObject (if it's DynamicFeatureAccess)
        Parameters:
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        , can't be null
        Returns:
        find TypeItem or null
      • getReferenceDescriptionForMdObject

        protected List<org.eclipse.xtext.resource.IReferenceDescription> getReferenceDescriptionForMdObject​(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context,
                                                                                                            org.eclipse.xtext.scoping.IScopeProvider scopeProvider)
        Computes reference description for mdObject objects by string literals
        Parameters:
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        , can't be null
        scopeProvider - actual IScopeProvider, can't be null
        Returns:
        list of reference description of empty list, if description wan't found, never null
      • createProposalsForCommonMdObjects

        protected List<org.eclipse.xtext.util.Triple<String,​String,​IStringLiteralProposalProvider.IBslStringLiteralProposalImageProvider>> createProposalsForCommonMdObjects​(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context,
                                                                                                                                                                                         String content,
                                                                                                                                                                                         org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                                                                                                                                                         org.eclipse.emf.ecore.EReference ref,
                                                                                                                                                                                         org.eclipse.emf.ecore.EClass eClass)
        Creates proposals for common objects in Configuration
        Parameters:
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        , can't be null
        content - content of the string literal, can't be null
        scopeProvider - actual IScopeProvider, can't be null
        methodNames - allowed Bsl method' names, can't be null
        ref - EReference to common objects for IScopeProvider
        eClass - EClass for getting Image, can't be null
        Returns:
        information about proposal , never null
      • getReferenceDescriptionsCommonMdObjects

        protected List<org.eclipse.xtext.resource.IReferenceDescription> getReferenceDescriptionsCommonMdObjects​(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context,
                                                                                                                 org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                                                                                 org.eclipse.emf.ecore.EReference ref,
                                                                                                                 org.eclipse.emf.ecore.EClass eClass)
        Computes reference description for common objects by string literals
        Parameters:
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        , can't be null
        scopeProvider - actual IScopeProvider, can't be null
        methodNames - allowed Bsl method' names, can't be null
        ref - EReference to common objects for IScopeProvider, can't be null
        eClass - EClass for getting Image, can't be null
        Returns:
        list of reference description of empty list, if description wan't found, never null
      • checkForTypeMethod

        protected boolean checkForTypeMethod​(org.eclipse.emf.ecore.EObject object,
                                             Collection<String> names,
                                             int paramNumber,
                                             int expectedParamNumber)
        Checks method type
        Parameters:
        object - actual object from Bsl module, can't be null
        names - allowed methods names, can't be null
        paramNumber - actual number of parameter in method
        expectedParamNumber - expected number of parameter in method
        Returns:
        true if is appropriate method type, false otherwise
      • checkForTypeMethod

        protected boolean checkForTypeMethod​(org.eclipse.emf.ecore.EObject object,
                                             Collection<String> names,
                                             int paramNumber,
                                             List<Integer> expectedParamNumbers)
        Checks method type
        Parameters:
        object - actual object from Bsl module, can't be null
        names - allowed methods names, can't be null
        paramNumber - actual number of parameter in method
        expectedParamNumbers - set of expected numbers of parameter in method, can't be null
        Returns:
        true if is appropriate method type, false otherwise
      • getScope

        protected Iterable<org.eclipse.xtext.resource.IEObjectDescription> getScope​(org.eclipse.emf.ecore.EObject context,
                                                                                    org.eclipse.emf.ecore.EReference reference,
                                                                                    org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                                                    IIndexSlicePredicateService slicePredicateService,
                                                                                    boolean isRussian)
        Gets and filtered scope.
        Parameters:
        context - actual context
        context - the element from which an element shall be referenced. It doesn't need to be the element containing the reference, it is just used to find the most inner scope for given EReference.
        reference - the reference for which to get the scope, can't be null
        isRussian - current language, true if Russian, false otherwise
        Returns:
        elements from filtered scope after, never null
      • getFilterScope

        protected Collection<ISliceFilter> getFilterScope​(IIndexSlicePredicateService slicePredicateService,
                                                          boolean isRussian)
        Gets special filter for IScope, elements in the scope are filtered by language
        Parameters:
        isRussian - current language, true if Russian, false otherwise
        Returns:
        created filter, never null
      • createHyperlinksForAllReferences

        protected void createHyperlinksForAllReferences​(org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context,
                                                        org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                        com.google.inject.Provider<org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink> hyperlinkProvider,
                                                        org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkAcceptor acceptor)
        Parameters:
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        , can't be null
        scopeProvider - actual IScopeProvider, can't be null
        hyperlinkProvider - special provider for XtextHyperlink, can't be null
        acceptor - acceptor for collecting of all created hyperlinks, can't be null
      • createHyperlinksForFormModule

        protected void createHyperlinksForFormModule​(String formName,
                                                     org.eclipse.xtext.util.Triple<org.eclipse.emf.ecore.EObject,​List<Expression>,​Integer> context,
                                                     org.eclipse.xtext.scoping.IScopeProvider scopeProvider,
                                                     com.google.inject.Provider<org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink> hyperlinkProvider,
                                                     org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkAcceptor acceptor)
        Creates hyperlinks for form module
        Parameters:
        formName - name of the processing form, can't be null
        context - contains
        • parentObject object contains string literal in its parameters
        • allExpr all parameters of parentObject
        • paramNumber number of string literal in parameter method's list
        , can't be null
        scopeProvider - actual IScopeProvider, can't be null
        hyperlinkProvider - special provider for XtextHyperlink, can't be null
        acceptor - acceptor for collecting of all created hyperlinks, can't be null
      • createHyperlinks

        protected void createHyperlinks​(StringLiteral literal,
                                        org.eclipse.emf.common.util.URI uri,
                                        String hyperlinkText,
                                        int length,
                                        com.google.inject.Provider<org.eclipse.xtext.ui.editor.hyperlinking.XtextHyperlink> hyperlinkProvider,
                                        org.eclipse.emf.ecore.resource.URIConverter uriConverter,
                                        org.eclipse.xtext.ui.editor.hyperlinking.IHyperlinkAcceptor acceptor)
        Creates hyperlinks for object corresponding to the StringLiteral from Built-In language
        Parameters:
        literal - StringLiteral from Built-In language, can't be null
        uri - actual uri for creating hyperlinks, can't be null
        hyperlinkText - text of hyperlinks, can't be null
        length - actual length of hyperlinks
        hyperlinkProvider - special provider for XtextHyperlink, can't be null
        uriConverter - actual URIConverter, can't be null
        acceptor - acceptor for collecting of all created hyperlinks, can't be null
      • startWith

        protected boolean startWith​(org.eclipse.xtext.naming.QualifiedName fullName,
                                    String[] userSegments)
        Checks that qualified name starts with user segments
        Parameters:
        fullName - checked QualifiedName, cannot be null
        userSegments - segments if name is inputed by user, QualifiedName should start from them, cannot be null
        Returns:
        true if QualifiedName starts from user segments, false otherwise
      • isMetaType

        protected boolean isMetaType​(org.eclipse.xtext.resource.IEObjectDescription type)
        Checks that IEObjectDescription corresponding to the Type added by com._1c.g5.v8.dt.bsl.types.extension.IExternalMetaTypesProvider
        Parameters:
        type - checking IEObjectDescription, cannot be null
        Returns:
        true if type corresponding to the Type added by com._1c.g5.v8.dt.bsl.types.extension.IExternalMetaTypesProvider, false otherwise