Class TextViewPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class TextViewPanel extends AbstractViewPanel<TextView>
A specialized metadata panel for the TextView.

This panel provides integrated controls for the text viewport, including tailing, grep patterns, and line numbers. It reactively updates the model and triggers reloads when settings change.

Author:
anahata
See Also:
  • Field Details

    • tailCheck

      private final JCheckBox tailCheck
      Toggle for enabling/disabling the tailing behavior (following the end of the file).
    • tailLinesSpinner

      private final JSpinner tailLinesSpinner
      Spinner to configure the number of lines to tail.
    • fromSpinner

      private final JSpinner fromSpinner
      Spinner for start character offset.
    • sizeSpinner

      private final JSpinner sizeSpinner
      Spinner for page size.
    • grepField

      private final JTextField grepField
      Field for entering a regex pattern to filter lines (grep).
    • lineNumbersCheck

      private final JCheckBox lineNumbersCheck
      Toggle for showing/hiding line numbers in the viewport.
    • colWidthSpinner

      private final JSpinner colWidthSpinner
      Spinner to configure the maximum column width before wrapping/truncation.
    • tokenLabel

      private final JLabel tokenLabel
      Label displaying real-time token metrics.
    • pendingTokenTask

      private SwingTask<Integer> pendingTokenTask
      Pending background task calculating tokens, allowing preemption on rapid updates.
    • fullViewButton

      private final JToggleButton fullViewButton
      Button/Toggle to enable or disable full view mode.
    • summaryLabel

      private final JLabel summaryLabel
      Label displaying the viewport summary toString.
    • syncing

      private boolean syncing
      Guard flag to prevent feedback loops during UI synchronization.
  • Constructor Details

    • TextViewPanel

      public TextViewPanel(AgiPanel agiPanel)
      Constructs a new TextViewPanel with integrated viewport controls.
      Parameters:
      agiPanel - The parent session panel.
  • Method Details

    • refresh

      public void refresh()
      Refreshes the UI components with the current view's metadata.

      Access Authority: This method is public to allow the Resource2Panel to trigger refreshes when the underlying resource state changes.

      Implementation details: Synchronizes the viewport controls with the current TextView state and estimated token count.

      Specified by:
      refresh in class AbstractViewPanel<TextView>