GWT RichTextArea not Capturing onBrowserEvent (Event.ONPASTE)

I'm trying to get the Event.ONPASTE event on my RichTextArea, but for some reason this event NEVER gets called. I already tried with Ctrl + V and using mouse -> Right Click -> Paste and still nothing happens.

To help me diagnose this, I've started printing the events that are being captured and it realy does looks like the ONPASTE event is completely ignored.

The code that I'm using:

import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.RichTextArea;

public class CustomRichTextArea extends RichTextArea {
    public CustomRichTextArea() {
        super();
        sinkEvents(Event.ONPASTE);
    }

    @Override
    public void onBrowserEvent(Event event) {
        super.onBrowserEvent(event);
        System.out.println("Event.getTypeInt: " + event.getTypeInt() + " - Event.getType: " + event.getType());
        switch (event.getTypeInt()) {
        case Event.ONPASTE:
            System.out.println("Paste Detected");
            break;
        }
    }
}

And those are the messages that I get on my console:

Event.getTypeInt: 1 - Event.getType: click
Event.getTypeInt: 128 - Event.getType: keydown
Event.getTypeInt: 16 - Event.getType: mouseover
Event.getTypeInt: 2048 - Event.getType: focus
Event.getTypeInt: 32 - Event.getType: mouseout
Event.getTypeInt: 4 - Event.getType: mousedown
Event.getTypeInt: 4096 - Event.getType: blur
Event.getTypeInt: 512 - Event.getType: keyup
Event.getTypeInt: 64 - Event.getType: mousemove
Event.getTypeInt: 8 - Event.getType: mouseup

Any idea of what am I doing wrong?

链接地址: http://www.djcxy.com/p/65474.html

上一篇: SWT可以获取窗口中闪烁光标的位置

下一篇: GWT RichTextArea不捕获onBrowserEvent(Event.ONPASTE)