Beispiel #1
0
 @Override
 protected void setVisibleImpl(final boolean visible) {
   if (!visible && warningWindow != null) {
     warningWindow.setVisible(false, false);
   }
   updateFocusableWindowState();
   super.setVisibleImpl(visible);
   // TODO: update graphicsConfig, see 4868278
   platformWindow.setVisible(visible);
   if (isSimpleWindow()) {
     KeyboardFocusManagerPeer kfmPeer = LWKeyboardFocusManagerPeer.getInstance();
     if (visible) {
       if (!getTarget().isAutoRequestFocus()) {
         return;
       } else {
         requestWindowFocus(CausedFocusEvent.Cause.ACTIVATION);
       }
       // Focus the owner in case this window is focused.
     } else if (kfmPeer.getCurrentFocusedWindow() == getTarget()) {
       // Transfer focus to the owner.
       LWWindowPeer owner = getOwnerFrameDialog(LWWindowPeer.this);
       if (owner != null) {
         owner.requestWindowFocus(CausedFocusEvent.Cause.ACTIVATION);
       }
     }
   }
 }
Beispiel #2
0
  public void updateSecurityWarningVisibility() {
    if (warningWindow == null) {
      return;
    }

    if (!isVisible()) {
      return; // The warning window should already be hidden.
    }

    boolean show = false;

    if (!platformWindow.isFullScreenMode()) {
      if (isVisible()) {
        if (LWKeyboardFocusManagerPeer.getInstance().getCurrentFocusedWindow() == getTarget()) {
          show = true;
        }

        if (platformWindow.isUnderMouse() || warningWindow.isUnderMouse()) {
          show = true;
        }
      }
    }

    warningWindow.setVisible(show, true);
  }