Class BslContextProvider

  • All Implemented Interfaces:
    org.eclipse.help.IContextProvider

    public class BslContextProvider
    extends Object
    implements org.eclipse.help.IContextProvider
    Special IContextProvider for BSL language
    See Also:
    IContextProvider
    • Method Detail

      • getContext

        public static org.eclipse.help.IContext getContext​(org.eclipse.emf.ecore.EObject object,
                                                           Version version)
        Gets IContext be object
        Parameters:
        object - actual object for getting help context, can't be null
        version - actual project version, can't be null
        Returns:
        help context by object, can be null if there is no help for object
      • getContextId

        public static String getContextId​(org.eclipse.emf.ecore.EObject object,
                                          Version version)
        Gets context id for getting real IContext by it
        Parameters:
        object - actual object for getting help context id, can't be null
        version - actual project version, can't be null
        Returns:
        help context id by object, can be null if there is no help for object
      • getCurrentElement

        public org.eclipse.emf.ecore.EObject getCurrentElement()
        Returns:
        element selected element from BSL grammar
      • getContextChangeMask

        public int getContextChangeMask()
        only for IContextProvider.SELECTION
        Specified by:
        getContextChangeMask in interface org.eclipse.help.IContextProvider
      • getContext

        public org.eclipse.help.IContext getContext​(Object target)
        Gets special IContext by 'id' from plugin com._1c.g5.v8.dt.platform.doc
        Specified by:
        getContext in interface org.eclipse.help.IContextProvider
        Parameters:
        target - actual object for getting help context, can't be null
        Returns:
        help context by object, can be null if there is no help for object
      • getContext

        public org.eclipse.help.IContext getContext​(int offset)
        Get context by offset of element in editor
        Parameters:
        offset - position of caret in editor
        Returns:
        context information for element in this position, can be null if there is no help context for the element in offset position
      • getSearchExpression

        public String getSearchExpression​(Object target)
        Do nothing there all work by default
        Specified by:
        getSearchExpression in interface org.eclipse.help.IContextProvider
      • getContextByEObject

        public org.eclipse.help.IContext getContextByEObject​(org.eclipse.emf.ecore.EObject object,
                                                             Version version)
        Gets IContext be object
        Parameters:
        object - actual object for getting help context, can't be null
        version - actual project version, can't be null
        Returns:
        help context by object, can be null if there is no help for object
      • findEObject

        public org.eclipse.emf.ecore.EObject findEObject​(int offset)
        Gets EObject by offset in current document
        Parameters:
        offset - current offset in document
        Returns:
        corresponding object or null if object wasn't found
      • getVersionPrefix

        public static String getVersionPrefix​(Version version)
        Gets special prefix for id of context help information by the version of the project
        Parameters:
        version - actual project version, can't be null
        Returns:
        special prefix for id of context help information by the version of the project, never null