Class AeshConsoleBuffer
java.lang.Object
org.aesh.readline.AeshConsoleBuffer
- All Implemented Interfaces:
ConsoleBuffer
- Author:
- Ståle W. Pedersen invalid input: '<'stale.pedersen@jboss.org>
-
Constructor Summary
ConstructorsConstructorDescriptionAeshConsoleBuffer(org.aesh.terminal.Connection connection, Prompt prompt, EditMode editMode, History history, CompletionHandler completionHandler, boolean ansi, CursorListener listener) -
Method Summary
Modifier and TypeMethodDescriptionvoidWill add the current action to the undo stackbuffer()voidChange case on the char located at the cursor positionvoidclear(boolean includeBuffer) Clear an ansi terminal.voiddelete(int delta) Delete from cursor position back or forth depending on the value of delta.voiddownCase()Down case the char located at the cursor positionvoiddrawLine()Print the contents of the current buffer to the consolevoidForce a rewrite of the prompt even though it might not be neededhistory()voidinsert(int[] insert) Insert at the end of the BuffervoidInsert a String into the buffer at a specific pointvoidmoveCursor(int where) Move the cursor either back or forth.voidreplace(int[] line) Replace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer linevoidReplace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer linevoidreset()Clear all content in the Buffer and reset all datavoidSpecify the promptvoidsetSize(org.aesh.terminal.tty.Size size) org.aesh.terminal.tty.Sizesize()voidupCase()Up case the char located at the cursor positionvoidwriteChar(char input) voidwriteChars(int[] input) voidwriteOut(int[] out) voidvoidwriteString(String input)
-
Constructor Details
-
AeshConsoleBuffer
public AeshConsoleBuffer(org.aesh.terminal.Connection connection, Prompt prompt, EditMode editMode, History history, CompletionHandler completionHandler, boolean ansi, CursorListener listener)
-
-
Method Details
-
history
- Specified by:
historyin interfaceConsoleBuffer- Returns:
- history
-
completer
- Specified by:
completerin interfaceConsoleBuffer- Returns:
- CompletionHandler
-
setSize
public void setSize(org.aesh.terminal.tty.Size size) - Specified by:
setSizein interfaceConsoleBuffer- Parameters:
size- specify new size
-
size
public org.aesh.terminal.tty.Size size()- Specified by:
sizein interfaceConsoleBuffer- Returns:
- size
-
buffer
- Specified by:
bufferin interfaceConsoleBuffer- Returns:
- buffer
-
undoManager
- Specified by:
undoManagerin interfaceConsoleBuffer- Returns:
- UndoManager
-
addActionToUndoStack
public void addActionToUndoStack()Description copied from interface:ConsoleBufferWill add the current action to the undo stack- Specified by:
addActionToUndoStackin interfaceConsoleBuffer
-
pasteManager
- Specified by:
pasteManagerin interfaceConsoleBuffer- Returns:
- PasteManager
-
moveCursor
public void moveCursor(int where) Description copied from interface:ConsoleBufferMove the cursor either back or forth. Boundary checks will be done to make sure that the cursor do not go OB.- Specified by:
moveCursorin interfaceConsoleBuffer- Parameters:
where- < 0 move back, where > 0 move forward
-
drawLine
public void drawLine()Description copied from interface:ConsoleBufferPrint the contents of the current buffer to the console- Specified by:
drawLinein interfaceConsoleBuffer
-
drawLineForceDisplay
public void drawLineForceDisplay()Description copied from interface:ConsoleBufferForce a rewrite of the prompt even though it might not be needed- Specified by:
drawLineForceDisplayin interfaceConsoleBuffer
-
writeChar
public void writeChar(char input) - Specified by:
writeCharin interfaceConsoleBuffer- Parameters:
input- char to write to the Buffer
-
writeOut
- Specified by:
writeOutin interfaceConsoleBuffer- Parameters:
out- write directly to the Connection output stream
-
writeOut
public void writeOut(int[] out) - Specified by:
writeOutin interfaceConsoleBuffer- Parameters:
out- write directly to the Connection output stream
-
writeChars
public void writeChars(int[] input) - Specified by:
writeCharsin interfaceConsoleBuffer- Parameters:
input- write to the Buffer
-
writeString
- Specified by:
writeStringin interfaceConsoleBuffer- Parameters:
input- write to the Buffer
-
setPrompt
Description copied from interface:ConsoleBufferSpecify the prompt- Specified by:
setPromptin interfaceConsoleBuffer- Parameters:
prompt- new prompt
-
insert
Description copied from interface:ConsoleBufferInsert a String into the buffer at a specific point- Specified by:
insertin interfaceConsoleBuffer- Parameters:
insert- inputposition- point in the buffer
-
insert
public void insert(int[] insert) Description copied from interface:ConsoleBufferInsert at the end of the Buffer- Specified by:
insertin interfaceConsoleBuffer- Parameters:
insert- data
-
delete
public void delete(int delta) Description copied from interface:ConsoleBufferDelete from cursor position back or forth depending on the value of delta. Delta < 0 delete backwards, delta > 0 delete forwards.- Specified by:
deletein interfaceConsoleBuffer- Parameters:
delta- specify which direction and how far to delete
-
upCase
public void upCase()Description copied from interface:ConsoleBufferUp case the char located at the cursor position- Specified by:
upCasein interfaceConsoleBuffer
-
downCase
public void downCase()Description copied from interface:ConsoleBufferDown case the char located at the cursor position- Specified by:
downCasein interfaceConsoleBuffer
-
changeCase
public void changeCase()Description copied from interface:ConsoleBufferChange case on the char located at the cursor position- Specified by:
changeCasein interfaceConsoleBuffer
-
replace
public void replace(int[] line) Description copied from interface:ConsoleBufferReplace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer line- Specified by:
replacein interfaceConsoleBuffer- Parameters:
line- input
-
replace
Description copied from interface:ConsoleBufferReplace the entire current buffer with the given line The new line will be pushed to the Connection Cursor will be moved to the end of the new buffer line- Specified by:
replacein interfaceConsoleBuffer- Parameters:
line- input
-
reset
public void reset()Description copied from interface:ConsoleBufferClear all content in the Buffer and reset all data- Specified by:
resetin interfaceConsoleBuffer
-
clear
public void clear(boolean includeBuffer) Description copied from interface:ConsoleBufferClear an ansi terminal. Set includeBuffer to true if the current buffer should be printed again after clear.- Specified by:
clearin interfaceConsoleBuffer- Parameters:
includeBuffer- if true include the current buffer line
-