예제 #1
0
  private void hideFinishingPage() {
    finishingPage.setVisible(false);
    getChildren().remove(finishingPage);
    getChildren().add(0, finishingPage);

    final WizardPage currentPage = getCurrentPage();
    if (currentPage != null) currentPage.setVisible(true);
  }
예제 #2
0
  public void registerWizardPage(final WizardPage wizardPage) {
    assertNotNull("wizardPage", wizardPage);

    if (wizardPage.getWizard() != null) wizardPage.setWizard(this);

    if (knownPages.containsKey(wizardPage)) return;

    wizardPage.completeProperty().addListener(updateCanFinishInvalidationListener);
    knownPages.put(wizardPage, null);
    wizardPage.setVisible(false);
    getChildren().add(0, wizardPage);
  }
예제 #3
0
  protected void navTo(final WizardPage wizardPage, boolean addToHistory) {
    assertNotNull("wizardPage", wizardPage);
    PlatformUtil.assertFxApplicationThread();

    {
      WizardPage currentPage = getCurrentPage();
      if (currentPage != null) currentPage.onHidden();

      if (currentPage != null && addToHistory) history.addLast(currentPage);
    }

    setCurrentPage(wizardPage);
    for (Node child : getChildren()) child.setVisible(false);

    wizardPage.setVisible(true);
    getChildren().remove(wizardPage); // remove from z-order wherever it is (it might be missing!).
    getChildren().add(wizardPage); // re-add as last, which means top-most z-order.

    wizardPage.updateButtonsDisable();
    updateCanFinish();

    if (getParent() != null) getParent().requestFocus();

    this.requestFocus();
    wizardPage.requestFocus();

    Platform.runLater(
        new Runnable() {
          @Override
          public void run() {
            final Scene scene = getScene();
            final Window window = scene == null ? null : scene.getWindow();
            if (window != null) window.sizeToScene();

            if (getParent() != null) getParent().requestFocus();

            Wizard.this.requestFocus();
            wizardPage.requestFocus();
            wizardPage.onShown();
          }
        });
  }