Class ScrollSection

  • Direct Known Subclasses:
    LogSection

    public class ScrollSection
    extends Section
    Vertically scrollable lines of text, scrolled with UP/DOWN/PAGE_UP/PAGE_DOWN/HOME/END. Optional follow-tail keeps the view pinned to the bottom as lines are appended.
    • Constructor Detail

      • ScrollSection

        public ScrollSection()
    • Method Detail

      • maxLines

        public ScrollSection maxLines​(int max)
        Caps the retained lines, dropping the oldest beyond max; 0 means unlimited.
        Parameters:
        max - the maximum retained lines, or 0 for unlimited
        Returns:
        this ScrollSection for chaining
      • followTail

        public ScrollSection followTail​(boolean follow)
        Sets whether the view stays pinned to the bottom as lines are appended. Enabling it scrolls to the bottom immediately.
        Parameters:
        follow - true to follow the tail
        Returns:
        this ScrollSection for chaining
      • wrap

        public ScrollSection wrap​(boolean wrap)
        Enables width-aware word wrapping; scrolling then operates over wrapped display lines.
        Parameters:
        wrap - true to enable wrapping
        Returns:
        this ScrollSection for chaining
      • style

        public ScrollSection style​(Style style)
        Sets the text style.
        Parameters:
        style - the style
        Returns:
        this ScrollSection for chaining
      • setLines

        public ScrollSection setLines​(java.util.List<java.lang.String> newLines)
        Replaces all lines; scrolls to the bottom when following the tail.
        Parameters:
        newLines - the new lines
        Returns:
        this ScrollSection for chaining
      • lineCount

        public int lineCount()
        Returns:
        the number of logical lines
      • scrollTop

        public int scrollTop()
        Returns:
        the index of the first visible line