Package com.tick42.glue.desktop.windows

# Interface WindowManager

    public interface WindowManager

Window management.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `<W> WindowHandle<W>` | `getWindowHandle​(W window)` | Get a window handle for specified window object.
  `<W> boolean` | `isWindowSupported​(W window)` | Checks if this window manager may find the handle of the specified window.
  `List<Window>` | `list()` | Returns a list of available windows.
  `default CompletionStage<Window>` | `register​(WindowHandle<?> handle)` | Register a window with specified handle using default window options.
  `default CompletionStage<Window>` | `register​(WindowHandle<?> handle, Consumer<WindowOptions.Builder<?>> options)` | Register a window with specified handle and window options.
  `default CompletionStage<Window>` | `register​(WindowRegistration request)` |
  `CompletionStage<Window>` | `register​(WindowRegistration request, Consumer<WindowOptions.Builder<?>> options)` |
  `default <W> CompletionStage<Window>` | `register​(W window, Consumer<WindowRegistration.Builder> request, Consumer<WindowOptions.Builder<?>> options)` |

- ## 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

    default 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

  - ### register

    CompletionStage<Window> register​(WindowRegistration request, Consumer<WindowOptions.Builder<?>> options)
    Since:
      1.4.2

  - ### register

    default CompletionStage<Window> register​(WindowRegistration request)
    Since:
      1.4.2

  - ### register

    default <W> CompletionStage<Window> register​(W window, Consumer<WindowRegistration.Builder> request, Consumer<WindowOptions.Builder<?>> options)
    Since:
      1.4.2