/* * Retrieves the owner of the peer. * Note: this method returns the owner which can be activated, (i.e. the instance * of Frame or Dialog may be returned). */ static LWWindowPeer getOwnerFrameDialog(LWWindowPeer peer) { Window owner = (peer != null ? peer.getTarget().getOwner() : null); while (owner != null && !(owner instanceof Frame || owner instanceof Dialog)) { owner = owner.getOwner(); } return owner == null ? null : (LWWindowPeer) AWTAccessor.getComponentAccessor().getPeer(owner); }
static LWWindowPeer getOwnerFrameDialog(LWWindowPeer peer) { Window owner = (peer != null ? peer.getTarget().getOwner() : null); while (owner != null && !(owner instanceof Frame || owner instanceof Dialog)) { owner = owner.getOwner(); } return owner != null ? (LWWindowPeer) owner.getPeer() : null; }
private boolean isOneOfOwnersOf(LWWindowPeer peer) { Window owner = (peer != null ? peer.getTarget().getOwner() : null); while (owner != null) { if ((LWWindowPeer) owner.getPeer() == this) { return true; } owner = owner.getOwner(); } return false; }
private boolean isFocusableWindow() { boolean focusable = getTarget().isFocusableWindow(); if (isSimpleWindow()) { LWWindowPeer ownerPeer = getOwnerFrameDialog(this); if (ownerPeer == null) { return false; } return focusable && ownerPeer.getTarget().isFocusableWindow(); } return focusable; }
@Override public void notifyActivation(boolean activation, LWWindowPeer opposite) { Window oppositeWindow = (opposite == null) ? null : opposite.getTarget(); changeFocusedWindow(activation, oppositeWindow); }