Class ViewComponent
java.lang.Object
org.springframework.shell.component.ViewComponent
Handles view execution in a non-fullscreen setup.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Represent run state of an async run of a component. -
Constructor Summary
ConstructorDescriptionViewComponent
(TerminalUI terminalUI, org.jline.terminal.Terminal terminal, ViewComponentExecutor viewComponentExecutor, View view) Construct view component with a givenTerminal
andView
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
exit()
Request exit from an execution loop.Gets anEventLoop
associated with this view component.runAsync()
Run a component asyncronously.void
Run a view execution loop.void
setUseTerminalWidth
(boolean useTerminalWidth) Sets if full terminal width should be used for a view.
-
Constructor Details
-
ViewComponent
public ViewComponent(TerminalUI terminalUI, org.jline.terminal.Terminal terminal, ViewComponentExecutor viewComponentExecutor, View view) Construct view component with a givenTerminal
andView
.- Parameters:
terminal
- the terminalview
- the main view
-
-
Method Details
-
runAsync
Run a component asyncronously. Returned state can be used to wait, cancel or see its completion status.- Returns:
- run state
-
runBlocking
public void runBlocking()Run a view execution loop. -
setUseTerminalWidth
public void setUseTerminalWidth(boolean useTerminalWidth) Sets if full terminal width should be used for a view. Defaults totrue
.- Parameters:
useTerminalWidth
- the use terminal width flag
-
getEventLoop
Gets anEventLoop
associated with this view component.- Returns:
- event loop with this view component
-
exit
public void exit()Request exit from an execution loop.
-