java.lang.Object
org.springframework.shell.component.view.screen.DefaultScreen
All Implemented Interfaces:
DisplayLines, Screen

public class DefaultScreen extends Object implements Screen, DisplayLines
Default implementation of a Screen.
  • Constructor Details

    • DefaultScreen

      public DefaultScreen()
    • DefaultScreen

      public DefaultScreen(int rows, int columns)
  • Method Details

    • writerBuilder

      public Screen.WriterBuilder writerBuilder()
      Description copied from interface: Screen
      Gets a new instance of a Screen.WriterBuilder.
      Specified by:
      writerBuilder in interface Screen
      Returns:
      a new writer builder
    • setShowCursor

      public void setShowCursor(boolean showCursor)
      Description copied from interface: Screen
      Sets if cursor should be visible.
      Specified by:
      setShowCursor in interface Screen
      Parameters:
      showCursor - true if cursor should be visible
    • isShowCursor

      public boolean isShowCursor()
      Description copied from interface: Screen
      Gets if cursor is visible.
      Specified by:
      isShowCursor in interface Screen
      Returns:
      true if cursor is visible
    • setCursorPosition

      public void setCursorPosition(Position cursorPosition)
      Description copied from interface: Screen
      Sets a cursor position.
      Specified by:
      setCursorPosition in interface Screen
      Parameters:
      cursorPosition - new cursor position
    • getCursorPosition

      public Position getCursorPosition()
      Description copied from interface: Screen
      Gets a cursor position.
      Specified by:
      getCursorPosition in interface Screen
      Returns:
      cursor position
    • resize

      public void resize(int rows, int columns)
      Description copied from interface: Screen
      Resize a screen.
      Specified by:
      resize in interface Screen
      Parameters:
      rows - the new row count
      columns - the new column count
    • getItems

      public ScreenItem[][] getItems()
      Description copied from interface: Screen
      Gets a screen items.
      Specified by:
      getItems in interface Screen
      Returns:
      a screen items
    • clip

      public Screen clip(int x, int y, int width, int height)
      Description copied from interface: Screen
      Clip a screen with a given bounds.
      Specified by:
      clip in interface Screen
      Parameters:
      x - the x coordinate
      y - the y coordinate
      width - the width
      height - the height
      Returns:
      new clipped screen
    • getScreenLines

      public List<org.jline.utils.AttributedString> getScreenLines()
      Description copied from interface: DisplayLines
      Gets a list of screen lines.
      Specified by:
      getScreenLines in interface DisplayLines
      Returns:
      list of screen lines
    • getScreenItems

      public ScreenItem[][] getScreenItems()