Class AnthropicProviderPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class AnthropicProviderPanel extends AbstractAiProviderPanel<AnthropicProvider>
Specialized Swing configuration panel for Anthropic Claude providers.

Exposes Anthropic-specific options like the anthropic-version header.

Author:
anahata
See Also:
  • Field Details

    • anthropicVersionField

      private JTextField anthropicVersionField
      Text field for configuring the Anthropic API version header.
  • Constructor Details

    • AnthropicProviderPanel

      public AnthropicProviderPanel()
      Constructs a new uninitialized AnthropicProviderPanel.
  • Method Details

    • init

      public void init(@NonNull @NonNull AbstractSwingAsiContainer container, @NonNull @NonNull AnthropicProvider provider, Runnable removeCallback)
      Initializes all UI components, listeners, and models table bound to the specified provider.

      Adds the 'Anthropic Version' text field to the form.

      Overrides:
      init in class AbstractAiProviderPanel<AnthropicProvider>
      Parameters:
      container - The parent ASI container instance.
      provider - The provider instance to bind to.
      removeCallback - Callback to trigger when the user deletes the provider.
    • isModified

      public boolean isModified()
      Checks if any settings or API key text in the UI have been modified compared to the domain entity.

      Checks both standard fields and the Anthropic version text field.

      Overrides:
      isModified in class AbstractAiProviderPanel<AnthropicProvider>
      Returns:
      true if there are unsaved modifications.
    • syncToProvider

      public void syncToProvider() throws IOException
      Synchronizes the UI state back to the provider domain and flushes the key pool to disk.

      Synchronizes standard fields and the Anthropic version header.

      Overrides:
      syncToProvider in class AbstractAiProviderPanel<AnthropicProvider>
      Throws:
      IOException - If writing the keys file or syncing the provider state fails.