}
}
@Override
public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
TextArea textArea = (TextArea)component;
if (button == Mouse.Button.LEFT) {
// Move the caret to the insertion point
int offset = getCharacterAt(x, y);
if (offset != -1) {
textArea.setSelection(offset, 0);
}
caretX = x;
// TODO Register mouse listener to begin selecting text; also handle
// auto-scrolling when the mouse moves outside the component
// Set focus to the text input
if (textArea.isEditable()) {
textArea.requestFocus();
}
}
return super.mouseDown(component, button, x, y);
}