Class ViewComponent
java.lang.Object
org.springframework.shell.component.ViewComponent
Handles view execution in a non-fullscreen setup.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresent run state of an async run of a component. -
Constructor Summary
ConstructorsConstructorDescriptionViewComponent(TerminalUI terminalUI, org.jline.terminal.Terminal terminal, ViewComponentExecutor viewComponentExecutor, View view) Construct view component with a givenTerminalandView. -
Method Summary
Modifier and TypeMethodDescriptionvoidexit()Request exit from an execution loop.Gets anEventLoopassociated with this view component.runAsync()Run a component asyncronously.voidRun a view execution loop.voidsetUseTerminalWidth(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 givenTerminalandView.- 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 anEventLoopassociated with this view component.- Returns:
- event loop with this view component
-
exit
public void exit()Request exit from an execution loop.
-