Package org.jline.utils
Class Status
java.lang.Object
org.jline.utils.Status
Manages a status bar at the bottom of the terminal.
The Status class provides functionality for displaying and managing a status bar at the bottom of the terminal. It allows applications to show persistent status information to the user while still using the rest of the terminal for normal input and output.
Key features include:
- Support for multiple status lines
- Styled text with ANSI colors and attributes
- Automatic resizing based on terminal dimensions
- Optional border between main display and status area
- Ability to temporarily suspend the status display
The status bar is particularly useful for displaying persistent information such as:
- Application mode or state
- Current file or context
- Key bindings or available commands
- Error messages or notifications
This class is used by various JLine components to provide status information to the user without disrupting the main terminal interaction.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected AttributedStringprotected Displayprotected List<AttributedString> protected intprotected final booleanprotected booleanprotected final Terminal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getExistingStatus(Terminal terminal) static Statusstatic Statusvoidhide()voidredraw()voidreset()voidresize()voidvoidrestore()Therestore()call is the opposite ofsuspend()and will make the status bar be updated again.voidsetBorder(boolean border) intsize()voidsuspend()Thesuspendmethod is used when a full-screen.toString()voidupdate(List<AttributedString> lines) voidupdate(List<AttributedString> lines, boolean flush) Returnstrueif the cursor may be misplaced and should be updated.
-
Field Details
-
terminal
-
supported
protected final boolean supported -
suspended
protected boolean suspended -
borderString
-
border
protected int border -
display
-
lines
-
scrollRegion
protected int scrollRegion
-
-
Constructor Details
-
Status
-
-
Method Details
-
getStatus
-
getExistingStatus
-
getStatus
-
close
public void close() -
setBorder
public void setBorder(boolean border) -
resize
public void resize() -
resize
-
reset
public void reset() -
redraw
public void redraw() -
hide
public void hide() -
update
-
update
Returnstrueif the cursor may be misplaced and should be updated. -
suspend
public void suspend()Thesuspendmethod is used when a full-screen. If the status was not already suspended, the lines used by the status are cleared during this call. -
restore
public void restore()Therestore()call is the opposite ofsuspend()and will make the status bar be updated again. If the status was suspended, the lines used by the status will be drawn during this call. -
size
public int size() -
toString
-