Class BslDocumentationProvider


  • public class BslDocumentationProvider
    extends Object
    Contains special methods for getting different type of context help for BSL
    • Constructor Detail

      • BslDocumentationProvider

        public BslDocumentationProvider()
    • Method Detail

      • createSyntax

        public static String createSyntax​(Method method)
        Gets syntax of Bsl method
        Parameters:
        method - Method
        Returns:
        syntax string
      • getParameterizedHtmlPath

        public static String getParameterizedHtmlPath​(Version version)
        Gets parameterized html path to help context information
        Parameters:
        version - actual project version is the parameter of the path, can't be null
        Returns:
        parameterized html path to help context information, never null
      • getEnTypeName

        public String getEnTypeName​(String name,
                                    org.eclipse.emf.ecore.resource.Resource context)
        Gets English name by name in different language for Type
        Parameters:
        name - current name
        context - current context
        Returns:
        English name of Type
      • addDecorToDoc

        public String addDecorToDoc​(String doc)
        Add special css to doc
        Parameters:
        doc - source text
        Returns:
        decorated text
      • getDocContentByEObject

        public String getDocContentByEObject​(org.eclipse.emf.ecore.EObject object)
        Gets raw documentation content for element from model of BSL
        Parameters:
        object - model element
        Returns:
        raw documentation content for given element
      • getDocContentByEObjectAndOffset

        public String getDocContentByEObjectAndOffset​(org.eclipse.emf.ecore.EObject object,
                                                      Integer offset)
        Gets raw documentation content for element from model of BSL
        Parameters:
        object - model element
        offset - actual offset
        Returns:
        raw documentation content for given element
      • getDocByEObject

        public BslDocumentationProvider.ShortFullDoc getDocByEObject​(org.eclipse.emf.ecore.EObject object)
        Gets documentation for element from model of BSL
        Parameters:
        object - model element
        Returns:
        documentation for given element
      • getDocByEObjectAndOffset

        public BslDocumentationProvider.ShortFullDoc getDocByEObjectAndOffset​(org.eclipse.emf.ecore.EObject object,
                                                                              Integer offset)
        Gets documentation for element from model of BSL
        Parameters:
        object - model element
        offset - actual offset
        Returns:
        documentation for given element
      • getVersion

        public Version getVersion​(org.eclipse.emf.ecore.EObject object)
        Gets corresponding project version by object
        Parameters:
        object - object for getting project version, can't be null
        Returns:
        corresponding project version by object, never null
      • getShortDoc

        public String getShortDoc​(org.eclipse.xtext.ui.editor.model.IXtextDocument doc,
                                  int offset)
        Gets short documentation
        Returns:
        documentation
      • getFullDoc

        public String getFullDoc​(org.eclipse.xtext.ui.editor.model.IXtextDocument doc,
                                 int offset)
        Get full documentation for the element from document in position offset
        Parameters:
        doc - document which contains interest element
        offset - position of element in doc
        Returns:
        full documentation
      • getDocByContext

        public String getDocByContext​(org.eclipse.help.IContext context)
        Gets full documentation by IContext
        Parameters:
        context - actual help context, can be null
        Returns:
        text of documentation from context, or empty string if documentation wasn't found or context is null, never null
      • getFullDocWithDecor

        public String getFullDocWithDecor​(org.eclipse.xtext.ui.editor.model.IXtextDocument doc,
                                          int offset)
        Gets full documentation with decoration text
        Parameters:
        doc - document which contains interest element
        offset - position of element in doc
        Returns:
        full documentation
      • getTypeSetNames

        public Map<String,​String> getTypeSetNames​(org.eclipse.xtext.ui.editor.model.IXtextDocument document)
        Gets actual TypeSet names and their including types.
        Parameters:
        document - actual IXtextDocument for getting Resource and call method getTypeSetNames(Resource), can't be null
        Returns:
        the map, where key - name of the type category name (TypeSet name equals to category type name), value - names of the object which has type corresponding to the category type name in key of the map through the comma. At the end of the value you can find special symbol '#' and name of the base type after it.
        Attention for category "AnyRef" - the value is names of the type corresponding to the it through the comma. Also there is no special symbol '#' at the end.
        Never null
      • getTypeSetNames

        public Map<String,​String> getTypeSetNames​(org.eclipse.emf.ecore.resource.Resource resource)
        Gets actual TypeSet names and their including types.
        Parameters:
        resource - actual Resource for getting IScope of all producing types in project, can't be null
        Returns:
        the map, where key - name of the type category name (TypeSet name equals to category type name), value - names of the object which has type corresponding to the category type name in key of the map through the comma. At the end of the value you can find special symbol '#' and name of the base type after it.
        Attention for category "AnyRef" - the value is names of the type corresponding to the it through the comma. Also there is no special symbol '#' at the end.
        Never null
      • getDocFromUrl

        public String getDocFromUrl​(URL url)
        Gets content from url
        Parameters:
        url - address of documentation, can be null
        Returns:
        text of documentation was read from url or empty string if documentation wasn't read or url is null, never null
      • getDocForProducingTypes

        public String getDocForProducingTypes​(URL url,
                                              Version version,
                                              Map<String,​String> typeSetNames)
        Gets documentation for TypeSet and producing Type
        Parameters:
        url - actual URL for getting documentation, can't be null
        version - actual version of the project, can't be null
        typeSetNames - the map, where key - name of the type category name (TypeSet name equals to category type name), value - names of the object which has type corresponding to the category type name in key of the map through the comma. At the end of the value you can find special symbol '#' and name of the base type after it.
        Attention for category "AnyRef" - the value is names of the type corresponding to the it through the comma. Also there is no special symbol '#' at the end.
        Can't be null
        Returns:
        documentation for TypeSet and producing Type or empty string if documentation wasn't found, never null
      • getDocumentationForGroupingMethod

        public String getDocumentationForGroupingMethod​(Collection<org.eclipse.xtext.util.Pair<Method,​TypeItem>> methods,
                                                        int paramSetIndex,
                                                        Version version)
        Gets documentation for grouping method in syntax-context list
        Parameters:
        methods - grouping methods from syntax-context list, can't be null
        paramSetIndex - index of the ParamSet for creating documentation
        version - actual project version, can't be null
        Returns:
        documentation for grouping method in syntax-context list, never null
      • getDocumentationForGroupingMethod

        public String getDocumentationForGroupingMethod​(Collection<org.eclipse.xtext.util.Pair<Method,​TypeItem>> methods,
                                                        int paramSetIndex,
                                                        Version version,
                                                        boolean needTemplate)
        Gets documentation for grouping method in syntax-context list
        Parameters:
        methods - grouping methods from syntax-context list, can't be null
        paramSetIndex - index of the ParamSet for creating documentation
        version - actual project version, can't be null
        needTemplate - true if documentation should contain help context id instead real help url, false it real hepl url in documentation
        Returns:
        documentation for grouping method in syntax-context list, never null
      • getDocumentationForGroupingProperty

        public String getDocumentationForGroupingProperty​(Collection<org.eclipse.xtext.util.Pair<Property,​TypeItem>> properties,
                                                          Version version)
        Gets documentation for grouping properties in syntax-context list
        Parameters:
        methods - grouping properties from syntax-context list, can't be null
        version - actual project version, can't be null
        Returns:
        documentation for grouping properties in syntax-context list, never null
      • getDocumentationForGroupingProperty

        public String getDocumentationForGroupingProperty​(Collection<org.eclipse.xtext.util.Pair<Property,​TypeItem>> properties,
                                                          Version version,
                                                          boolean needTemplate)
        Gets documentation for grouping properties in syntax-context list
        Parameters:
        methods - grouping properties from syntax-context list, can't be null
        version - actual project version, can't be null
        needTemplate - true if documentation should contain help context id instead real help url, false it real hepl url in documentation
        Returns:
        documentation for grouping properties in syntax-context list, never null
      • getMethodicalLink

        public String getMethodicalLink​(String fullDocumentation)
        Gets url to methodical information by full documentation content
        Parameters:
        fullDocumentation - full documentation content, can't be null
        Returns:
        url to methodical information by full documentation content, never null. Can be empty string if there is no link to methodical information
      • getEObjectHoverDarkStyle

        public String getEObjectHoverDarkStyle()
        Returns dark theme css styles for Eobject hover.
        Returns:
        dark theme css styles for Eobject hover. Can't return null.