RichTextArea extends FocusWidget, which has a number of handlers for
keyboard events.
This snippet will let you catch a paste, assuming that the users paste
using CTRL+V
RichTextArea area = new RichTextArea();
area.addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.isControlKeyDown() && event.getNativeKeyCode() == 86) {
System.out.println("Paste");
}
}
});
Not sure how you would catch the paste event if it came from a right-
click context menu
or the browser menu though...