Package com.vaadin.flow.component.page
Enum Class PageVisibility
- All Implemented Interfaces:
Serializable,Comparable<PageVisibility>,Constable
Represents the visibility state of a browser page.
Uses the browser's Page Visibility API (document.hidden) combined
with document.hasFocus() to distinguish between three observable
states — fully visible and focused, visible but not focused, and hidden —
plus an UNKNOWN sentinel used before the first value has arrived
from the client.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe page is not visible, e.g.No value has been reported by the browser yet.The page is visible and focused.The page is visible but not focused, e.g. -
Method Summary
Modifier and TypeMethodDescriptionstatic PageVisibilityReturns the enum constant of this class with the specified name.static PageVisibility[]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. -
VISIBLE
The page is visible and focused.In the browser, this means
!document.hiddenanddocument.hasFocus()istrue. -
VISIBLE_NOT_FOCUSED
The page is visible but not focused, e.g. behind another window.In the browser, this means
!document.hiddenanddocument.hasFocus()isfalse. -
HIDDEN
The page is not visible, e.g. the browser tab is in the background or the window is minimized.In the browser, this is indicated by
document.hiddenbeingtrue.
-
-
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
-