Class ClipboardEvent

java.lang.Object
com.vaadin.flow.component.page.ClipboardEvent
All Implemented Interfaces:
Serializable

public class ClipboardEvent extends Object implements 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 Details

    • getType

      public String getType()
      Gets the event type.
      Returns:
      the event type ("paste", "copy", or "cut")
    • getText

      public String getText()
      Gets the plain text content from the clipboard event.
      Returns:
      the plain text, or null if no text was available
    • getHtml

      public String getHtml()
      Gets the HTML content from the clipboard event.
      Returns:
      the HTML content, or null if no HTML was available
    • hasText

      public boolean hasText()
      Checks whether this event contains plain text data.
      Returns:
      true if text data is available
    • hasHtml

      public boolean hasHtml()
      Checks whether this event contains HTML data.
      Returns:
      true if HTML data is available
    • hasFiles

      public boolean hasFiles()
      Checks whether this event contains file data.
      Returns:
      true if file data is available
    • getFiles

      public List<ClipboardFile> getFiles()
      Gets the list of files from the clipboard event.
      Returns:
      an unmodifiable list of clipboard files, never null