Interface ICallHierarchyNode
- All Superinterfaces:
org.eclipse.core.runtime.IAdaptable
- All Known Implementing Classes:
CallHierarchyNode
,XtextCallHierarchyNode
public interface ICallHierarchyNode
extends org.eclipse.core.runtime.IAdaptable
Represents a call hierarchy node.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.eclipse.ui.model.IWorkbenchAdapter
A default workbench adapter for call hierarchy nodes. -
Method Summary
Modifier and TypeMethodDescriptiondefault <T> T
getAdapter
(Class<T> adapter) Returns the call locations associated with this node.getChildren
(org.eclipse.core.runtime.IProgressMonitor monitor) Returns the immediate child nodes of this node.Returns the underlying model element of this node (e.g., an element representing a method declaration).getKind()
Returns the call hierarchy kind for this node.Returns the parent node of this node.default boolean
Returns whether this node is recursive (i.e., whether there is an ancestor node containing the same element as this node).default boolean
Returns whether this node may have child nodes.default void
refresh()
Informs this node that it is about to be refreshed in a structured viewer.
-
Field Details
-
DEFAULT_WORKBENCH_ADAPTER
static final org.eclipse.ui.model.IWorkbenchAdapter DEFAULT_WORKBENCH_ADAPTERA default workbench adapter for call hierarchy nodes.
-
-
Method Details
-
getAdapter
Default implementation of this method in
ICallHierarchyNode
returns the underlying modelelement
if it is an instance of the given class. Otherwise, if anIWorkbenchAdapter
is requested, it returns theDEFAULT_WORKBENCH_ADAPTER
. As a fallback, it delegates to the Platform's adapter manager.- Specified by:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
-
getKind
CallHierarchyKind getKind()Returns the call hierarchy kind for this node. The kind does not change over the lifetime of the node.- Returns:
- the call hierarchy kind (never
null
)
-
getElement
Object getElement()Returns 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.- Returns:
- the underlying model element (never
null
)
-
getParent
ICallHierarchyNode getParent()Returns the parent node of this node. The association does not change over the lifetime of the node.- Returns:
- the parent node, or
null
if this is a root node
-
getCallLocations
ICallLocation[] getCallLocations()Returns the call locations associated with this node.- Returns:
- the call locations (never
null
, may be empty). Clients must not modify the returned array.
-
isRecursive
default 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,false
is returned.- Returns:
true
if the node is recursive, andfalse
otherwise
-
mayHaveChildren
default boolean mayHaveChildren()Returns whether this node may have child nodes.Default implementation returns
false
if this node isrecursive
.- Returns:
true
if this node may have child nodes, andfalse
otherwise
-
getChildren
Returns the immediate child nodes of this node. Returns a zero-length array ifmayHaveChildren()
returnsfalse
for this node. The returned nodes must correspond to the call hierarchykind
.- Parameters:
monitor
- a progress monitor, ornull
if 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.
-
refresh
default void refresh()Informs this node that it is about to be refreshed in a structured viewer.Default implementation does nothing.
- See Also:
-
StructuredViewer.refresh(Object)
-