Class ObjectToStringParameterRenderer
- All Implemented Interfaces:
ParameterRenderer<Object>
- Direct Known Subclasses:
JavaCodeParameterRenderer
This implementation authoritatively leverages the AbstractTextResourceViewer
directly, bypassing the markdown segment middle-man to provide a professional,
host-aware editor for tool parameters.
Representational Fidelity: Uses the polymorphic TextUtils.resolveContentString(Object)
to handle Strings, Enums, Collections, and Arrays with 100% technical purity.
- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AgiPanelThe parent panel.private final JPanelThe main container panel.private booleanWhether the user is allowed to edit this parameter.private StringThe programming language for syntax highlighting.private AbstractTextResourceViewerThe high-fidelity viewer. -
Constructor Summary
ConstructorsConstructorDescriptionNo-arg constructor for factory instantiation. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringHandlecreateHandle(String content, AbstractToolCall<?, ?> call, String paramName) Creates a String handle calling the file "Anahata" if the extension is "java".Returns the Swing component that performs the rendering.voidinit(AgiPanel agiPanel, AbstractToolCall<?, ?> call, String paramName, Object value) Initializes the renderer with its context.booleanrender()Triggers the rendering logic.voidupdateContent(Object value) Updates the renderer with a new value.
-
Field Details
-
agiPanel
The parent panel. -
container
The main container panel. -
viewer
The high-fidelity viewer. -
language
The programming language for syntax highlighting. -
editable
private boolean editableWhether the user is allowed to edit this parameter.
-
-
Constructor Details
-
ObjectToStringParameterRenderer
public ObjectToStringParameterRenderer()No-arg constructor for factory instantiation.
-
-
Method Details
-
createHandle
Creates a String handle calling the file "Anahata" if the extension is "java".- Parameters:
content- the content of the handlecall- the tool call that is creating itparamName- the parameter name in question- Returns:
- a new StringHandle configured for syntax highlighting and name matching.
-
init
Initializes the renderer with its context.Implementation details: Initializes the high-fidelity pipeline by resolving the object to a string, wrapping it in a virtual resource, and requesting a viewer.
- Specified by:
initin interfaceParameterRenderer<Object>- Parameters:
agiPanel- The parent agi panel.call- The tool call being rendered.paramName- The name of the parameter.value- The initial value.
-
getComponent
Returns the Swing component that performs the rendering.Implementation details: Returns the central container which encapsulates the action strip and the high-fidelity viewer.
- Specified by:
getComponentin interfaceParameterRenderer<Object>- Returns:
- The rendering component.
-
updateContent
Updates the renderer with a new value.Implementation details: Updates the underlying virtual resource handle with the new object's string representation.
- Specified by:
updateContentin interfaceParameterRenderer<Object>- Parameters:
value- The new value to render.
-
render
public boolean render()Triggers the rendering logic.Implementation details: Re-validates the container to ensure height adjustments are propagated through the conversation layout.
- Specified by:
renderin interfaceParameterRenderer<Object>- Returns:
- True if a visual update occurred.
-

