@Override
  public int getLeadSelectionOffset() {
    JTextComponent textComponent = getTextComponent();
    final int caretPosition = textComponent.getCaretPosition();
    final int start = textComponent.getSelectionStart();
    final int end = textComponent.getSelectionEnd();
    return caretPosition == start ? end : start;
  }
@Override
  public int getLeadSelectionOffset()