Class ViewComponent

java.lang.Object
org.springframework.shell.component.ViewComponent

public class ViewComponent extends Object
Handles view execution in a non-fullscreen setup.
  • Constructor Details

    • ViewComponent

      public ViewComponent(TerminalUI terminalUI, org.jline.terminal.Terminal terminal, ViewComponentExecutor viewComponentExecutor, View view)
      Construct view component with a given Terminal and View.
      Parameters:
      terminal - the terminal
      view - the main view
  • Method Details

    • runAsync

      public ViewComponent.ViewComponentRun 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 to true.
      Parameters:
      useTerminalWidth - the use terminal width flag
    • getEventLoop

      public EventLoop getEventLoop()
      Gets an EventLoop associated with this view component.
      Returns:
      event loop with this view component
    • exit

      public void exit()
      Request exit from an execution loop.