Class ToolNode
java.lang.Object
uno.anahata.asi.swing.agi.context.AbstractContextNode<AbstractTool<?,?>>
uno.anahata.asi.swing.agi.context.ToolNode
A context tree node representing an
AbstractTool.
This is a leaf node in the context hierarchy, representing an individual executable function. It displays the tool's declaration token count and its current permission status.
- Author:
- anahata
-
Field Summary
Fields inherited from class AbstractContextNode
agiPanel, children, declarationsTokens, historyTokens, instructionsTokens, ragTokens, status, userObject -
Constructor Summary
ConstructorsConstructorDescriptionToolNode(AgiPanel agiPanel, AbstractTool<?, ?> userObject) Constructs a new ToolNode. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalculates the token counts for this node's own content (excluding children).protected AbstractContextNode<?> createChildNode(Object obj) Creates a new child node for the given domain object.protected List<?> Fetches the current list of domain objects that should be represented as children of this node.Gets a detailed description of the node's purpose or content.getName()Gets the human-readable display name for this node.booleanisActive()Checks if the underlying domain object is currently active in the context.protected voidUpdates the status string for this node.Methods inherited from class AbstractContextNode
equals, getAgi, getChildren, getIcon, hashCode, refresh, refreshData, refreshTokens, toString
-
Constructor Details
-
ToolNode
Constructs a new ToolNode.- Parameters:
agiPanel- The parent agi panel.userObject- The tool to wrap.
-
-
Method Details
-
getName
Gets the human-readable display name for this node. Returns the simple name of the tool, removing any toolkit prefix.- Specified by:
getNamein classAbstractContextNode<AbstractTool<?,?>> - Returns:
- The name to be displayed in the tree.
-
getDescription
Gets a detailed description of the node's purpose or content.- Specified by:
getDescriptionin classAbstractContextNode<AbstractTool<?,?>> - Returns:
- The description string.
-
fetchChildObjects
Fetches the current list of domain objects that should be represented as children of this node.- Specified by:
fetchChildObjectsin classAbstractContextNode<AbstractTool<?,?>> - Returns:
- A list of domain objects.
-
createChildNode
Creates a new child node for the given domain object.- Specified by:
createChildNodein classAbstractContextNode<AbstractTool<?,?>> - Parameters:
obj- The domain object to wrap.- Returns:
- A new AbstractContextNode, or null if the object type is not supported.
-
calculateLocalTokens
protected void calculateLocalTokens()Calculates the token counts for this node's own content (excluding children).- Specified by:
calculateLocalTokensin classAbstractContextNode<AbstractTool<?,?>>
-
isActive
public boolean isActive()Checks if the underlying domain object is currently active in the context.Subclasses override this method to define their specific active-state policy, allowing for clean, polymorphic evaluation without dirty instanceof chains.
- Specified by:
isActivein classAbstractContextNode<AbstractTool<?,?>> - Returns:
trueif active,falseotherwise.
-
updateStatus
protected void updateStatus()Updates the status string for this node.- Specified by:
updateStatusin classAbstractContextNode<AbstractTool<?,?>>
-

