|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.crsh.console.Plugin org.crsh.console.Editor
class Editor
An editor state machine. todo: - undo - optimize operation with an improvement of EditorBuffer
Field Summary | |
---|---|
(package private) EditorBuffer |
buffer . |
(package private) Console |
console . |
(package private) LinkedList<String> |
history . |
(package private) String |
historyBuffer . |
(package private) int |
historyCursor . |
(package private) StringBuilder |
killBuffer The buffer that holds what we kill. |
(package private) LineParser |
lineParser The line parser : updated on enter key. |
private Mode |
mode . |
private ArrayList<Runnable> |
modeListeners . |
private static ConsoleDriver |
NULL |
(package private) MultiLineVisitor |
visitor . |
Constructor Summary | |
---|---|
Editor(Console console) |
|
Editor(Console console, boolean echo) |
Method Summary | |
---|---|
(package private) void |
addModeListener(Runnable runnable) |
(package private) void |
addToHistory(String line) |
(package private) String |
append(EditorAction action, int[] sequence) |
(package private) String |
getCurrentLine() |
(package private) int |
getCurrentPosition() |
(package private) int |
getCursorBound() Returns the right cursor bound depending on the current mode. |
(package private) String |
getKillBuffer() |
(package private) Mode |
getMode() |
(package private) boolean |
isEmpty() |
(package private) void |
reset() |
(package private) void |
setKillBuffer(CharSequence s) |
(package private) void |
setMode(Mode mode) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final Console console
final EditorBuffer buffer
final MultiLineVisitor visitor
final LineParser lineParser
final LinkedList<String> history
private Mode mode
int historyCursor
String historyBuffer
final StringBuilder killBuffer
private final ArrayList<Runnable> modeListeners
private static final ConsoleDriver NULL
Constructor Detail |
---|
Editor(Console console)
Editor(Console console, boolean echo)
Method Detail |
---|
Mode getMode()
void setMode(Mode mode)
void addModeListener(Runnable runnable)
void addToHistory(String line)
int getCursorBound()
String getKillBuffer()
void setKillBuffer(CharSequence s)
boolean isEmpty()
String getCurrentLine()
int getCurrentPosition()
String append(EditorAction action, int[] sequence)
void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |