public class PasteManager extends Object implements PasteHandler, CopyHandler
PasteHandler that can filter the value that has been pasted in a RichTextArea.| Constructor and Description |
|---|
PasteManager() |
| Modifier and Type | Method and Description |
|---|---|
protected List<com.google.gwt.event.shared.HandlerRegistration> |
addHandlers()
Adds all required event handlers and returns their registrations so that they can be unregistered at the end.
|
protected void |
centerPasteContainer(Element pasteContainer)
We added this method just to be able to override it for IE9 so that we can overcome a GWT bug.
|
protected RichTextArea |
getTextArea() |
List<com.google.gwt.event.shared.HandlerRegistration> |
initialize(RichTextArea textArea,
ImportServiceAsync importService)
Configures this instance to catch the paste events from the given rich text area and to clean the paste content
using the specified service.
|
void |
onCopy(CopyEvent event) |
void |
onPaste(PasteEvent event) |
protected void |
selectPasteContainer(Element pasteContainer)
Select the contents of the given paste container.
|
public List<com.google.gwt.event.shared.HandlerRegistration> initialize(RichTextArea textArea, ImportServiceAsync importService)
textArea - the rich text area whose paste event are caughtimportService - the component used to clean the paste content on the server sideprotected List<com.google.gwt.event.shared.HandlerRegistration> addHandlers()
public void onPaste(PasteEvent event)
onPaste in interface PasteHandlerprotected void selectPasteContainer(Element pasteContainer)
pasteContainer - the paste containerprotected void centerPasteContainer(Element pasteContainer)
pasteContainer - the paste containerpublic void onCopy(CopyEvent event)
onCopy in interface CopyHandlerprotected RichTextArea getTextArea()
Copyright © 2004–2014 XWiki. All rights reserved.