Widgets.AutopairWidgets, Widgets.AutosuggestionWidgets, Widgets.TailTipWidgetspublic abstract class Widgets extends Object
| Modifier and Type | Class | Description |
|---|---|---|
static class |
Widgets.AutopairWidgets |
Creates and manages widgets that auto-closes, deletes and skips over matching delimiters intelligently.
|
static class |
Widgets.AutosuggestionWidgets |
Creates and manages widgets for as you type command line suggestions.
|
static class |
Widgets.CmdLine |
|
static class |
Widgets.TailTipWidgets |
Creates and manages widgets for as you type command line suggestions.
|
| Modifier and Type | Field | Description |
|---|---|---|
protected static String |
AP_BACKWARD_DELETE_CHAR |
|
protected static String |
AP_INSERT |
|
protected static String |
AP_TOGGLE |
|
protected static String |
TT_ACCEPT_LINE |
|
protected static String |
TT_TOGGLE |
| Constructor | Description |
|---|---|
Widgets(LineReader reader) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addDescription(List<org.jline.utils.AttributedString> desc) |
|
void |
addWidget(String name,
Widget widget) |
Add widget to the LineReader
|
void |
aliasWidget(String orig,
String alias) |
Create alias to widget
|
List<String> |
args() |
|
Buffer |
buffer() |
|
void |
callWidget(String name) |
Call widget.
|
void |
clearDescription() |
Clears terminal status bar
|
void |
clearTailTip() |
Clears command line tail tip
|
String |
currChar() |
|
void |
destroyDescription() |
Remove terminal status bar
|
void |
executeWidget(String name) |
Bind widget to ctrl-alt-x and execute it
|
boolean |
existsWidget(String name) |
|
KeyMap<Binding> |
getKeyMap() |
|
String |
getWidget(String name) |
|
void |
initDescription(int size) |
Initialize terminal status bar
|
String |
lastBinding() |
|
Parser |
parser() |
|
String |
prevChar() |
|
void |
putString(String string) |
|
void |
replaceBuffer(Buffer buffer) |
|
void |
setErrorIndex(int errorIndex) |
|
void |
setErrorPattern(Pattern errorPattern) |
|
void |
setSuggestionType(LineReader.SuggestionType type) |
|
void |
setTailTip(String tailTip) |
|
String |
tailTip() |
protected static final String AP_TOGGLE
protected static final String AP_INSERT
protected static final String AP_BACKWARD_DELETE_CHAR
protected static final String TT_TOGGLE
protected static final String TT_ACCEPT_LINE
public Widgets(LineReader reader)
public void addWidget(String name, Widget widget)
name - the name of widgetwidget - widgetpublic void callWidget(String name)
name - widget namepublic void executeWidget(String name)
name - widget namepublic void aliasWidget(String orig, String alias)
orig - widget orginal namealias - alias namepublic String getWidget(String name)
name - widget name or aliaspublic boolean existsWidget(String name)
name - widget name or aliaspublic Parser parser()
public Buffer buffer()
public void replaceBuffer(Buffer buffer)
buffer - buffer that will be copied to the LineReader Bufferpublic String prevChar()
public String currChar()
public String lastBinding()
public void putString(String string)
string - string to be written into LineReader Bufferpublic String tailTip()
public void setTailTip(String tailTip)
tailTip - tail tip to be added to the command linepublic void setErrorPattern(Pattern errorPattern)
errorPattern - error pattern to be set LineReader Highlighterpublic void setErrorIndex(int errorIndex)
errorIndex - error index to be set LineReader Highlighterpublic void clearTailTip()
public void setSuggestionType(LineReader.SuggestionType type)
type - type to be set to the LineReader autosuggestionpublic void addDescription(List<org.jline.utils.AttributedString> desc)
desc - Text to be dispalyed on terminal status barpublic void clearDescription()
public void initDescription(int size)
size - Terminal status bar size in rowspublic void destroyDescription()
Copyright © 2020. All rights reserved.