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...
On 4 Sep, 23:59, darkflame <[email protected]> wrote:
> I'm using a rich text area, and Ive run into the problem that when
> users cut and paste from some applications, a lot of junk formating is
> pasted as well.
>
> Is there any method to catch the paste, and strip this data out?
> So, while users can use it for rich text editing, they can only paste
> data in as plane text.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---