Class TailTipWidgets


  • public class TailTipWidgets
    extends Widgets
    Creates and manages widgets for as you type command line suggestions. Suggestions are created using a command completer data and/or positional argument descriptions.
    Author:
    Matti Rinta-Nikkola
    • Constructor Detail

      • TailTipWidgets

        public TailTipWidgets​(org.jline.reader.LineReader reader,
                              java.util.Map<java.lang.String,​CmdDesc> tailTips)
        Creates tailtip widgets used in command line suggestions. Suggestions are created using a command positional argument names. If argument descriptions do not exists command completer data will be used. Status bar for argument descriptions will not be created.
        Parameters:
        reader - LineReader.
        tailTips - Commands options and positional argument descriptions.
        Throws:
        java.lang.IllegalStateException - If widgets are already created.
      • TailTipWidgets

        public TailTipWidgets​(org.jline.reader.LineReader reader,
                              java.util.Map<java.lang.String,​CmdDesc> tailTips,
                              TailTipWidgets.TipType tipType)
        Creates tailtip widgets used in command line suggestions. Status bar for argument descriptions will not be created.
        Parameters:
        reader - LineReader.
        tailTips - Commands options and positional argument descriptions.
        tipType - Defines which data will be used for suggestions.
        Throws:
        java.lang.IllegalStateException - If widgets are already created.
      • TailTipWidgets

        public TailTipWidgets​(org.jline.reader.LineReader reader,
                              java.util.Map<java.lang.String,​CmdDesc> tailTips,
                              int descriptionSize)
        Creates tailtip widgets used in command line suggestions. Suggestions are created using a command positional argument names. If argument descriptions do not exists command completer data will be used.
        Parameters:
        reader - LineReader.
        tailTips - Commands options and positional argument descriptions.
        descriptionSize - Size of the status bar.
        Throws:
        java.lang.IllegalStateException - If widgets are already created.
      • TailTipWidgets

        public TailTipWidgets​(org.jline.reader.LineReader reader,
                              java.util.Map<java.lang.String,​CmdDesc> tailTips,
                              int descriptionSize,
                              TailTipWidgets.TipType tipType)
        Creates tailtip widgets used in command line suggestions.
        Parameters:
        reader - LineReader.
        tailTips - Commands options and positional argument descriptions.
        descriptionSize - Size of the status bar.
        tipType - Defines which data will be used for suggestions.
        Throws:
        java.lang.IllegalStateException - If widgets are already created.
      • TailTipWidgets

        public TailTipWidgets​(org.jline.reader.LineReader reader,
                              java.util.function.Function<CmdLine,​CmdDesc> descFun,
                              int descriptionSize,
                              TailTipWidgets.TipType tipType)
        Creates tailtip widgets used in command line suggestions.
        Parameters:
        reader - LineReader.
        descFun - Function that returns command description.
        descriptionSize - Size of the status bar.
        tipType - Defines which data will be used for suggestions.
        Throws:
        java.lang.IllegalStateException - If widgets are already created.
    • Method Detail

      • setTailTips

        public void setTailTips​(java.util.Map<java.lang.String,​CmdDesc> tailTips)
      • setDescriptionSize

        public void setDescriptionSize​(int descriptionSize)
      • getDescriptionSize

        public int getDescriptionSize()
      • isEnabled

        public boolean isEnabled()
      • disable

        public void disable()
      • enable

        public void enable()
      • setDescriptionCache

        public void setDescriptionCache​(boolean cache)
      • tailtipComplete

        public boolean tailtipComplete()
      • tailtipAcceptLine

        public boolean tailtipAcceptLine()
      • tailtipBackwardDelete

        public boolean tailtipBackwardDelete()
      • tailtipDelete

        public boolean tailtipDelete()
      • tailtipKillLine

        public boolean tailtipKillLine()
      • tailtipKillWholeLine

        public boolean tailtipKillWholeLine()
      • tailtipInsert

        public boolean tailtipInsert()
      • tailtipUpdateStatus

        public boolean tailtipUpdateStatus()
      • initDescription

        public void initDescription()
        Initialize terminal status bar
      • clearDescription

        public void clearDescription()
        Description copied from class: Widgets
        Clears terminal status bar
        Overrides:
        clearDescription in class Widgets
      • toggleWindow

        public boolean toggleWindow()
      • toggleKeyBindings

        public boolean toggleKeyBindings()