Interface EditMode
public interface EditMode
Defines the interface for line editing modes such as Emacs and Vi.
- Author:
- Ståle W. Pedersen
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEditing mode types.static enumEditing status values. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an action mapping by key input and action name.Add an action mapping for a key.voidaddVariable(Variable variable, String value) Add a variable with its value.default KeyActioncreateKeyEvent(int[] input) Create a key event from input code points.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.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.
-
Method Details
-
mode
-
keys
-
status
-
setStatus
-
parse
-
isInChainedAction
boolean isInChainedAction()Check if currently in a chained action sequence.- Returns:
- true if in a chained action
-
updateIgnoreEOF
void updateIgnoreEOF(int eof) Update the ignore-EOF counter.- Parameters:
eof- the EOF value to update
-
addVariable
-
variableValue
-
addAction
-
addAction
Add an action mapping by key input and action name.- Parameters:
input- the key input code pointsaction- the action name
-
remapKeysFromDevice
Remap keys based on device capabilities.- Parameters:
device- the terminal device
-
prevKey
-
createKeyEvent
Create a key event from input code points.- Parameters:
input- the input code points- Returns:
- a KeyAction representing the input
-
setPrevKey
Set the previous key action.- Parameters:
event- the key action to set as previous
-