public class Buffer extends Object
Modifier | Constructor and Description |
---|---|
protected |
Buffer(boolean ansi) |
protected |
Buffer(boolean ansi,
Prompt prompt)
Instantiate a Buffer with given prompt
|
protected |
Buffer(Prompt prompt) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
changeCase()
Switch case if the current character is a letter.
|
protected void |
clear() |
protected boolean |
containRedirection() |
protected void |
delete(int start,
int end) |
protected void |
disablePrompt(boolean disable)
Need to disable prompt in calculations involving search.
|
protected int |
getCursor() |
protected int |
getCursorWithPrompt() |
int |
getDelta() |
String |
getLine() |
protected char[] |
getLineFrom(int position)
Get line from given param
|
String |
getLineNoMask() |
String |
getLineWithPrompt()
Get the complete line (including prompt)
|
int |
getMultiCursor() |
String |
getMultiLine() |
protected String |
getMultiLineBuffer() |
protected Prompt |
getPrompt() |
protected int |
getRedirectionPosition() |
protected void |
insert(int start,
String in) |
boolean |
isMasking() |
protected boolean |
isMultiLine() |
protected boolean |
isPromptDisabled() |
protected int |
length() |
protected char[] |
move(int move,
int termWidth)
Move the cursor left if the param is negative,
and right if its positive.
|
protected char[] |
move(int move,
int termWidth,
boolean viMode) |
static char[] |
printAnsi(String out)
Return a ansified string based on param
|
protected void |
replaceChar(char rChar) |
protected void |
replaceChar(char rChar,
int pos) |
protected void |
reset()
Reset the buffer, keep the existing prompt
|
protected void |
reset(Prompt prompt)
Reset the buffer
|
protected void |
setCursor(int cursor) |
protected void |
setLine(String line) |
protected void |
setMultiLine(boolean m) |
protected int |
totalLength() |
protected void |
updateMultiLineBuffer() |
protected void |
updatePrompt(Prompt prompt) |
void |
write(char c)
Write a char to the line and update cursor accordingly
|
void |
write(String str)
Write a string to the line and update cursor accordingly
|
protected Buffer(boolean ansi)
protected Buffer(boolean ansi, Prompt prompt)
prompt
- set promptprotected Buffer(Prompt prompt)
protected void reset(Prompt prompt)
prompt
- set promptprotected void reset()
protected void updatePrompt(Prompt prompt)
protected int length()
protected int totalLength()
protected int getCursor()
protected int getCursorWithPrompt()
protected Prompt getPrompt()
protected void setCursor(int cursor)
protected boolean isMultiLine()
protected void setMultiLine(boolean m)
protected void updateMultiLineBuffer()
protected String getMultiLineBuffer()
public boolean isMasking()
protected void disablePrompt(boolean disable)
disable
- prompt or notprotected boolean isPromptDisabled()
protected char[] move(int move, int termWidth)
move
- where to movetermWidth
- terminal widthprotected char[] move(int move, int termWidth, boolean viMode)
public static char[] printAnsi(String out)
out
- stringprotected char[] getLineFrom(int position)
position
- in linepublic String getLine()
public String getLineNoMask()
protected void setLine(String line)
public String getMultiLine()
public int getMultiCursor()
protected void delete(int start, int end)
protected void insert(int start, String in)
public String getLineWithPrompt()
public void write(char c)
c
- charpublic void write(String str)
str
- stringprotected void clear()
public int getDelta()
protected boolean changeCase()
protected void replaceChar(char rChar)
protected void replaceChar(char rChar, int pos)
protected boolean containRedirection()
protected int getRedirectionPosition()
Copyright © 2019 JBoss by Red Hat. All rights reserved.