final void executeInModalContext(@NotNull Runnable modalAction) {
    if (!isModalEntity()) {
      modalAction.run();
      return;
    }

    if (myModalityEntered) {
      throw new IllegalStateException("Modality already entered: " + getModalityState());
    }
    LaterInvocator.enterModal(this, (ModalityStateEx)getModalityState());
    myModalityEntered = true;
    try {
      modalAction.run();
    }
    finally {
      LaterInvocator.leaveModal(this);
    }
  }
final void executeInModalContext(@NotNull Runnable modalAction)