Package org.jline.widget
Class Widgets
java.lang.Object
org.jline.widget.Widgets
- Direct Known Subclasses:
AutopairWidgets,AutosuggestionWidgets,TailTipWidgets
Create custom widgets by extending Widgets class
- Author:
- Matti Rinta-Nikkola
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd widget to the LineReadervoidaliasWidget(String orig, String alias) Create alias to widgetargs()Parse lineReader buffer and returns its argumentsbuffer()Get lineReader's buffervoidcallWidget(String name) Call widget.voidClears terminal status barvoidClears command line command hintcurrChar()Access lineReader's buffer and return its current charactervoidRemove terminal status barvoidexecuteWidget(String name) Bind widget to ctrl-alt-x and execute itbooleanexistsWidget(String name) Test if widget existsGet lineReader's Main KeyMapResolve widget name if its alias is given as method parameter.Get lineReader's last bindingparser()Get lineReader's parserprevChar()Access lineReader buffer and return its previous charactervoidWrite the string parameter to the lineReader's buffervoidreplaceBuffer(Buffer buffer) Replace lineReader buffervoidsetDescription(List<AttributedString> desc) Set description text to the terminal status barvoidsetErrorIndex(int errorIndex) Set errorIndex to the lineReader's highlightervoidsetErrorPattern(Pattern errorPattern) Set errorPattern to the lineReader's highlightervoidSet lineReader's autosuggestion typevoidsetTailTip(String tailTip) Set lineReader's command hint to be added in the command linetailTip()Get lineReader's command hint
-
Field Details
-
TAILTIP_TOGGLE
- See Also:
-
TAILTIP_PANE
- See Also:
-
AUTOPAIR_TOGGLE
- See Also:
-
AUTOSUGGEST_TOGGLE
- See Also:
-
AP_INSERT
- See Also:
-
AP_BACKWARD_DELETE_CHAR
- See Also:
-
TT_ACCEPT_LINE
- See Also:
-
reader
-
-
Constructor Details
-
Widgets
-
-
Method Details
-
addWidget
-
callWidget
Call widget. System widget will be call if the name does not start with '_' or ends with '-toggle' i.e. '.' will be added at the beginning of the name.- Parameters:
name- widget name
-
executeWidget
Bind widget to ctrl-alt-x and execute it- Parameters:
name- widget name
-
aliasWidget
-
getWidget
-
existsWidget
Test if widget exists- Parameters:
name- widget name or its alias- Returns:
- true if widget exists
-
parser
-
getKeyMap
-
buffer
-
replaceBuffer
Replace lineReader buffer- Parameters:
buffer- buffer that will be copied to the LineReader Buffer
-
args
-
prevChar
Access lineReader buffer and return its previous character- Returns:
- previous character
-
currChar
Access lineReader's buffer and return its current character- Returns:
- current character
-
lastBinding
-
putString
Write the string parameter to the lineReader's buffer- Parameters:
string- string to be written
-
tailTip
-
setTailTip
Set lineReader's command hint to be added in the command line- Parameters:
tailTip- command hint
-
setErrorPattern
Set errorPattern to the lineReader's highlighter- Parameters:
errorPattern- error pattern
-
setErrorIndex
public void setErrorIndex(int errorIndex) Set errorIndex to the lineReader's highlighter- Parameters:
errorIndex- error index
-
clearTailTip
public void clearTailTip()Clears command line command hint -
setSuggestionType
Set lineReader's autosuggestion type- Parameters:
type- autosuggestion type
-
setDescription
Set description text to the terminal status bar- Parameters:
desc- description text
-
clearDescription
public void clearDescription()Clears terminal status bar -
destroyDescription
public void destroyDescription()Remove terminal status bar
-