Enum Class FullscreenState

java.lang.Object
java.lang.Enum<FullscreenState>
com.vaadin.flow.component.fullscreen.FullscreenState
All Implemented Interfaces:
Serializable, Comparable<FullscreenState>, Constable

public enum FullscreenState extends Enum<FullscreenState>
Represents the fullscreen state of a browser page.

Wraps the browser's Fullscreen API (document.fullscreenEnabled and document.fullscreenElement) into four observable states: the browser does not support fullscreen at all, fullscreen is supported but the page is not in it, the page is currently fullscreen, and an UNKNOWN sentinel used before the first value has arrived from the client.

See Also:
  • Enum Constant Details

    • UNKNOWN

      public static final FullscreenState 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 to UNKNOWN.
    • UNSUPPORTED

      public static final FullscreenState UNSUPPORTED
      The browser does not support fullscreen mode, or the document is not permitted to enter it. In the browser, this corresponds to document.fullscreenEnabled being false. Fullscreen requests bound via Fullscreen resolve to a rejection in this state.
    • NOT_FULLSCREEN

      public static final FullscreenState NOT_FULLSCREEN
      Fullscreen mode is supported and the page is currently not in it. In the browser, this corresponds to document.fullscreenEnabled being true and document.fullscreenElement being null.
    • FULLSCREEN

      public static final FullscreenState FULLSCREEN
      The page is currently in fullscreen mode. In the browser, this corresponds to document.fullscreenElement being non-null.
  • Method Details

    • values

      public static FullscreenState[] 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

      public static FullscreenState valueOf(String name)
      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 name
      NullPointerException - if the argument is null