Class Line.CursorTransactionBuilder
java.lang.Object
org.aesh.readline.cursor.Line.CursorTransactionBuilder
- Enclosing class:
Line
Builder for CursorTransaction.
- Author:
- jdenise@redhat.com
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for CursorTransactionBuilder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns the CursorTransaction with all added actions.Adds a colorize action to change the color of a character at the specified index.move(int value) Adds a move action to move the cursor to the specified index.moveBackward(int value) Adds a move backward action to move the cursor backward by the specified amount.moveDown(int value) Adds a move down action to move the cursor down by the specified number of rows.moveForward(int value) Adds a move forward action to move the cursor forward by the specified amount.moveUp(int value) Adds a move up action to move the cursor up by the specified number of rows.
-
Constructor Details
-
CursorTransactionBuilder
public CursorTransactionBuilder()Default constructor for CursorTransactionBuilder.
-
-
Method Details
-
move
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
Adds a colorize action to change the color of a character at the specified index.- Parameters:
index- the index of the character to colorizetext- the text/foreground colorbg- the background colorbright- whether to use bright/bold styling- Returns:
- this builder for method chaining
-
moveBackward
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
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
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
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
Builds and returns the CursorTransaction with all added actions. If the cursor location is invalidated, returns an empty transaction.- Returns:
- the built CursorTransaction
-