public static void enterModal(@NotNull Object modalEntity) {
    ModalityStateEx state = getCurrentModalityState().appendEntity(modalEntity);
    if (isModalDialog(modalEntity)) {
      ModalityStateEx current = state;
      state = modalityStateForWindow((Window)modalEntity);
      state.forceModalEntities(current);
    }
    enterModal(modalEntity, state);
  }
public static void enterModal(@NotNull Object modalEntity)