Class UriParameterRenderer

java.lang.Object
uno.anahata.asi.swing.agi.message.part.tool.param.UriParameterRenderer
All Implemented Interfaces:
ParameterRenderer<Object>
Direct Known Subclasses:
PathParameterRenderer

public class UriParameterRenderer extends Object implements ParameterRenderer<Object>
A specialized parameter renderer for URIs.

This renderer provides a sleek chip showing the URI and allows opening it via the host-specific ResourceUI strategy.

Author:
anahata
  • Field Details

    • agiPanel

      private AgiPanel agiPanel
      The parent AGI panel interface.
    • call

      private AbstractToolCall<?,?> call
      The tool call execution context associated with this parameter.
    • paramName

      private String paramName
      The declared name of this parameter.
    • value

      private Object value
      The raw value bound to this parameter.
    • container

      private final JPanel container
      Wrapper panel layout containing rendering chips.
  • Constructor Details

    • UriParameterRenderer

      public UriParameterRenderer()
      Constructs a new UriParameterRenderer and initializes the container layout.
  • Method Details

    • init

      public void init(AgiPanel agiPanel, AbstractToolCall<?,?> call, String paramName, Object value)
      Description copied from interface: ParameterRenderer
      Initializes the renderer with its context.
      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()
      Description copied from interface: ParameterRenderer
      Returns the Swing component that performs the rendering.
      Specified by:
      getComponent in interface ParameterRenderer<Object>
      Returns:
      The rendering component.
    • updateContent

      public void updateContent(Object value)
      Description copied from interface: ParameterRenderer
      Updates the renderer with a new value.
      Specified by:
      updateContent in interface ParameterRenderer<Object>
      Parameters:
      value - The new value to render.
    • render

      public boolean render()
      Description copied from interface: ParameterRenderer
      Triggers the rendering logic.
      Specified by:
      render in interface ParameterRenderer<Object>
      Returns:
      True if a visual update occurred.
    • createChip

      private JPanel createChip(String uriString)
      Dynamically builds a beautiful UI chip for the specified URI.
      Parameters:
      uriString - The string representation of the URI.
      Returns:
      A panel representing the chip with an action button.