Package com.oorian.html.js.clipboard
Class ClipboardErrorEvent
java.lang.Object
com.oorian.messaging.events.Event<ClipboardListener>
com.oorian.messaging.events.client.ClientEvent<ClipboardListener>
com.oorian.html.js.clipboard.ClipboardErrorEvent
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 Summary
ConstructorsConstructorDescriptionClipboardErrorEvent(String message, String operation) Constructs a ClipboardErrorEvent with error details. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispatchTo(ClipboardListener listener) Dispatches this event to the specified listener.Returns the error message.Returns the operation that failed.booleanChecks if this is a read operation error.booleanChecks if this is a write operation error.toString()Methods inherited from class com.oorian.messaging.events.client.ClientEvent
getSource, getTarget, setSource, setTarget
-
Constructor Details
-
ClipboardErrorEvent
Constructs a ClipboardErrorEvent with error details.- Parameters:
message- The error message.operation- The operation that failed ("read" or "write").
-
-
Method Details
-
getMessage
Returns the error message.- Returns:
- A human-readable description of the error.
-
getOperation
Returns the operation that failed.- Returns:
- "read" or "write".
-
isReadError
public boolean isReadError()Checks if this is a read operation error.- Returns:
trueif the read operation failed.
-
isWriteError
public boolean isWriteError()Checks if this is a write operation error.- Returns:
trueif the write operation failed.
-
dispatchTo
Description copied from class:EventDispatches this event to the specified listener.Subclasses implement this method to call the appropriate handler method on the listener interface.
- Specified by:
dispatchToin classEvent<ClipboardListener>- Parameters:
listener- the listener to dispatch this event to
-
toString
-