Interface ConsoleBuffer
- All Known Implementing Classes:
AeshConsoleBuffer
public interface ConsoleBuffer
Internal class for actions to get access to the buffer, history, connection, ++
- Author:
- Ståle W. Pedersen
-
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)
-
Method Details
-
history
History history()- Returns:
- history
-
completer
CompletionHandler completer()- Returns:
- CompletionHandler
-
setSize
void setSize(org.aesh.terminal.tty.Size size) - Parameters:
size- specify new size
-
size
org.aesh.terminal.tty.Size size()- Returns:
- size
-
buffer
Buffer buffer()- Returns:
- buffer
-
undoManager
UndoManager undoManager()- Returns:
- UndoManager
-
addActionToUndoStack
void addActionToUndoStack()Will add the current action to the undo stack -
pasteManager
PasteManager pasteManager()- Returns:
- PasteManager
-
moveCursor
void moveCursor(int where) Move the cursor either back or forth. Boundary checks will be done to make sure that the cursor do not go OB.- Parameters:
where- < 0 move back, where > 0 move forward
-
drawLine
void drawLine()Print the contents of the current buffer to the console -
drawLineForceDisplay
void drawLineForceDisplay()Force a rewrite of the prompt even though it might not be needed -
writeChar
void writeChar(char input) - Parameters:
input- char to write to the Buffer
-
writeOut
- Parameters:
out- write directly to the Connection output stream
-
writeOut
void writeOut(int[] out) - Parameters:
out- write directly to the Connection output stream
-
writeChars
void writeChars(int[] input) - Parameters:
input- write to the Buffer
-
writeString
- Parameters:
input- write to the Buffer
-
setPrompt
-
insert
Insert a String into the buffer at a specific point- Parameters:
insert- inputposition- point in the buffer
-
insert
void insert(int[] insert) Insert at the end of the Buffer- Parameters:
insert- data
-
delete
void delete(int delta) Delete from cursor position back or forth depending on the value of delta. Delta < 0 delete backwards, delta > 0 delete forwards.- Parameters:
delta- specify which direction and how far to delete
-
upCase
void upCase()Up case the char located at the cursor position -
downCase
void downCase()Down case the char located at the cursor position -
changeCase
void changeCase()Change case on the char located at the cursor position -
replace
void replace(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 line- Parameters:
line- input
-
replace
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 line- Parameters:
line- input
-
reset
void reset()Clear all content in the Buffer and reset all data -
clear
void clear(boolean includeBuffer) Clear an ansi terminal. Set includeBuffer to true if the current buffer should be printed again after clear.- Parameters:
includeBuffer- if true include the current buffer line
-