src/main/java/com/spinyowl/legui/component/misc/listener/text/SelectAllTextEventListener.java
public void process(KeyboardEvent event) {
    TextComponent gui = (TextComponent) event.getTargetComponent();
    boolean pressed = event.getAction() != KeyAction.RELEASE;
    if (!pressed) {
      return;
    }

    KeyCode selectAllKey = Keyboard.getSelectAllShortcut().getKey();
    KeyCode keyCode = event.getKey().getKeyCode();
    if (event.getMods().contains(KeyMod.CONTROL)
        && (selectAllKey != null && keyCode == selectAllKey || keyCode == KEY_A)) {
      TextState textState = gui.getTextState();
      gui.getTextState().setStartSelectionIndex(0);
      gui.getTextState().setEndSelectionIndex(textState.length());
      gui.getTextState().setCaretPosition(textState.length());
    }
  }
/**
   * Used to handle {@link KeyEvent}.
   *
   * @param event event to handle.
   */
Used to handle  KeyEvent.
@param event event to handle.
Used to handle KeyEvent . @param event event to handle .
public void process(KeyboardEvent event) {
    TextComponent gui = (TextComponent) event.getTargetComponent();
    boolean pressed = event.getAction() != KeyAction.RELEASE;
    if (!pressed) {
      return;
    }
    KeyCode selectAllKey = Keyboard.getSelectAllShortcut().getKey();
    KeyCode keyCode = event.getKey().getKeyCode();
    if (event.getMods().contains(KeyMod.CONTROL)
        && (selectAllKey != null && keyCode == selectAllKey || keyCode == KEY_A)) {
      TextState textState = gui.getTextState();
      gui.getTextState().setStartSelectionIndex(0);
      gui.getTextState().setEndSelectionIndex(textState.length());
      gui.getTextState().setCaretPosition(textState.length());
    }
  }
public void process ( KeyboardEvent event ) { TextComponent gui = ( TextComponent ) event . getTargetComponent ( ) ; boolean pressed = event . getAction ( ) != KeyAction . RELEASE ; if ( ! pressed ) { return ; } KeyCode selectAllKey = Keyboard . getSelectAllShortcut ( ) . getKey ( ) ; KeyCode keyCode = event . getKey ( ) . getKeyCode ( ) ; if ( event . getMods ( ) . contains ( KeyMod . CONTROL ) && ( selectAllKey != null && keyCode == selectAllKey || keyCode == KEY_A ) ) { TextState textState = gui . getTextState ( ) ; gui . getTextState ( ) . setStartSelectionIndex ( 0 ) ; gui . getTextState ( ) . setEndSelectionIndex ( textState . length ( ) ) ; gui . getTextState ( ) . setCaretPosition ( textState . length ( ) ) ; } }
Used to handle {@link KeyEvent}.
Used to handle { @link KeyEvent } .