Package org.jline.demo.examples
Class CustomWidgetsClassExample.MyWidgets
java.lang.Object
org.jline.widget.Widgets
org.jline.demo.examples.CustomWidgetsClassExample.MyWidgets
- Enclosing class:
CustomWidgetsClassExample
Custom widgets class that extends the base Widgets class.
-
Field Summary
Fields inherited from class org.jline.widget.Widgets
AP_BACKWARD_DELETE_CHAR, AP_INSERT, AUTOPAIR_TOGGLE, AUTOSUGGEST_TOGGLE, reader, TAILTIP_PANE, TAILTIP_TOGGLE, TT_ACCEPT_LINE -
Method Summary
Modifier and TypeMethodDescriptionbooleanWidget that clears the current line.create(LineReader reader) Factory method to create and set up a MyWidgets instance.booleanWidget that takes the first word of the buffer and executes it as a command.Methods inherited from class org.jline.widget.Widgets
addWidget, aliasWidget, args, buffer, callWidget, clearDescription, clearTailTip, currChar, destroyDescription, executeWidget, existsWidget, getKeyMap, getWidget, lastBinding, parser, prevChar, putString, replaceBuffer, setDescription, setErrorIndex, setErrorPattern, setSuggestionType, setTailTip, tailTip
-
Method Details
-
create
Factory method to create and set up a MyWidgets instance.- Parameters:
reader- The LineReader to associate with these widgets- Returns:
- The configured MyWidgets instance
-
executeCommand
public boolean executeCommand()Widget that takes the first word of the buffer and executes it as a command. In this example, it just calls the corresponding widget if it exists. -
clearLine
public boolean clearLine()Widget that clears the current line.
-