Interface WindowManager

All Known Implementing Classes:
HeadlessWindowManager, InteropWindowManager, StickyWindowManager

public interface WindowManager
Window management.
  • Method Details

    • isWindowSupported

      <W> boolean isWindowSupported​(W window)
      Checks if this window manager may find the handle of the specified window.
      Type Parameters:
      W - the type of the window
      Parameters:
      window - the window to check for
      Returns:
      true if specified window is supported and handle can be obtained, false otherwise
    • getWindowHandle

      <W> WindowHandle<W> getWindowHandle​(W window)
      Get a window handle for specified window object.

      This method should be called only if isWindowSupported(Object) returns true. Otherwise WindowManagerException is thrown.

      Type Parameters:
      W - type of the window
      Parameters:
      window - window object to extract handle from
      Returns:
      window handle, not null
      Throws:
      WindowManagerException - if provided window is of unsupported type (i.e. isWindowSupported(Object) returned false)
    • register

      CompletionStage<Window> register​(WindowHandle<?> handle, Consumer<WindowOptions.Builder<?>> options)
      Register a window with specified handle and window options.

      The handle can obtained via getWindowHandle(Object). Registration options are used to specify things like title, placement, etc. Though this method (and register(WindowHandle)) return a CompletableFuture implementations will usually be synchronous.

      Parameters:
      handle - handle of the window to register (usually obtained via getWindowHandle(Object))
      options - window registration options callback
      Returns:
      stage that will complete when window registration is done
    • list

      List<Window> list()
      Returns a list of available windows.
      Returns:
      list of Window
    • register

      default CompletionStage<Window> register​(WindowHandle<?> handle)
      Register a window with specified handle using default window options.

      See register(WindowHandle, Consumer).

      Parameters:
      handle - handle of the window to register (usually obtained via getWindowHandle(Object))
      Returns:
      stage that will complete when window registration is done