public abstract class XtextCallHierarchyNode extends CallHierarchyNode
ICallHierarchyNode
based on Xtext.DEFAULT_WORKBENCH_ADAPTER
Modifier | Constructor and Description |
---|---|
protected |
XtextCallHierarchyNode(XtextCallHierarchyNode parent,
java.lang.Object element)
Creates a new Xtext call hierarchy node.
|
Modifier and Type | Method and Description |
---|---|
protected ICallHierarchyNode[] |
computeChildren(org.eclipse.core.runtime.IProgressMonitor monitor)
Computes and returns the immediate child nodes for this node.
|
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.
|
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.
|
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.
|
protected abstract XtextCallHierarchyUtility |
getCallHierarchyUtility()
Returns the call hierarchy utility used by this node.
|
protected abstract org.eclipse.emf.common.util.URI |
getUri()
Returns the corresponding URI for this node.
|
addCallLocation, getCallLocations, getChildren, getElement, getParent, isRecursive
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdapter, getKind, mayHaveChildren, refresh
protected XtextCallHierarchyNode(XtextCallHierarchyNode parent, java.lang.Object element)
parent
- the parent node, or null
if this is a root nodeelement
- the underlying model element (not null
)protected ICallHierarchyNode[] computeChildren(org.eclipse.core.runtime.IProgressMonitor monitor)
This implementation computes the child nodes based on the call references
reported by findCallReferences
. To obtain a child node, it calls createChildIfAbsent(Map, IReferenceDescription)
. To create a call location,
it invokes createCallLocation(Object, Object, IReferenceDescription)
.
computeChildren
in class CallHierarchyNode
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 receivernull
,
may be empty). Clients must not modify the returned array.CallHierarchyNode.getChildren(IProgressMonitor)
protected void findCallReferences(java.util.function.Consumer<org.eclipse.xtext.resource.IReferenceDescription> acceptor, org.eclipse.core.runtime.IProgressMonitor monitor)
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
.
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 receiverprotected ICallLocation createCallLocation(java.lang.Object caller, java.lang.Object callee, org.eclipse.xtext.resource.IReferenceDescription callReference)
This implementation returns a new instance of CallLocation
.
It uses the call hierarchy utility
to obtain the call text info
.
caller
- the caller element, or null
if unknowncallee
- the callee element, or null
if unknowncallReference
- never null
null
)protected abstract org.eclipse.emf.common.util.URI getUri()
null
)protected abstract XtextCallHierarchyNode createChildIfAbsent(java.util.Map<org.eclipse.emf.common.util.URI,XtextCallHierarchyNode> children, org.eclipse.xtext.resource.IReferenceDescription callReference)
children
- never null
callReference
- never null
null
if no child node can be created for the given call referenceprotected abstract XtextCallHierarchyUtility getCallHierarchyUtility()
null
)Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0