Class CliView<OP extends Enum<OP>,​OUT>

  • Type Parameters:
    OP - supported list of operations
    Direct Known Subclasses:
    CliInputView, CliResultView, CliRowView

    public abstract class CliView<OP extends Enum<OP>,​OUT>
    extends Object
    Framework for a CLI view with header, footer, and main part that is scrollable.
    • Field Detail

      • terminal

        protected final org.jline.terminal.Terminal terminal
      • offsetX

        protected int offsetX
      • offsetY

        protected int offsetY
    • Constructor Detail

      • CliView

        public CliView​(org.jline.terminal.Terminal terminal)
    • Method Detail

      • open

        public void open()
      • getResult

        public OUT getResult()
      • isRunning

        protected boolean isRunning()
      • close

        protected void close()
      • close

        protected void close​(OUT result)
      • display

        protected void display()
      • scrollLeft

        protected void scrollLeft()
      • scrollRight

        protected void scrollRight()
      • scrollUp

        protected void scrollUp()
      • scrollDown

        protected void scrollDown()
      • scrollDown

        protected void scrollDown​(int n)
      • getVisibleMainHeight

        protected int getVisibleMainHeight()
      • getHeaderLines

        protected List<org.jline.utils.AttributedString> getHeaderLines()
      • getMainHeaderLines

        protected List<org.jline.utils.AttributedString> getMainHeaderLines()
      • getMainLines

        protected List<org.jline.utils.AttributedString> getMainLines()
      • getFooterLines

        protected List<org.jline.utils.AttributedString> getFooterLines()
      • getTotalMainWidth

        protected int getTotalMainWidth()
      • getTitleLine

        protected org.jline.utils.AttributedString getTitleLine()
      • resetAllParts

        protected void resetAllParts()
        Must be called when values in one or more parts have changed.
      • resetMainPart

        protected void resetMainPart()
        Must be called when values in the main part (main header or main) have changed.
      • getWidth

        protected int getWidth()
      • getHeight

        protected int getHeight()
      • clearTerminal

        public void clearTerminal()
      • getTerminalWidth

        public int getTerminalWidth()
      • getTerminalHeight

        public int getTerminalHeight()
      • init

        protected abstract void init()
        Starts threads if necessary.
      • getKeys

        protected abstract org.jline.keymap.KeyMap<OP> getKeys()
      • evaluate

        protected abstract void evaluate​(OP operation,
                                         String binding)
      • getTitle

        protected abstract String getTitle()
      • computeHeaderLines

        protected abstract List<org.jline.utils.AttributedString> computeHeaderLines()
      • computeMainHeaderLines

        protected abstract List<org.jline.utils.AttributedString> computeMainHeaderLines()
      • computeMainLines

        protected abstract List<org.jline.utils.AttributedString> computeMainLines()
      • computeFooterLines

        protected abstract List<org.jline.utils.AttributedString> computeFooterLines()
      • cleanUp

        protected abstract void cleanUp()