Files
spring-shell/spring-shell-docs/modules/ROOT/pages/tui/views/statusbar.adoc
Janne Valkealahti bba7a82ab4 Make StatusBarView work with hotkeys
- StatusItem can now define a hotkey which is then
  bound to its action.
- In catalog app replace use of raw key event to
  item's hotkey for status bar visibility.
- Various doc updates.
- Relates #826
2023-10-30 09:31:03 +00: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.
Inherits 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]
----
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 as 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.
|===