Package org.aesh.readline.editing
Class Emacs
java.lang.Object
org.aesh.readline.editing.Emacs
- All Implemented Interfaces:
EditMode
Emacs-style line editing mode implementation.
- Author:
- Ståle W. Pedersen
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.aesh.readline.editing.EditMode
EditMode.Mode, EditMode.Status -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an action mapping by key input and action name.voidAdds a key binding with the specified action name.Adds a key binding with the specified action.voidaddVariable(Variable variable, String value) Add a variable with its value.protected voidClears all default key actions and key event actions.protected intGets the current EOF counter value.booleanCheck if currently in a chained action sequence.keys()Get the key actions for this mode.mode()Get the editing mode type.Parse a key event and return the corresponding action.prevKey()Get the previous key action.voidremapKeysFromDevice(Device device) Remap keys based on device capabilities.protected voidresetEOF()Resets the EOF counter to zero.voidsetPrevKey(KeyAction event) Set the previous key action.voidsetStatus(EditMode.Status status) Set the edit status.status()Get the current edit status.voidupdateIgnoreEOF(int eof) Update the ignore-EOF counter.variableValue(Variable variable) Get the value of a variable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.aesh.readline.editing.EditMode
createKeyEvent
-
Method Details
-
clearDefaultActions
protected void clearDefaultActions()Clears all default key actions and key event actions. -
addAction
Description copied from interface:EditModeAdd an action mapping by key input and action name. -
remapKeysFromDevice
Description copied from interface:EditModeRemap keys based on device capabilities.- Specified by:
remapKeysFromDevicein interfaceEditMode- Parameters:
device- the terminal device
-
prevKey
Description copied from interface:EditModeGet the previous key action. -
setPrevKey
Description copied from interface:EditModeSet the previous key action.- Specified by:
setPrevKeyin interfaceEditMode- Parameters:
event- the key action to set as previous
-
addAction
Adds a key binding with the specified action name.- Parameters:
input- the key to bindaction- the action name to bind to the key
-
addAction
Adds a key binding with the specified action. -
addVariable
Description copied from interface:EditModeAdd a variable with its value.- Specified by:
addVariablein interfaceEditMode- Parameters:
variable- the variable to setvalue- the value to assign
-
updateIgnoreEOF
public void updateIgnoreEOF(int eof) Description copied from interface:EditModeUpdate the ignore-EOF counter.- Specified by:
updateIgnoreEOFin interfaceEditMode- Parameters:
eof- the EOF value to update
-
resetEOF
protected void resetEOF()Resets the EOF counter to zero. -
getEofCounter
protected int getEofCounter()Gets the current EOF counter value.- Returns:
- the EOF counter value
-
mode
Description copied from interface:EditModeGet the editing mode type. -
keys
Description copied from interface:EditModeGet the key actions for this mode. -
status
Description copied from interface:EditModeGet the current edit status. -
setStatus
Description copied from interface:EditModeSet the edit status. -
parse
Description copied from interface:EditModeParse a key event and return the corresponding action. -
isInChainedAction
public boolean isInChainedAction()Description copied from interface:EditModeCheck if currently in a chained action sequence.- Specified by:
isInChainedActionin interfaceEditMode- Returns:
- true if in a chained action
-
variableValue
Description copied from interface:EditModeGet the value of a variable.- Specified by:
variableValuein interfaceEditMode- Parameters:
variable- the variable to look up- Returns:
- the variable's value, or null if not set
-