Class XtextCallHierarchyNode

    • Constructor Detail

      • XtextCallHierarchyNode

        protected XtextCallHierarchyNode​(XtextCallHierarchyNode parent,
                                         java.lang.Object element)
        Creates a new Xtext call hierarchy node.
        Parameters:
        parent - the parent node, or null if this is a root node
        element - the underlying model element (not null)
    • Method Detail

      • findCallReferences

        protected void findCallReferences​(java.util.function.Consumer<org.eclipse.xtext.resource.IReferenceDescription> acceptor,
                                          org.eclipse.core.runtime.IProgressMonitor monitor)
        Finds the call references for this node.

        This implementation uses the call hierarchy utility to find the call references. Depending on the kind of this node, it will find either caller references or callee references.

        Parameters:
        acceptor - accepts the matches (never null)
        monitor - a progress monitor, or null if progress reporting is not desired. The caller must not rely on IProgressMonitor.done() having been called by the receiver
      • createCallLocation

        protected ICallLocation createCallLocation​(java.lang.Object caller,
                                                   java.lang.Object callee,
                                                   org.eclipse.xtext.resource.IReferenceDescription callReference)
        Creates and returns a call location based on the given call reference.

        This implementation returns a new instance of CallLocation. It uses the call hierarchy utility to obtain the call text info.

        Parameters:
        caller - the caller element, or null if unknown
        callee - the callee element, or null if unknown
        callReference - never null
        Returns:
        the created call location (not null)
      • getUri

        protected abstract org.eclipse.emf.common.util.URI getUri()
        Returns the corresponding URI for this node.
        Returns:
        the corresponding URI (not null)
      • createChildIfAbsent

        protected abstract XtextCallHierarchyNode createChildIfAbsent​(java.util.Map<org.eclipse.emf.common.util.URI,​XtextCallHierarchyNode> children,
                                                                      org.eclipse.xtext.resource.IReferenceDescription callReference)
        Returns a child node for the given call reference, creating it if necessary. If the given map does not already contain a mapping for the requested node, this method will attempt to create it and enter it into the map. Note that this method must not add call locations to the child node; they are added separately.
        Parameters:
        children - never null
        callReference - never null
        Returns:
        the corresponding (existing or created) child node, or null if no child node can be created for the given call reference
      • getCallHierarchyUtility

        protected abstract XtextCallHierarchyUtility getCallHierarchyUtility()
        Returns the call hierarchy utility used by this node.
        Returns:
        the call hierarchy utility (not null)