public class WindowMonitor extends Object
Window
s (showing, hidden, closed).Modifier and Type | Method and Description |
---|---|
Collection<EventQueue> |
allEventQueues() |
EventQueue |
eventQueueFor(Component c)
Returns the event queue corresponding to the given AWT or Swing
Compoenent . |
static WindowMonitor |
instance() |
boolean |
isWindowReady(Window w)
Returns whether the AWT or Swing
Window is ready to receive OS-level event input. |
Collection<Window> |
rootWindows()
Return all available root
Window s. |
public boolean isWindowReady(@Nonnull Window w)
Window
is ready to receive OS-level event input. A Window
's
"isShowing" flag may be set true
before the WINDOW_OPENED
event is generated, and even after the
WINDOW_OPENED
event is sent, the Window
peer is not guaranteed to be ready.w
- the given Window
.Window
is ready to receive OS-level event input.@Nullable public EventQueue eventQueueFor(@Nonnull Component c)
Compoenent
. In most cases, this is the same
as Component.getToolkit().getSystemEventQueue()
, but in the case of applets will bypass the
AppContext
and provide the real event queue.c
- the given Component
.@Nonnull public Collection<EventQueue> allEventQueues()
@Nonnull public Collection<Window> rootWindows()
Window
s. A root Window
is one that has a null
parent. Nominally
this means a list similar to that returned by Frame.getFrames()
, but in the case of an Applet
may
return a few dialogs as well.Window
s.@RunsInEDT @Nonnull public static WindowMonitor instance()
Copyright © 2014–2019 AssertJ. All rights reserved.