Beispiel #1
0
 /*
  * 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);
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 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;
 }
Beispiel #5
0
 @Override
 public void notifyActivation(boolean activation, LWWindowPeer opposite) {
   Window oppositeWindow = (opposite == null) ? null : opposite.getTarget();
   changeFocusedWindow(activation, oppositeWindow);
 }