Class TextViewportSettings

java.lang.Object
uno.anahata.asi.agi.resource.view.TextViewportSettings

public class TextViewportSettings extends Object
Encapsulates adjustable viewport configuration for V2 text resources.

Controls pagination, tailing, grep filtering, and visual markers for large resource files.

Author:
anahata
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    The maximum line width before horizontal truncation.
    private boolean
    Whether full view is enabled (loading entire resource up to EOF).
    private String
    A regular expression pattern for filtering lines (grep).
    private boolean
    Whether to include line numbers in the processed output.
    private int
    The maximum number of characters to load in a single page.
    private int
    The starting character offset for pagination.
    private boolean
    Whether to enable tailing mode.
    private int
    The number of lines to capture from the end of the source.
    private TextViewport
    Back-reference to the parent viewport engine.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs settings bound to a parent viewport engine.
    Copy constructor creating an independent clone of the given settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    Creates an independent deep copy of these viewport settings.
    void
    Synchronously notifies the parent viewport and view that settings have changed.
    void
    setColumnWidth(int columnWidth)
    Sets the column width and triggers dirty chain.
    void
    setFullView(boolean fullView)
    Sets whether full view mode is enabled and triggers dirty chain.
    void
    setGrepPattern(String grepPattern)
    Sets the grep pattern and triggers dirty chain.
    void
    setIncludeLineNumbers(boolean includeLineNumbers)
    Toggles line numbers and triggers dirty chain.
    void
    setPageSizeInChars(int pageSizeInChars)
    Sets the page size and triggers dirty chain.
    void
    setStartChar(int startChar)
    Sets the start character and triggers dirty chain.
    void
    setTail(boolean tail)
    Toggles tailing mode and triggers dirty chain.
    void
    setTailLines(int tailLines)
    Sets the number of tail lines and triggers dirty chain.
    Returns a summary of the settings for use in resource headers.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • viewport

      private TextViewport viewport
      Back-reference to the parent viewport engine.
    • fullView

      private boolean fullView
      Whether full view is enabled (loading entire resource up to EOF).
    • startChar

      private int startChar
      The starting character offset for pagination.
    • pageSizeInChars

      private int pageSizeInChars
      The maximum number of characters to load in a single page.
    • columnWidth

      private int columnWidth
      The maximum line width before horizontal truncation.
    • grepPattern

      private String grepPattern
      A regular expression pattern for filtering lines (grep).
    • includeLineNumbers

      private boolean includeLineNumbers
      Whether to include line numbers in the processed output.
    • tail

      private boolean tail
      Whether to enable tailing mode.
    • tailLines

      private int tailLines
      The number of lines to capture from the end of the source.
  • Constructor Details

    • TextViewportSettings

      public TextViewportSettings(TextViewport viewport)
      Constructs settings bound to a parent viewport engine.
      Parameters:
      viewport - The parent viewport.
    • TextViewportSettings

      public TextViewportSettings(TextViewportSettings other)
      Copy constructor creating an independent clone of the given settings.
      Parameters:
      other - The existing settings to copy.
  • Method Details

    • copy

      public TextViewportSettings copy()
      Creates an independent deep copy of these viewport settings.
      Returns:
      A new TextViewportSettings instance with identical properties.
    • markDirty

      public void markDirty()
      Synchronously notifies the parent viewport and view that settings have changed.
    • setFullView

      public void setFullView(boolean fullView)
      Sets whether full view mode is enabled and triggers dirty chain.
      Parameters:
      fullView - True to load full resource.
    • setStartChar

      public void setStartChar(int startChar)
      Sets the start character and triggers dirty chain.
      Parameters:
      startChar - The new character offset.
    • setPageSizeInChars

      public void setPageSizeInChars(int pageSizeInChars)
      Sets the page size and triggers dirty chain.
      Parameters:
      pageSizeInChars - The maximum characters per page.
    • setColumnWidth

      public void setColumnWidth(int columnWidth)
      Sets the column width and triggers dirty chain.
      Parameters:
      columnWidth - The maximum characters per line.
    • setGrepPattern

      public void setGrepPattern(String grepPattern)
      Sets the grep pattern and triggers dirty chain.
      Parameters:
      grepPattern - The regex pattern.
    • setIncludeLineNumbers

      public void setIncludeLineNumbers(boolean includeLineNumbers)
      Toggles line numbers and triggers dirty chain.
      Parameters:
      includeLineNumbers - True to show gutters.
    • setTail

      public void setTail(boolean tail)
      Toggles tailing mode and triggers dirty chain.
      Parameters:
      tail - True to enable tailing.
    • setTailLines

      public void setTailLines(int tailLines)
      Sets the number of tail lines and triggers dirty chain.
      Parameters:
      tailLines - The number of lines to capture.
    • toString

      public String toString()
      Returns a summary of the settings for use in resource headers.
      Overrides:
      toString in class Object
      Returns:
      A summary string.