Class DeleteForwardWord
java.lang.Object
org.aesh.readline.action.mappings.DeleteForwardWord
- All Implemented Interfaces:
Consumer<InputProcessor>, Action
Action that deletes text from cursor to end of word.
- Author:
- Ståle W. Pedersen
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new DeleteForwardWord action in emacs mode.DeleteForwardWord(boolean viMode) Creates a new DeleteForwardWord action with delete status.DeleteForwardWord(boolean viMode, EditMode.Status status) Creates a new DeleteForwardWord action with the specified status. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(InputProcessor inputProcessor) Executes this action on the given input processor.protected final voidapply(int cursor, int oldCursor, InputProcessor inputProcessor) Apply the change action between two cursor positions.protected final voidapply(int cursor, InputProcessor inputProcessor) Apply the change action from the current cursor position.protected EditMode.StatusGet the edit mode status.protected booleanisDelimiter(char c) Check if the character is a delimiter (non-alphanumeric).protected booleanisSpace(char c) Check if the character is a whitespace.name()Returns the name of this action.
-
Constructor Details
-
DeleteForwardWord
public DeleteForwardWord()Creates a new DeleteForwardWord action in emacs mode. -
DeleteForwardWord
public DeleteForwardWord(boolean viMode) Creates a new DeleteForwardWord action with delete status.- Parameters:
viMode- true for vi mode, false for emacs mode
-
DeleteForwardWord
Creates a new DeleteForwardWord action with the specified status.- Parameters:
viMode- true for vi mode, false for emacs modestatus- the edit mode status
-
-
Method Details
-
name
-
accept
Description copied from interface:ActionExecutes this action on the given input processor.- Parameters:
inputProcessor- the input processor to operate on
-
getStatus
-
apply
Apply the change action from the current cursor position.- Parameters:
cursor- the target cursor positioninputProcessor- the input processor
-
apply
Apply the change action between two cursor positions.- Parameters:
cursor- the target cursor positionoldCursor- the original cursor positioninputProcessor- the input processor
-
isSpace
protected boolean isSpace(char c) Check if the character is a whitespace.- Parameters:
c- the character to check- Returns:
- true if the character is whitespace
-
isDelimiter
protected boolean isDelimiter(char c) Check if the character is a delimiter (non-alphanumeric).- Parameters:
c- the character to check- Returns:
- true if the character is a delimiter
-