Package com.vaadin.flow.component.page
Enum Class WebShareSupport
- All Implemented Interfaces:
Serializable,Comparable<WebShareSupport>,Constable
Whether the browser exposes the Web Share API (
navigator.share).
Held by Page.shareSupportSignal(). Reading the value does not show
any browser dialog — it reports whether a subsequent
Page.share(String, String, String) call would succeed in invoking the
native share sheet, or whether it would fail because the API is missing in
the current browser context.
Typical usage:
SUPPORTED— show a "Share" button that triggersPage.share(String, String, String).UNSUPPORTED— fall back to a copy-link or social-network affordance; the native sheet is unavailable in this browser.UNKNOWN— only seen in the brief window before the bootstrap handshake completes; treat the same asUNSUPPORTEDuntil a real value arrives.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe browser exposesnavigator.share; calls toPage.share(String, String, String)will invoke the native share sheet.No value has been reported by the browser yet.The browser does not exposenavigator.share; calls toPage.share(String, String, String)will throwUnsupportedOperationException. -
Method Summary
Modifier and TypeMethodDescriptionstatic WebShareSupportReturns the enum constant of this class with the specified name.static WebShareSupport[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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. -
SUPPORTED
The browser exposesnavigator.share; calls toPage.share(String, String, String)will invoke the native share sheet. -
UNSUPPORTED
The browser does not exposenavigator.share; calls toPage.share(String, String, String)will throwUnsupportedOperationException. Some desktop browsers, in particular older Firefox versions, fall in this bucket.
-
-
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
-