Class CopyForwardWord

java.lang.Object
org.aesh.readline.action.mappings.CopyForwardWord
All Implemented Interfaces:
Consumer<InputProcessor>, Action

public class CopyForwardWord extends Object
Action that copies text from cursor to end of word.
Author:
Ståle W. Pedersen
  • Constructor Details

    • CopyForwardWord

      public CopyForwardWord()
      Creates a new copy forward word action.
    • CopyForwardWord

      public CopyForwardWord(boolean viMode)
      Creates a new copy forward word action.
      Parameters:
      viMode - whether vi mode is enabled
  • Method Details

    • name

      public String name()
      Description copied from interface: Action
      Returns the name of this action.
      Returns:
      the action name
    • accept

      public void accept(InputProcessor inputProcessor)
      Description copied from interface: Action
      Executes this action on the given input processor.
      Parameters:
      inputProcessor - the input processor to operate on
    • getStatus

      protected EditMode.Status getStatus()
      Get the edit mode status.
      Returns:
      the status
    • apply

      protected final void apply(int cursor, InputProcessor inputProcessor)
      Apply the change action from the current cursor position.
      Parameters:
      cursor - the target cursor position
      inputProcessor - the input processor
    • apply

      protected final void apply(int cursor, int oldCursor, InputProcessor inputProcessor)
      Apply the change action between two cursor positions.
      Parameters:
      cursor - the target cursor position
      oldCursor - the original cursor position
      inputProcessor - 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