private void hideAndDispose(boolean ok, boolean force) {
    if (isDisposed) {
      if (force) {
        disposeAnimationAndRemoveComponent();
      }
      return;
    }

    if (isSmartFadeoutPaused) {
      isSmartFadeoutPaused = false;
      return;
    }

    isDisposed = true;
    hideComboBoxPopups();

    Runnable disposeRunnable = () -> {
      myFadedOut = true;
      if (myRequestFocus) {
        if (myOriginalFocusOwner != null) {
          myFocusManager.requestFocus(myOriginalFocusOwner, false);
        }
      }

      for (JBPopupListener each : myListeners) {
        each.onClosed(new LightweightWindowEvent(this, ok));
      }

      Disposer.dispose(this);
      onDisposed();
    };

    Toolkit.getDefaultToolkit().removeAWTEventListener(myAwtActivityListener);
    if (myLayeredPane == null) {
      disposeRunnable.run();
    }
    else {
      myLayeredPane.removeComponentListener(myComponentListener);

      if (isAnimationEnabled()) {
        runAnimation(false, myLayeredPane, disposeRunnable);
      }
      else {
        disposeAnimationAndRemoveComponent();
        disposeRunnable.run();
      }
    }

    myVisible = false;
    myTracker = null;
  }
private void hideAndDispose(boolean ok, boolean force)