Package com.vaadin.flow.component.page
Class ClipboardEvent
java.lang.Object
com.vaadin.flow.component.page.ClipboardEvent
- All Implemented Interfaces:
Serializable
Represents a clipboard event (paste, copy, or cut) received from the browser.
A clipboard event may contain text, HTML content, files, or a combination of these.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetFiles()Gets the list of files from the clipboard event.getHtml()Gets the HTML content from the clipboard event.getText()Gets the plain text content from the clipboard event.getType()Gets the event type.booleanhasFiles()Checks whether this event contains file data.booleanhasHtml()Checks whether this event contains HTML data.booleanhasText()Checks whether this event contains plain text data.
-
Method Details
-
getType
Gets the event type.- Returns:
- the event type ("paste", "copy", or "cut")
-
getText
Gets the plain text content from the clipboard event.- Returns:
- the plain text, or
nullif no text was available
-
getHtml
Gets the HTML content from the clipboard event.- Returns:
- the HTML content, or
nullif no HTML was available
-
hasText
public boolean hasText()Checks whether this event contains plain text data.- Returns:
trueif text data is available
-
hasHtml
public boolean hasHtml()Checks whether this event contains HTML data.- Returns:
trueif HTML data is available
-
hasFiles
public boolean hasFiles()Checks whether this event contains file data.- Returns:
trueif file data is available
-
getFiles
Gets the list of files from the clipboard event.- Returns:
- an unmodifiable list of clipboard files, never
null
-