Interface Binding

  • All Known Subinterfaces:
    Widget
    All Known Implementing Classes:
    Macro, Reference

    public interface Binding
    Marker interface for objects that can be bound to key sequences in a KeyMap.

    The Binding interface serves as a common type for different kinds of actions that can be triggered by key sequences in the line editor. JLine supports three main types of bindings:

    • Widget - Executes a specific editing function
    • Macro - Executes a sequence of keystrokes
    • Reference - References another widget by name

    Key bindings are managed through KeyMaps, which map key sequences to Binding objects. When a user presses a key sequence, the LineReader looks up the corresponding Binding in the current KeyMap and executes it.

    This interface doesn't define any methods; it's used purely as a marker to identify objects that can be bound to key sequences.

    See Also:
    Macro, Reference, Widget, KeyMap, LineReader.getKeyMaps()