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
     
    void
    Change case on the char located at the cursor position
    void
    clear(boolean includeBuffer)
    Clear an ansi terminal.
     
    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
     
    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.
     
    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(org.aesh.terminal.tty.Size size)
     
    org.aesh.terminal.tty.Size
     
     
    void
    Up case the char located at the cursor position
    void
    writeChar(char input)
     
    void
    writeChars(int[] input)
     
    void
    writeOut(int[] out)
     
    void
     
    void
     
  • Method Details

    • history

      History history()
      Returns:
      history
    • completer

      CompletionHandler completer()
      Returns:
      CompletionHandler
    • setSize

      void setSize(org.aesh.terminal.tty.Size size)
      Parameters:
      size - specify new size
    • size

      org.aesh.terminal.tty.Size size()
      Returns:
      size
    • buffer

      Buffer buffer()
      Returns:
      buffer
    • undoManager

      UndoManager undoManager()
      Returns:
      UndoManager
    • addActionToUndoStack

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

      PasteManager pasteManager()
      Returns:
      PasteManager
    • 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)
      Parameters:
      input - char to write to the Buffer
    • writeOut

      void writeOut(String out)
      Parameters:
      out - write directly to the Connection output stream
    • writeOut

      void writeOut(int[] out)
      Parameters:
      out - write directly to the Connection output stream
    • writeChars

      void writeChars(int[] input)
      Parameters:
      input - write to the Buffer
    • writeString

      void writeString(String input)
      Parameters:
      input - write to the Buffer
    • 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