TerminalUI
TerminalUI
是用于驱动 UI 执行逻辑的主要实现。
Create TerminalUI
你可以手动构建 TerminalUI
,但推荐的方法是使用 TerminalUIBuilder
,它会为你自动配置构建并且将设置所需的 Services。
Unresolved include directive in modules/ROOT/pages/tui/intro/terminalui.adoc - include::../../../../../src/test/java/org/springframework/shell/docs/TerminalUiSnippets.java[]
Configuring Views
TerminalUI
有一个助手方法 configure(View),它可用于将所需的集成设置到 eventloop 及其他 Services。
Unresolved include directive in modules/ROOT/pages/tui/intro/terminalui.adoc - include::../../../../../src/test/java/org/springframework/shell/docs/TerminalUiSnippets.java[]
Running UI Loop
运行 TerminalUI
执行循环是一个阻塞操作。你需要一种方法来退出循环,例如 Exiting App。
Unresolved include directive in modules/ROOT/pages/tui/intro/terminalui.adoc - include::../../../../../src/test/java/org/springframework/shell/docs/TerminalUiSnippets.java[]