Class ChatPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ContextListener, StatusListener

public class ChatPanel extends JPanel implements ContextListener, StatusListener
See Also:
  • Constructor Details

    • ChatPanel

      public ChatPanel()
      Creates a new ChatPanel with default configuration and syntax highlighting.
    • ChatPanel

      public ChatPanel(SwingChatConfig config)
      Creates a new ChatPanel with the specified configuration and default syntax highlighting.
      Parameters:
      config - The configuration for the AI assistant.
    • ChatPanel

      public ChatPanel(SwingChatConfig config, EditorKitProvider editorKitProvider)
      Creates a new ChatPanel with the specified configuration and custom syntax highlighting.
      Parameters:
      config - The configuration for the AI assistant.
      editorKitProvider - The provider for syntax highlighting.
  • Method Details

    • contextChanged

      public void contextChanged(Chat source)
      Description copied from interface: ContextListener
      Fired whenever the context has changed in any way (messages added, removed, or modified).

      The listener is responsible for completely redrawing its view or updating its state based on the new context state.

      Specified by:
      contextChanged in interface ContextListener
      Parameters:
      source - The Chat instance where the change occurred.
    • contextCleared

      public void contextCleared(Chat source)
      Description copied from interface: ContextListener
      Fired when the entire context is cleared, usually on a chat restart.
      Specified by:
      contextCleared in interface ContextListener
      Parameters:
      source - The Chat instance that was cleared.
    • statusChanged

      public void statusChanged(ChatStatus status, String lastExceptionToString)
      Description copied from interface: StatusListener
      Called when the chat's operational status changes.
      Specified by:
      statusChanged in interface StatusListener
      Parameters:
      status - The new operational state (e.g., API_CALL_IN_PROGRESS).
      lastExceptionToString - The string representation of the last exception that occurred, or null if none.
    • checkAutobackupOrStartupContent

      public void checkAutobackupOrStartupContent()
    • restartChat

      public void restartChat()