Class CallHierarchyNode
java.lang.Object
org.eclipse.handly.ui.callhierarchy.CallHierarchyNode
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,ICallHierarchyNode
- Direct Known Subclasses:
XtextCallHierarchyNode
An abstract base implementation for
ICallHierarchyNode.-
Field Summary
Fields inherited from interface org.eclipse.handly.ui.callhierarchy.ICallHierarchyNode
DEFAULT_WORKBENCH_ADAPTER -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCallHierarchyNode(ICallHierarchyNode parent, Object element) Creates a new call hierarchy node. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCallLocation(ICallLocation callLocation) Appends the given call location to the end of the list of call locations of this node.protected abstract ICallHierarchyNode[]computeChildren(org.eclipse.core.runtime.IProgressMonitor monitor) Computes and returns the immediate child nodes for this node.final ICallLocation[]Returns the call locations associated with this node.final ICallHierarchyNode[]getChildren(org.eclipse.core.runtime.IProgressMonitor monitor) Returns the immediate child nodes of this node.final ObjectReturns the underlying model element of this node (e.g., an element representing a method declaration).final ICallHierarchyNodeReturns the parent node of this node.final booleanReturns whether this node is recursive (i.e., whether there is an ancestor node containing the same element as this node).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.handly.ui.callhierarchy.ICallHierarchyNode
getAdapter, getKind, mayHaveChildren, refresh
-
Constructor Details
-
CallHierarchyNode
Creates a new call hierarchy node.- Parameters:
parent- the parent node, ornullif this is a root nodeelement- the underlying model element (notnull)
-
-
Method Details
-
getElement
Description copied from interface:ICallHierarchyNodeReturns the underlying model element of this node (e.g., an element representing a method declaration). The association does not change over the lifetime of the node.- Specified by:
getElementin interfaceICallHierarchyNode- Returns:
- the underlying model element (never
null)
-
getParent
Description copied from interface:ICallHierarchyNodeReturns the parent node of this node. The association does not change over the lifetime of the node.- Specified by:
getParentin interfaceICallHierarchyNode- Returns:
- the parent node, or
nullif this is a root node
-
getCallLocations
Description copied from interface:ICallHierarchyNodeReturns the call locations associated with this node.- Specified by:
getCallLocationsin interfaceICallHierarchyNode- Returns:
- the call locations (never
null, may be empty). Clients must not modify the returned array. - See Also:
-
addCallLocation
Appends the given call location to the end of the list of call locations of this node.This implementation imposes no restrictions on the call location, except that it must not be
null.- Parameters:
callLocation- notnull
-
isRecursive
public final boolean isRecursive()Returns whether this node is recursive (i.e., whether there is an ancestor node containing the same element as this node).Default implementation traverses the parent chain from this node up through the root node until a node containing the same element as this node is found, in which case it returns
true. If no such node can be found,falseis returned.This implementation returns the value determined and cached at the construction time.
- Specified by:
isRecursivein interfaceICallHierarchyNode- Returns:
trueif the node is recursive, andfalseotherwise
-
getChildren
Returns the immediate child nodes of this node. Returns a zero-length array ifICallHierarchyNode.mayHaveChildren()returnsfalsefor this node. The returned nodes must correspond to the call hierarchykind.This implementation delegates to
computeChildren(IProgressMonitor)if this node may have children. Otherwise, a zero-length array is returned.- Specified by:
getChildrenin interfaceICallHierarchyNode- Parameters:
monitor- a progress monitor, ornullif progress reporting is not desired. The caller must not rely onIProgressMonitor.done()having been called by the receiver- Returns:
- the immediate child nodes of this node (never
null, may be empty). Clients must not modify the returned array.
-
computeChildren
protected abstract ICallHierarchyNode[] computeChildren(org.eclipse.core.runtime.IProgressMonitor monitor) Computes and returns the immediate child nodes for this node.- Parameters:
monitor- a progress monitor, ornullif progress reporting is not desired. The caller must not rely onIProgressMonitor.done()having been called by the receiver- Returns:
- the immediate child nodes of this node (never
null, may be empty). Clients must not modify the returned array. - See Also:
-