Enum Class ClipboardAvailability
- All Implemented Interfaces:
Serializable,Comparable<ClipboardAvailability>,Constable
Whether the browser exposes the asynchronous Clipboard API in the current
page context.
Returned by Clipboard.availabilityHintSignal(). Reading the value
does not trigger a permission prompt — it only reports whether
navigator.clipboard is exposed and the page is served in a context
where the API can be used.
Typical usage:
AVAILABLE— show copy / paste controls; clipboard operations are usable.UNSUPPORTED— hide clipboard controls; no user action will make them work in this context (page served over plain HTTP, or embedded in an iframe whose Permissions-Policy blocksclipboard-write/clipboard-read).UNKNOWN— wait for the bootstrap handshake to complete; the brief window between server attach and the first client report holds this value.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe Clipboard API is exposed and usable in the current page context.No value has been reported by the browser yet.The Clipboard API is unusable in the current page context — the page is served over an insecure connection (plain HTTP rather than HTTPS orlocalhost), embedded in an iframe whose Permissions-Policy blocksclipboard-write, or the browser does not exposenavigator.clipboardat all. -
Method Summary
Modifier and TypeMethodDescriptionstatic ClipboardAvailabilityReturns the enum constant of this class with the specified name.static ClipboardAvailability[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AVAILABLE
The Clipboard API is exposed and usable in the current page context. SubsequentcopyOnClick/ paste-listener calls are expected to succeed when invoked from a user gesture. -
UNSUPPORTED
The Clipboard API is unusable in the current page context — the page is served over an insecure connection (plain HTTP rather than HTTPS orlocalhost), embedded in an iframe whose Permissions-Policy blocksclipboard-write, or the browser does not exposenavigator.clipboardat all. No user action can change this, so applications should hide clipboard-related controls. -
UNKNOWN
No value has been reported by the browser yet. Used only as the initial value of the signal before the first client handshake delivers the real one. In normal request handling the signal is seeded before any user code (UI initialization,UIInitListener, component attach) runs, so this value is essentially never observed in practice; once a real value has arrived, the signal never returns toUNKNOWN.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-