Class EmbeddedWizardPage<T extends java.util.Optional<?>>

java.lang.Object
bayern.steinbrecher.wizard.EmbeddedWizardPage<T>
Type Parameters:
T - The return type of the result represented by the page.

public final class EmbeddedWizardPage<T extends java.util.Optional<?>>
extends java.lang.Object
Represents a page of the wizard.
Since:
1.0
Author:
Stefan Huber
  • Property Summary

    Properties 
    Type Property Description
    @NotNull javafx.beans.property.ReadOnlyBooleanProperty hasNextFunction
    Returns the property holding true only if this page has a nextFunction.
    @NotNull javafx.beans.property.ReadOnlyProperty<java.util.function.Supplier<java.lang.String>> nextFunction
    The property containing the function calculating which page to show next.
    @NotNull javafx.beans.property.ReadOnlyBooleanProperty valid
    Returns the property representing whether this page has valid input.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String FIRST_PAGE_KEY
    The key of the page to be used as first one.
  • Method Summary

    Modifier and Type Method Description
    @Nullable java.util.function.Supplier<java.lang.String> getNextFunction()
    Returns the function calculating the key of the next page.
    T getResult()  
    @NotNull javafx.scene.Parent getRoot()
    Returns the pane containing all controls.
    @NotNull javafx.beans.property.ReadOnlyBooleanProperty hasNextFunctionProperty()
    Returns the property holding true only if this page has a nextFunction.
    boolean isFinish()
    Returns whether this page is a last one.
    boolean isHasNextFunction()
    Checks whether this page has a nextFunction.
    boolean isValid()
    Returns whether the current input of this page is valid.
    @NotNull javafx.beans.property.ReadOnlyProperty<java.util.function.Supplier<java.lang.String>> nextFunctionProperty()
    The property containing the function calculating which page to show next.
    <R extends java.util.Optional<?>,​ C extends WizardPageController<R>>
    java.util.concurrent.CompletableFuture<EmbeddedWizardPage<R>>
    setFinishAndDynamicNext​(boolean finish, @Nullable java.util.function.Supplier<WizardPage<R,​C>> dynamicNextFunction, @NotNull java.lang.String pageID)
    This method allows to use the result of one WizardPage as the input for another WizardPage.
    void setFinishAndNext​(boolean finish, @Nullable java.util.function.Supplier<java.lang.String> nextFunction)  
    @NotNull javafx.beans.property.ReadOnlyBooleanProperty validProperty()
    Returns the property representing whether this page has valid input.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Property Details

    • nextFunction

      @NotNull public @NotNull javafx.beans.property.ReadOnlyProperty<java.util.function.Supplier<java.lang.String>> nextFunctionProperty
      The property containing the function calculating which page to show next.
      See Also:
      getNextFunction()
    • valid

      @NotNull public @NotNull javafx.beans.property.ReadOnlyBooleanProperty validProperty
      Returns the property representing whether this page has valid input.
      See Also:
      isValid()
    • hasNextFunction

      @NotNull public @NotNull javafx.beans.property.ReadOnlyBooleanProperty hasNextFunctionProperty
      Returns the property holding true only if this page has a nextFunction.
      See Also:
      isHasNextFunction()
  • Field Details

  • Method Details

    • getRoot

      @NotNull public @NotNull javafx.scene.Parent getRoot()
      Returns the pane containing all controls.
      Returns:
      The pane containing all controls.
    • nextFunctionProperty

      @NotNull public @NotNull javafx.beans.property.ReadOnlyProperty<java.util.function.Supplier<java.lang.String>> nextFunctionProperty()
      The property containing the function calculating which page to show next.
      See Also:
      getNextFunction()
    • getNextFunction

      @Nullable public @Nullable java.util.function.Supplier<java.lang.String> getNextFunction()
      Returns the function calculating the key of the next page.
      Returns:
      The function calculating the key of the next page. Returns null if this page has no next one.
    • isFinish

      public boolean isFinish()
      Returns whether this page is a last one.
      Returns:
      true only if this page is a last one.
    • setFinishAndNext

      public void setFinishAndNext​(boolean finish, @Nullable @Nullable java.util.function.Supplier<java.lang.String> nextFunction)
    • setFinishAndDynamicNext

      public <R extends java.util.Optional<?>,​ C extends WizardPageController<R>> java.util.concurrent.CompletableFuture<EmbeddedWizardPage<R>> setFinishAndDynamicNext​(boolean finish, @Nullable @Nullable java.util.function.Supplier<WizardPage<R,​C>> dynamicNextFunction, @NotNull @NotNull java.lang.String pageID)
      This method allows to use the result of one WizardPage as the input for another WizardPage. However, if there are multiple WizardPages that depend on previous WizardPages then using this method results in heavily nested and thus hard to read source code. Instead if a WizardPage depends on input of other WizardPages its constructor should offer constructors that have parameters of type Future only. This allows to avoid this method entirely.
      Returns:
      A CompletableFuture object which contains the dynamically generated next page as soon as the Wizard this page belongs to tries to access its next page.
      Since:
      1.27
      See Also:
      setFinishAndNext(boolean, Supplier)
    • getResult

      public T getResult()
    • validProperty

      @NotNull public @NotNull javafx.beans.property.ReadOnlyBooleanProperty validProperty()
      Returns the property representing whether this page has valid input.
      See Also:
      isValid()
    • isValid

      public boolean isValid()
      Returns whether the current input of this page is valid.
      Returns:
      true only if the current input of this page is valid.
    • hasNextFunctionProperty

      @NotNull public @NotNull javafx.beans.property.ReadOnlyBooleanProperty hasNextFunctionProperty()
      Returns the property holding true only if this page has a nextFunction.
      See Also:
      isHasNextFunction()
    • isHasNextFunction

      public boolean isHasNextFunction()
      Checks whether this page has a nextFunction.
      Returns:
      Returns true only if this page has a nextFunction.
      See Also:
      nextFunctionProperty()