Class MoveForwardWord

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

public class MoveForwardWord extends Object
Action that moves the cursor forward to the end of the next word.
Author:
Ståle W. Pedersen
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new MoveForwardWord action with default settings.
    MoveForwardWord(boolean viMode)
    Creates a new MoveForwardWord action with the specified vi mode setting.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(InputProcessor inputProcessor)
    Executes this action on the given input processor.
    protected final void
    apply(int cursor, int oldCursor, InputProcessor inputProcessor)
    Apply the change action between two cursor positions.
    protected final void
    apply(int cursor, InputProcessor inputProcessor)
    Apply the change action from the current cursor position.
    protected EditMode.Status
    Get the edit mode status.
    protected boolean
    isDelimiter(char c)
    Check if the character is a delimiter (non-alphanumeric).
    protected boolean
    isSpace(char c)
    Check if the character is a whitespace.
    Returns the name of this action.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface Consumer

    andThen
  • Constructor Details

    • MoveForwardWord

      public MoveForwardWord()
      Creates a new MoveForwardWord action with default settings.
    • MoveForwardWord

      public MoveForwardWord(boolean viMode)
      Creates a new MoveForwardWord action with the specified vi mode setting.
      Parameters:
      viMode - true to enable vi mode, false for emacs mode
  • 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