Class MarkupParameterRenderer

java.lang.Object
uno.anahata.asi.swing.agi.message.part.tool.param.MarkupParameterRenderer
All Implemented Interfaces:
ParameterRenderer<Object>

public class MarkupParameterRenderer extends Object implements ParameterRenderer<Object>
A parameter renderer that falls back to standard markdown/HTML rendering.
Author:
anahata
  • Field Details

    • renderer

      private MarkupTextSegmentRenderer renderer
      The underlying segment renderer used for the actual markup transformation.
  • Constructor Details

    • MarkupParameterRenderer

      public MarkupParameterRenderer()
      No-arg constructor for factory instantiation.
  • Method Details

    • init

      public void init(AgiPanel agiPanel, AbstractToolCall<?,?> call, String paramName, Object value)
      Initializes the renderer with its context.

      Implementation details: Wraps the value in a MarkupTextSegmentRenderer to support standard Markdown/HTML formatting within the tool call.

      Specified by:
      init in interface ParameterRenderer<Object>
      Parameters:
      agiPanel - The parent agi panel.
      call - The tool call being rendered.
      paramName - The name of the parameter.
      value - The initial value.
    • getComponent

      public JComponent getComponent()
      Returns the Swing component that performs the rendering.

      Implementation details: Delegates to the underlying markup renderer's component.

      Specified by:
      getComponent in interface ParameterRenderer<Object>
      Returns:
      The rendering component.
    • updateContent

      public void updateContent(Object value)
      Updates the renderer with a new value.

      Implementation details: Resolves the object to a string and pushes it into the markup pipeline.

      Specified by:
      updateContent in interface ParameterRenderer<Object>
      Parameters:
      value - The new value to render.
    • render

      public boolean render()
      Triggers the rendering logic.

      Implementation details: Triggers the visual refresh of the markup component.

      Specified by:
      render in interface ParameterRenderer<Object>
      Returns:
      True if a visual update occurred.