Package org.jline.console
Class ConsoleEngine.WidgetCreator
- java.lang.Object
-
- org.jline.console.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.
-
-
-
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 functionfunction
- 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 interfaceorg.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 classjava.lang.Object
- Returns:
- the name of the function
-
-