Class Buffer
java.lang.Object
org.aesh.readline.Buffer
Buffer to keep track of text and cursor position in the console.
Is using ANSI-codes to clear text and move cursor in the terminal.
- Author:
- Ståle W. Pedersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasString()voidclear()intcursor()voidDelete from cursor position and backwards if delta is invalid input: '<' 0 Delete from cursor position and forwards if delta is > 0voidvoiddisablePrompt(boolean disable) Need to disable prompt in calculations involving search.voidforceSetDeltaChangedAtEndOfBuffer(boolean delta) intget(int pos) int[]voidInsert text at cursor positionvoidInsert at cursor position.voidWrite a string to the line and update cursor accordinglyvoidSome completion occured, do not try to compute character index location.booleanbooleanbooleanintlength()voidMove the cursor left if the param is negative, right if its positive.voidMove the cursor left if the param is negative, right if its positive.static int[]moveNumberOfColumns(int column, char direction) intint[]prompt()voidReplace the current charactervoidvoidReplace the entire current buffer with the given line.voidreset()voidsetIsPromptDisplayed(boolean isPromptDisplayed) voidsetMultiLine(boolean multi) void
-
Constructor Details
-
Buffer
-
-
Method Details
-
getCursorLocator
-
get
public int get(int pos) -
cursor
public int cursor() -
multiCursor
public int multiCursor() -
isMasking
public boolean isMasking() -
isMultiLine
public boolean isMultiLine() -
asString
-
reset
public void reset() -
setIsPromptDisplayed
public void setIsPromptDisplayed(boolean isPromptDisplayed) -
forceSetDeltaChangedAtEndOfBuffer
public void forceSetDeltaChangedAtEndOfBuffer(boolean delta) -
disablePrompt
public void disablePrompt(boolean disable) Need to disable prompt in calculations involving search.- Parameters:
disable- prompt or not
-
isPromptDisabled
public boolean isPromptDisabled() -
prompt
-
length
public int length() -
setMultiLine
public void setMultiLine(boolean multi) -
invalidateCursorLocation
public void invalidateCursorLocation()Some completion occured, do not try to compute character index location. This could be revisited to implement a strategy. -
updateMultiLineBuffer
public void updateMultiLineBuffer() -
insert
Insert text at cursor position- Parameters:
data- text
-
insert
Insert at cursor position.- Parameters:
data- char
-
move
Move the cursor left if the param is negative, right if its positive.- Parameters:
out- streammove- where to movetermWidth- terminal width
-
move
Move the cursor left if the param is negative, right if its positive. If viMode is true, the cursor will not move beyond the current buffer size- Parameters:
out- streammove- where to movetermWidth- terminal widthviMode- edit mode (vi or emacs)
-
moveNumberOfColumns
public static int[] moveNumberOfColumns(int column, char direction) -
getLineMasked
public int[] getLineMasked() -
clear
public void clear() -
replace
-
replace
-
multiLine
public int[] multiLine() -
delete
Delete from cursor position and backwards if delta is invalid input: '<' 0 Delete from cursor position and forwards if delta is > 0- Parameters:
delta- difference
-
delete
-
insert
-
replace
Replace the current character
-