Interface Widget
-
- All Superinterfaces:
Binding
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Widget extends Binding
A Widget represents an action that can be bound to a key sequence in the LineReader.Widgets are the fundamental building blocks of the line editor's functionality. Each widget implements a specific editing action or command that can be invoked by the user through key bindings. Examples include moving the cursor, deleting characters, searching history, and completing words.
Widgets can be bound to key sequences using the LineReader's key maps. When the user presses a key sequence that is bound to a widget, the widget's
apply()
method is called to perform the associated action.JLine provides a set of built-in widgets that implement common editing functions, and applications can define custom widgets to extend the editor's functionality.
This interface is designed as a functional interface, making it easy to implement widgets using lambda expressions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
apply()
Executes the action associated with this widget.
-