Interface ConsoleBuffer

All Known Implementing Classes:
AeshConsoleBuffer

public interface ConsoleBuffer
Internal class for actions to get access to the buffer, history, connection, ++
Author:
Ståle W. Pedersen
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Will add the current action to the undo stack
    Get the input buffer containing the current line being edited.
    void
    Change case on the char located at the cursor position
    void
    clear(boolean includeBuffer)
    Clear an ansi terminal.
    Get the completion handler for tab completion.
    void
    delete(int delta)
    Delete from cursor position back or forth depending on the value of delta.
    void
    Down case the char located at the cursor position
    void
    Print the contents of the current buffer to the console
    void
    Force a rewrite of the prompt even though it might not be needed
    Get the command history manager.
    void
    insert(int[] insert)
    Insert at the end of the Buffer
    void
    insert(String insert, int position)
    Insert a String into the buffer at a specific point
    void
    moveCursor(int where)
    Move the cursor either back or forth.
    Get the paste manager for copy/paste operations.
    void
    replace(int[] line)
    Replace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer line
    void
    Replace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer line
    void
    Clear all content in the Buffer and reset all data
    void
    setPrompt(Prompt prompt)
    Specify the prompt
    void
    setSize(Size size)
    Set the terminal size.
    Get the current terminal size.
    Get the undo manager for undo/redo operations.
    void
    Up case the char located at the cursor position
    void
    writeChar(char input)
    Write a single character to the buffer.
    void
    writeChars(int[] input)
    Write code points to the buffer.
    void
    writeOut(int[] out)
    Write code points directly to the connection output stream.
    void
    Write a string directly to the connection output stream.
    void
    Write a string to the buffer.
  • Method Details

    • history

      History history()
      Get the command history manager.
      Returns:
      the history manager
    • completer

      CompletionHandler completer()
      Get the completion handler for tab completion.
      Returns:
      the completion handler
    • setSize

      void setSize(Size size)
      Set the terminal size.
      Parameters:
      size - the new terminal size
    • size

      Size size()
      Get the current terminal size.
      Returns:
      the terminal size
    • buffer

      Buffer buffer()
      Get the input buffer containing the current line being edited.
      Returns:
      the input buffer
    • undoManager

      UndoManager undoManager()
      Get the undo manager for undo/redo operations.
      Returns:
      the undo manager
    • addActionToUndoStack

      void addActionToUndoStack()
      Will add the current action to the undo stack
    • pasteManager

      PasteManager pasteManager()
      Get the paste manager for copy/paste operations.
      Returns:
      the paste manager
    • moveCursor

      void moveCursor(int where)
      Move the cursor either back or forth. Boundary checks will be done to make sure that the cursor do not go OB.
      Parameters:
      where - < 0 move back, where > 0 move forward
    • drawLine

      void drawLine()
      Print the contents of the current buffer to the console
    • drawLineForceDisplay

      void drawLineForceDisplay()
      Force a rewrite of the prompt even though it might not be needed
    • writeChar

      void writeChar(char input)
      Write a single character to the buffer.
      Parameters:
      input - the character to write
    • writeOut

      void writeOut(String out)
      Write a string directly to the connection output stream.
      Parameters:
      out - the string to write
    • writeOut

      void writeOut(int[] out)
      Write code points directly to the connection output stream.
      Parameters:
      out - the code points to write
    • writeChars

      void writeChars(int[] input)
      Write code points to the buffer.
      Parameters:
      input - the code points to write
    • writeString

      void writeString(String input)
      Write a string to the buffer.
      Parameters:
      input - the string to write
    • setPrompt

      void setPrompt(Prompt prompt)
      Specify the prompt
      Parameters:
      prompt - new prompt
    • insert

      void insert(String insert, int position)
      Insert a String into the buffer at a specific point
      Parameters:
      insert - input
      position - point in the buffer
    • insert

      void insert(int[] insert)
      Insert at the end of the Buffer
      Parameters:
      insert - data
    • delete

      void delete(int delta)
      Delete from cursor position back or forth depending on the value of delta. Delta < 0 delete backwards, delta > 0 delete forwards.
      Parameters:
      delta - specify which direction and how far to delete
    • upCase

      void upCase()
      Up case the char located at the cursor position
    • downCase

      void downCase()
      Down case the char located at the cursor position
    • changeCase

      void changeCase()
      Change case on the char located at the cursor position
    • replace

      void replace(int[] line)
      Replace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer line
      Parameters:
      line - input
    • replace

      void replace(String line)
      Replace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer line
      Parameters:
      line - input
    • reset

      void reset()
      Clear all content in the Buffer and reset all data
    • clear

      void clear(boolean includeBuffer)
      Clear an ansi terminal. Set includeBuffer to true if the current buffer should be printed again after clear.
      Parameters:
      includeBuffer - if true include the current buffer line