Class ConsoleEngine.WidgetCreator

  • All Implemented Interfaces:
    org.jline.reader.Binding, org.jline.reader.Widget
    Enclosing interface:
    ConsoleEngine

    public static class ConsoleEngine.WidgetCreator
    extends java.lang.Object
    implements org.jline.reader.Widget
    Class for creating widgets from console functions.

    A WidgetCreator creates a widget that executes a function defined in the console. This allows console functions to be bound to key sequences and used as widgets.

    • Constructor Summary

      Constructors 
      Constructor Description
      WidgetCreator​(ConsoleEngine consoleEngine, java.lang.String function)
      Creates a new widget creator for the specified function.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean apply()
      Executes the function when the widget is applied.
      java.lang.String toString()
      Returns the name of the function.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • WidgetCreator

        public WidgetCreator​(ConsoleEngine consoleEngine,
                             java.lang.String function)
        Creates a new widget creator for the specified function.
        Parameters:
        consoleEngine - the console engine that will execute the function
        function - the name of the function to execute
    • Method Detail

      • apply

        public boolean apply()
        Executes the function when the widget is applied.
        Specified by:
        apply in interface org.jline.reader.Widget
        Returns:
        true if the function was executed successfully, false otherwise
      • toString

        public java.lang.String toString()
        Returns the name of the function.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the name of the function