public class Windows
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.beans.PropertyChangeListener |
focusListener |
private static java.lang.ref.Reference<java.awt.Window> |
lastFocusedWindow |
private static java.lang.ref.Reference<java.awt.KeyboardFocusManager> |
lastFocusManager |
private static java.lang.String |
PROPERTY_FOCUSED_WINDOW |
| Modifier | Constructor and Description |
|---|---|
private |
Windows() |
| Modifier and Type | Method and Description |
|---|---|
private static java.awt.Window |
findFirstShowingWindow(java.awt.Window w)
Search the containment hierarchy updwards for the first showing
window.
|
private static java.awt.Window |
getAnyShowingWindow() |
private static java.awt.Window |
getAnyShowingWindow(java.awt.Window[] windows) |
static java.awt.Window |
getLastFocusedWindow()
Returns the last window which received the focus.
|
static java.awt.Window |
getParentWindow()
Returns a suitable parent window, which is the last explicitly set
and still showing parent window or any of its showing parent windows,
the last focused and still showing window or any of its showing parent
windows or any other showing window - whichever is found first.
|
private static void |
observeFocusedWindow()
Ensures that the focused window managed by the current keyboard focus
manager is observed.
|
private static void |
setLastFocusedWindow(java.awt.Window w) |
private static void |
setLastFocusedWindow0(java.awt.Window w) |
private static final java.lang.String PROPERTY_FOCUSED_WINDOW
private static java.lang.ref.Reference<java.awt.KeyboardFocusManager> lastFocusManager
private static java.lang.ref.Reference<java.awt.Window> lastFocusedWindow
private static java.beans.PropertyChangeListener focusListener
public static java.awt.Window getParentWindow()
JOptionPane's root frame is
returned.private static java.awt.Window findFirstShowingWindow(java.awt.Window w)
public static java.awt.Window getLastFocusedWindow()
null is returned instead.
Note that this is not the same as
Windows.getCurrentKeyboardFocusManager().getFocusedWindow():
The latter may return null if no window in this JVM has
the focus, while this method will return the last window in this JVM
which had the focus (unless this is also the first call to this method).private static void observeFocusedWindow()
private static void setLastFocusedWindow(java.awt.Window w)
private static void setLastFocusedWindow0(java.awt.Window w)
private static java.awt.Window getAnyShowingWindow()
private static java.awt.Window getAnyShowingWindow(java.awt.Window[] windows)
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.