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 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EditMode
createKeyEvent
-
Method Details
-
clearDefaultActions
protected void clearDefaultActions()Clears all default key actions and key event actions. -
addAction
-
remapKeysFromDevice
Description copied from interface:EditModeRemap keys based on device capabilities.- Specified by:
remapKeysFromDevicein interfaceEditMode- Parameters:
device- the terminal device
-
prevKey
-
setPrevKey
Description copied from interface:EditModeSet the previous key action.- Specified by:
setPrevKeyin interfaceEditMode- Parameters:
event- the key action to set as previous
-
addAction
-
addAction
-
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
-
status
Description copied from interface:EditModeGet the current edit status. -
setStatus
Description copied from interface:EditModeSet the edit status. -
parse
-
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
-