Class ContextProviderPanel

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

public class ContextProviderPanel extends ScrollablePanel
A panel that displays the details and context previews for a ContextProvider.

It dynamically manages its tabs, hiding those that have no content to show (e.g., if a provider doesn't contribute system instructions or RAG content).

Author:
anahata
See Also:
  • Field Details

    • parentPanel

      private final ContextPanel parentPanel
      The parent context management panel.
    • nameLabel

      private final JLabel nameLabel
      Label for the provider's friendly name.
    • descLabel

      private final JLabel descLabel
      Label for the provider's description.
    • providingCheckbox

      private final JCheckBox providingCheckbox
      Checkbox to toggle providing status.
    • effectivelyProvidingLabel

      private final JLabel effectivelyProvidingLabel
      Label indicating if the provider is effectively providing context.
    • tabbedPane

      private final JTabbedPane tabbedPane
      Tabbed pane containing previews.
    • thisSysTab

      private final JPanel thisSysTab
      Tab for system instructions from this provider.
    • childrenSysTab

      private final JPanel childrenSysTab
      Tab for aggregated system instructions from children.
    • thisRagTab

      private final JPanel thisRagTab
      Tab for RAG content from this provider.
    • childrenRagTab

      private final JPanel childrenRagTab
      Tab for aggregated RAG content from children.
    • currentProvider

      private ContextProvider currentProvider
      The context provider currently being inspected.
  • Constructor Details

    • ContextProviderPanel

      public ContextProviderPanel(ContextPanel parentPanel)
      Constructs a new ContextProviderPanel.
      Parameters:
      parentPanel - The parent context panel.
  • Method Details

    • setContextProvider

      public void setContextProvider(ContextProvider cp)
      Sets the context provider to display and updates the UI.
      Parameters:
      cp - The context provider.
    • updateEffectivelyProviding

      private void updateEffectivelyProviding(ContextProvider cp)
      Updates the 'Effectively Providing' label based on the provider's hierarchy.
      Parameters:
      cp - The current context provider.
    • updatePreviews

      private void updatePreviews(ContextProvider cp)
      Updates the content previews and manages tab visibility asynchronously.
      Parameters:
      cp - The current context provider.
    • renderPreview

      private void renderPreview(RagMessage msg, JPanel tab, String emptyText)
      Surgically renders the preview message inside the target tab panel.
      Parameters:
      msg - The message to render.
      tab - The tab panel to render into.
      emptyText - Fallback text if the message is empty.