Class Line.CursorTransactionBuilder

java.lang.Object
org.aesh.readline.cursor.Line.CursorTransactionBuilder
Enclosing class:
Line

public class Line.CursorTransactionBuilder extends Object
Builder for CursorTransaction.
Author:
jdenise@redhat.com
  • Constructor Details

    • CursorTransactionBuilder

      public CursorTransactionBuilder()
      Default constructor for CursorTransactionBuilder.
  • Method Details

    • move

      public Line.CursorTransactionBuilder move(int value)
      Adds a move action to move the cursor to the specified index.
      Parameters:
      value - the index to move the cursor to
      Returns:
      this builder for method chaining
    • colorize

      public Line.CursorTransactionBuilder colorize(int index, Color text, Color bg, boolean bright)
      Adds a colorize action to change the color of a character at the specified index.
      Parameters:
      index - the index of the character to colorize
      text - the text/foreground color
      bg - the background color
      bright - whether to use bright/bold styling
      Returns:
      this builder for method chaining
    • moveBackward

      public Line.CursorTransactionBuilder moveBackward(int value)
      Adds a move backward action to move the cursor backward by the specified amount.
      Parameters:
      value - the number of positions to move backward
      Returns:
      this builder for method chaining
    • moveForward

      public Line.CursorTransactionBuilder moveForward(int value)
      Adds a move forward action to move the cursor forward by the specified amount.
      Parameters:
      value - the number of positions to move forward
      Returns:
      this builder for method chaining
    • moveUp

      public Line.CursorTransactionBuilder moveUp(int value)
      Adds a move up action to move the cursor up by the specified number of rows.
      Parameters:
      value - the number of rows to move up
      Returns:
      this builder for method chaining
    • moveDown

      public Line.CursorTransactionBuilder moveDown(int value)
      Adds a move down action to move the cursor down by the specified number of rows.
      Parameters:
      value - the number of rows to move down
      Returns:
      this builder for method chaining
    • build

      public Line.CursorTransaction build()
      Builds and returns the CursorTransaction with all added actions. If the cursor location is invalidated, returns an empty transaction.
      Returns:
      the built CursorTransaction