Class AbstractPrompt<T extends ConsoleUIItemIF>

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractPrompt​(org.jline.terminal.Terminal terminal, org.jline.utils.Display display, java.util.List<org.jline.utils.AttributedString> header, org.jline.utils.AttributedString message, java.util.List<T> items, int pageSize, ConsolePrompt.UiConfig cfg)  
      AbstractPrompt​(org.jline.terminal.Terminal terminal, org.jline.utils.Display display, java.util.List<org.jline.utils.AttributedString> header, org.jline.utils.AttributedString message, ConsolePrompt.UiConfig cfg)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void refreshDisplay​(int row)
      Refreshes the display so the UI is re-rendered with the specified cursor row.
      protected void refreshDisplay​(int row, int column, java.lang.String buffer, boolean newline)
      Refreshes the terminal display using the provided buffer and positions the cursor.
      protected void refreshDisplay​(int buffRow, int buffCol, java.lang.String buffer, int candRow, int candCol, java.util.List<org.jline.reader.Candidate> candidates)
      Resize the display to the cached terminal size, render the input buffer together with a candidate list, and position the cursor.
      protected void refreshDisplay​(int row, java.util.Set<java.lang.String> selected)
      Refreshes the UI to render items with the cursor positioned at the specified row and the given items marked as selected.
      protected void resetDisplay()  
      protected void resetHeader()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • terminal

        protected final org.jline.terminal.Terminal terminal
      • bindingReader

        protected final org.jline.keymap.BindingReader bindingReader
      • firstItemRow

        protected int firstItemRow
    • Constructor Detail

      • AbstractPrompt

        public AbstractPrompt​(org.jline.terminal.Terminal terminal,
                              org.jline.utils.Display display,
                              java.util.List<org.jline.utils.AttributedString> header,
                              org.jline.utils.AttributedString message,
                              ConsolePrompt.UiConfig cfg)
      • AbstractPrompt

        public AbstractPrompt​(org.jline.terminal.Terminal terminal,
                              org.jline.utils.Display display,
                              java.util.List<org.jline.utils.AttributedString> header,
                              org.jline.utils.AttributedString message,
                              java.util.List<T> items,
                              int pageSize,
                              ConsolePrompt.UiConfig cfg)
    • Method Detail

      • resetHeader

        protected void resetHeader()
      • resetDisplay

        protected void resetDisplay()
      • refreshDisplay

        protected void refreshDisplay​(int row)
        Refreshes the display so the UI is re-rendered with the specified cursor row.

        Uses column 0 and an empty input buffer (no trailing newline) when updating the display.

        Parameters:
        row - the absolute terminal row to position the cursor for rendering
      • refreshDisplay

        protected void refreshDisplay​(int row,
                                      java.util.Set<java.lang.String> selected)
        Refreshes the UI to render items with the cursor positioned at the specified row and the given items marked as selected. Resizes the display to the current terminal size, updates the rendered lines based on the cursor row and selection set, and moves the terminal cursor to the computed position.
        Parameters:
        row - the absolute terminal row where the cursor should appear (typically a value relative to the prompt's layout)
        selected - names of items that should be rendered as selected/checked
      • refreshDisplay

        protected void refreshDisplay​(int row,
                                      int column,
                                      java.lang.String buffer,
                                      boolean newline)
        Refreshes the terminal display using the provided buffer and positions the cursor. This resizes the display to the current terminal Size, renders header/message/items together with the optional input buffer (when `newline` is true and `buffer` is non-empty the buffer is presented on its own line with a prompt marker), and moves the cursor to the computed (row, column) position.
        Parameters:
        row - the current cursor row used to determine which item/candidate is active
        column - the cursor column within the buffer (column offset from the message start)
        buffer - the current input text to render; may be null to omit the buffer text
        newline - if true and `buffer` is non-empty, render the buffer on its own line with a prompt marker
      • refreshDisplay

        protected void refreshDisplay​(int buffRow,
                                      int buffCol,
                                      java.lang.String buffer,
                                      int candRow,
                                      int candCol,
                                      java.util.List<org.jline.reader.Candidate> candidates)
        Resize the display to the cached terminal size, render the input buffer together with a candidate list, and position the cursor. Renders the provided buffer (if non-null) and the candidates at the candidate display coordinates, updates the display content, and moves the cursor to the specified buffer coordinates.
        Parameters:
        buffRow - row where the input buffer's cursor should be placed after rendering
        buffCol - column where the input buffer's cursor should be placed after rendering
        buffer - the current input buffer to show; may be null to render no buffer text
        candRow - row used to position and highlight the candidate list
        candCol - column where the candidate list should start
        candidates - the list of completion candidates to display alongside the buffer