public class CopyPasteTextBox
extends com.google.gwt.user.client.ui.TextArea
implements com.google.gwt.user.client.Event.NativePreviewHandler
It works by intercepting the keyboard shortcuts for cut, copy and paste and moving focus to a hidden textfield. In the textfield we can listen to oncopy and oncut events, and put our string into the HTML clipboard instead of the normal one.
| Modifier and Type | Class and Description |
|---|---|
static interface |
CopyPasteTextBox.CopyPasteHandler
Handler interface for dealing with the data that is transferred in copy,
cut and paste operations.
|
com.google.gwt.user.client.ui.TextBoxBase.TextAlignConstantcom.google.gwt.user.client.ui.ValueBoxBase.TextAlignment| Constructor and Description |
|---|
CopyPasteTextBox(SheetWidget widget,
CopyPasteTextBox.CopyPasteHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
void |
onDestroy()
Removes the registration of the handler responsible for native events
|
void |
onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event) |
void |
registerHandler()
Register this instance to listen to all native events
|
getCharacterWidth, getCursorPos, getSelectionLength, getVisibleLines, setCharacterWidth, setVisibleLines, wrapaddChangeListener, getValue, setTextAlignmentaddChangeHandler, addValueChangeHandler, asEditor, cancelKey, getDirection, getDirectionEstimator, getImpl, getName, getSelectedText, getText, getValueOrThrow, isReadOnly, onBrowserEvent, onLoad, removeChangeListener, selectAll, setAlignment, setCursorPos, setDirection, setDirectionEstimator, setDirectionEstimator, setKey, setName, setReadOnly, setSelectionRange, setText, setValue, setValueaddBlurHandler, addClickHandler, addClickListener, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addFocusHandler, addFocusListener, addGestureChangeHandler, addGestureEndHandler, addGestureStartHandler, addKeyboardListener, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, addTouchCancelHandler, addTouchEndHandler, addTouchMoveHandler, addTouchStartHandler, getFocusImpl, getTabIndex, isEnabled, onAttach, removeClickListener, removeFocusListener, removeKeyboardListener, removeMouseListener, removeMouseWheelListener, setAccessKey, setEnabled, setFocus, setTabIndexaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onDetach, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic CopyPasteTextBox(SheetWidget widget, CopyPasteTextBox.CopyPasteHandler handler)
public void registerHandler()
public void onPreviewNativeEvent(com.google.gwt.user.client.Event.NativePreviewEvent event)
onPreviewNativeEvent in interface com.google.gwt.user.client.Event.NativePreviewHandlerpublic void onDestroy()
Copyright © 2013–2026 Vaadin Ltd. All rights reserved.