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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDescription
(List<AttributedString> desc) void
Add widget to the LineReadervoid
aliasWidget
(String orig, String alias) Create alias to widgetargs()
buffer()
void
callWidget
(String name) Call widget.void
Clears terminal status barvoid
Clears command line tail tipcurrChar()
void
Remove terminal status barvoid
executeWidget
(String name) Bind widget to ctrl-alt-x and execute itboolean
existsWidget
(String name) void
initDescription
(int size) Initialize terminal status barprivate Widget
namedWidget
(String name, Widget widget) parser()
prevChar()
void
void
replaceBuffer
(Buffer buffer) void
setErrorIndex
(int errorIndex) void
setErrorPattern
(Pattern errorPattern) void
void
setTailTip
(String tailTip) tailTip()
private Widget
-
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
Add widget to the LineReader- Parameters:
name
- the name of widgetwidget
- widget
-
namedWidget
-
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
Create alias to widget- Parameters:
orig
- widget original namealias
- alias name
-
getWidget
- Parameters:
name
- widget name or alias- Returns:
- widget name
-
existsWidget
- Parameters:
name
- widget name or alias- Returns:
- true if widget exists
-
widget
-
parser
- Returns:
- The LineRearer Parser
-
getKeyMap
- Returns:
- The LineReader Main KeyMap
-
buffer
- Returns:
- The LineReader Buffer
-
replaceBuffer
- Parameters:
buffer
- buffer that will be copied to the LineReader Buffer
-
args
- Returns:
- command line arguments
-
prevChar
- Returns:
- Buffer's previous character
-
currChar
- Returns:
- Buffer's current character
-
lastBinding
- Returns:
- LineReader's last binding
-
putString
- Parameters:
string
- string to be written into LineReader Buffer
-
tailTip
- Returns:
- Command line tail tip.
-
setTailTip
- Parameters:
tailTip
- tail tip to be added to the command line
-
setErrorPattern
- Parameters:
errorPattern
- error pattern to be set LineReader Highlighter
-
setErrorIndex
public void setErrorIndex(int errorIndex) - Parameters:
errorIndex
- error index to be set LineReader Highlighter
-
clearTailTip
public void clearTailTip()Clears command line tail tip -
setSuggestionType
- Parameters:
type
- type to be set to the LineReader autosuggestion
-
addDescription
- Parameters:
desc
- Text to be displayed on terminal status bar
-
clearDescription
public void clearDescription()Clears terminal status bar -
initDescription
public void initDescription(int size) Initialize terminal status bar- Parameters:
size
- Terminal status bar size in rows
-
destroyDescription
public void destroyDescription()Remove terminal status bar
-