Class FullScreen

java.lang.Object
org.vaadin.firitin.util.fullscreen.FullScreen

public class FullScreen extends Object
Java API for requesting full screen mode in a Vaadin application.

Note that the browsers require user interaction to enter full screen mode, so this API should be called in response to a user action, like a button click or a similar event. Requesting full screen mode in a constructor of a view or using server push will likely not work as expected.

  • Constructor Details

    • FullScreen

      public FullScreen()
  • Method Details

    • requestFullscreen

      public static void requestFullscreen()
    • requestFullscreen

      public static void requestFullscreen(com.vaadin.flow.component.Component component)
      Requests full screen mode for the given component.

      Note that on the client side, fullscreen mode is technically requested for the html element and the rest of the view is hidden during the full screen mode. This is to work around current limitation in "overlay components" (like Notification, ComboBox popup, etc.) and theme. Thus, if you have some elements in the "index.html" that are not part of the Vaadin Flow view, they may not be visible in full screen mode. Same if you are using embedding. In these cases you might try using requestFullscreenRaw(Component) method instead.

      Parameters:
      component - the component for which to request full screen mode
      See Also:
    • requestFullscreenRaw

      @Deprecated(forRemoval=false) public static void requestFullscreenRaw(com.vaadin.flow.dom.Element el)
      Deprecated.
      Requesting full screen for a specific element may have limitations in the current Vaadin version. Consider using requestFullscreen(Component) instead.
      Requests full screen mode for the given element.
      Parameters:
      el - the element for which to request full screen mode
    • requestFullscreenRaw

      @Deprecated(forRemoval=false) public static void requestFullscreenRaw(com.vaadin.flow.component.Component component)
      Deprecated.
      Consider using requestFullscreen(Component) instead. See implementation notes in requestFullscreen(Component) for more information.
      Requests full screen mode for the given component's element.
      Parameters:
      component - the component for which to request full screen mode
    • exitFullscreen

      public static void exitFullscreen()
    • isFullscreen

      public static CompletableFuture<Boolean> isFullscreen()
      Checks if the current UI is in full screen mode.
      Returns:
      a CompletableFuture that resolves to true if the UI is in full screen mode, false otherwise
    • fullScreenAvailable

      public static CompletableFuture<Boolean> fullScreenAvailable()
      Checks if the full screen mode is currently available.
      Returns:
      a CompletableFuture that resolves to true if full screen mode is available, false otherwise
    • addFullscreenChangeListener

      public static com.vaadin.flow.shared.Registration addFullscreenChangeListener(com.vaadin.flow.component.ComponentEventListener<FullscreenChangeEvent> listener)