Files
Mahmoud Ben Hassine e3cb93791d Update documentation
2025-04-25 10:13:56 +02:00

49 lines
1.2 KiB
Plaintext

= StatusBarView
:page-section-summary-toc: 1
ifndef::snippets[:snippets: ../../../../../src/test/java/org/springframework/shell/docs]
_StatusBarView_ is a base implementation providing functionality to draw a status bar.
_StatusBarView_ inherits from xref:tui/views/box.adoc[].
[source, text]
----
┌─────────────────────────────┐
│ Item1 | Item2 | Item3 │
└─────────────────────────────┘
----
You can create a simple status bar with an item:
[source, java, indent=0]
----
include::{snippets}/StatusBarViewSnippets.java[tag=simple]
----
The constructor can take array form which allows to lay out simple
item definitions in a _dsl_ style:
[source, java, indent=0]
----
include::{snippets}/StatusBarViewSnippets.java[tag=viaarray]
----
Items support runnable actions which generally are executed when
item is selected. It can also get attached to a hot key.
[source, java, indent=0]
----
include::{snippets}/StatusBarViewSnippets.java[tag=items]
----
== Events
.StatusBarView Events
|===
|Event |Description
|StatusBarViewOpenSelectedItemEvent
|StatusItem is selected.
|===