Class ClipboardErrorEvent


public class ClipboardErrorEvent extends ClientEvent<ClipboardListener>
Event fired when a clipboard operation fails.

This event is dispatched when the browser's Clipboard API cannot complete an operation. Common reasons include:

  • User denied permission for clipboard access
  • Page is not in a secure context (not HTTPS)
  • Clipboard API not supported by browser
  • Document is not focused

Usage:


 public void onEvent(ClipboardErrorEvent event) {
     showError("Clipboard access failed: " + event.getMessage());
 }
 
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • ClipboardErrorEvent

      public ClipboardErrorEvent(String message, String operation)
      Constructs a ClipboardErrorEvent with error details.
      Parameters:
      message - The error message.
      operation - The operation that failed ("read" or "write").
  • Method Details

    • getMessage

      public String getMessage()
      Returns the error message.
      Returns:
      A human-readable description of the error.
    • getOperation

      public String getOperation()
      Returns the operation that failed.
      Returns:
      "read" or "write".
    • isReadError

      public boolean isReadError()
      Checks if this is a read operation error.
      Returns:
      true if the read operation failed.
    • isWriteError

      public boolean isWriteError()
      Checks if this is a write operation error.
      Returns:
      true if the write operation failed.
    • dispatchTo

      public void dispatchTo(ClipboardListener listener)
      Description copied from class: Event
      Dispatches this event to the specified listener.

      Subclasses implement this method to call the appropriate handler method on the listener interface.

      Specified by:
      dispatchTo in class Event<ClipboardListener>
      Parameters:
      listener - the listener to dispatch this event to
    • toString

      public String toString()
      Overrides:
      toString in class Object