code: public void showViewAndWait(Window window, Modality modality) {
          if (isPrimaryStageView) {
              showView(modality); // this modality will be ignored anyway
              return;
          }
          if (stage == null || currentStageModality != modality || !Objects.equals(stage.getOwner(), window)) {
              stage = createStage(modality);
              stage.initOwner(window);
          }
          stage.showAndWait();
      }
docs: Shows the FxmlView instance being the child stage of the given {@link Window} and waits
  to be closed before returning to the caller.
  
  @param window
  The owner of the FxmlView instance
  @param modality
  See {@code javafx.stage.Modality}.