Class ClipboardCopy

java.lang.Object
com.vaadin.flow.component.page.ClipboardCopy
All Implemented Interfaces:
Registration, Serializable

public class ClipboardCopy extends Object implements Registration, Serializable
Handle for a client-side click-to-copy registration created by Clipboard.copyOnClick(com.vaadin.flow.component.Component, String).

Allows updating the text that will be copied and removing the click handler when no longer needed.

See Also:
  • Method Details

    • setValue

      public void setValue(String text)
      Updates the text that will be copied to the clipboard when the trigger element is clicked.

      The new value is pushed to the client-side so the copy operation can execute without a server round-trip.

      Parameters:
      text - the new text to copy, or an empty string if null
    • remove

      public void remove()
      Removes the client-side click handler and cleans up associated resources.
      Specified by:
      remove in interface Registration
      See Also: