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> booleanisWindowSupported(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.CompletionStage<Window>register(WindowHandle<?> handle, Consumer<WindowOptions.Builder<?>> options)Register a window with specified handle and window 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:
trueif specified window is supported and handle can be obtained,falseotherwise
-
getWindowHandle
Get a window handle for specified window object.This method should be called only if
isWindowSupported(Object)returnstrue. OtherwiseWindowManagerExceptionis 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
handlecan obtained viagetWindowHandle(Object). Registrationoptionsare used to specify things like title, placement, etc. Though this method (andregister(WindowHandle)) return aCompletableFutureimplementations will usually be synchronous.- Parameters:
handle- handle of the window to register (usually obtained viagetWindowHandle(Object))options- window registration options callback- Returns:
- stage that will complete when window registration is done
-
list
Returns a list of available windows.- Returns:
- list of
Window
-
register
Register a window with specified handle using default window options.- Parameters:
handle- handle of the window to register (usually obtained viagetWindowHandle(Object))- Returns:
- stage that will complete when window registration is done
-