Class Wizard

java.lang.Object
javafx.application.Application
bayern.steinbrecher.wizard.Wizard

public class Wizard
extends javafx.application.Application
Represents a wizard for showing a sequence of Panes. You can step back and forward on these Panes and only can close is on the last page.
You also can style it using CSS. Following CSS classes are available:
  • wizard
  • wizard-content
  • wizard-controls
Author:
Stefan Huber
  • Property Summary

    Properties 
    Type Property Description
    javafx.beans.property.ReadOnlyBooleanProperty atBeginning
    Property containing a boolean value representing whether the current page shown is the first one.
    javafx.beans.property.ReadOnlyBooleanProperty atFinish
    Property containing a boolean value representing whether the current page shown is a last one.
    javafx.beans.property.ReadOnlyProperty<WizardPage<?>> currentPage
    Returns the property holding the currently shown page.
    javafx.beans.property.ReadOnlyBooleanProperty finished
    Returns the property representing whether the wizard is finished.
  • Nested Class Summary

    Nested classes/interfaces inherited from class javafx.application.Application

    javafx.application.Application.Parameters
  • Field Summary

    Fields inherited from class javafx.application.Application

    STYLESHEET_CASPIAN, STYLESHEET_MODENA
  • Constructor Summary

    Constructors 
    Constructor Description
    Wizard​(java.util.Map<java.lang.String,​WizardPage<?>> pages)
    Constructs a wizard with showing pages and using default stylesheet.
  • Method Summary

    Modifier and Type Method Description
    javafx.beans.property.ReadOnlyBooleanProperty atBeginningProperty()
    Property containing a boolean value representing whether the current page shown is the first one.
    javafx.beans.property.ReadOnlyBooleanProperty atFinishProperty()
    Property containing a boolean value representing whether the current page shown is a last one.
    javafx.beans.property.ReadOnlyProperty<WizardPage<?>> currentPageProperty()
    Returns the property holding the currently shown page.
    javafx.beans.property.ReadOnlyBooleanProperty finishedProperty()
    Returns the property representing whether the wizard is finished.
    WizardPage<?> getCurrentPage()
    Returns the currently shown page.
    java.util.Optional<java.util.Map<java.lang.String,​?>> getResults()
    Returns the results of all pages visited in a sequence to an end.
    boolean isAtBeginning()
    Returns a boolean value representing whether the current page shown is the first one.
    boolean isAtFinish()
    Returns a boolean value representing whether the current page shown is a last one.
    boolean isFinished()
    Checks whether the wizard is finished.
    void put​(java.lang.String key, WizardPage<?> page)
    Adds the given page to the wizard and replaces pages with the same key but only if the page was not already visited.
    void start​(javafx.stage.Stage stage)
    Initializes the wizard.

    Methods inherited from class javafx.application.Application

    getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop

    Methods inherited from class java.lang.Object

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

    • finished

      public javafx.beans.property.ReadOnlyBooleanProperty finishedProperty
      Returns the property representing whether the wizard is finished. NOTE: It is not finished when it was closed without using the "finish" button.
      See Also:
      isFinished()
    • atBeginning

      public javafx.beans.property.ReadOnlyBooleanProperty atBeginningProperty
      Property containing a boolean value representing whether the current page shown is the first one.
      See Also:
      isAtBeginning()
    • atFinish

      public javafx.beans.property.ReadOnlyBooleanProperty atFinishProperty
      Property containing a boolean value representing whether the current page shown is a last one.
      See Also:
      isAtFinish()
    • currentPage

      public javafx.beans.property.ReadOnlyProperty<WizardPage<?>> currentPageProperty
      Returns the property holding the currently shown page.
      See Also:
      getCurrentPage()
  • Constructor Details

    • Wizard

      public Wizard​(java.util.Map<java.lang.String,​WizardPage<?>> pages)
      Constructs a wizard with showing pages and using default stylesheet.
      Parameters:
      pages - The pages to show.
  • Method Details

    • start

      public void start​(javafx.stage.Stage stage) throws java.io.IOException
      Initializes the wizard. The wizard is not shown yet. NOTE: Add your own stylesheets only after calling this method.
      Specified by:
      start in class javafx.application.Application
      Parameters:
      stage - The stage to be used by the wizard.
      Throws:
      java.io.IOException - May be thrown when loading the wizard.
      See Also:
      FXMLLoader.load()
    • put

      public void put​(java.lang.String key, WizardPage<?> page)
      Adds the given page to the wizard and replaces pages with the same key but only if the page was not already visited. This method can be used if a page of the wizard is depending on the result of a previous one. NOTE: The size of page is not considered anymore after start(...) was called.
      Parameters:
      key - The key the page is associated with.
      page - The page to add to the wizard.
    • finishedProperty

      public javafx.beans.property.ReadOnlyBooleanProperty finishedProperty()
      Returns the property representing whether the wizard is finished. NOTE: It is not finished when it was closed without using the "finish" button.
      See Also:
      isFinished()
    • isFinished

      public boolean isFinished()
      Checks whether the wizard is finished. NOTE: It is not finished when it was closed without using the "finish" button.
      Returns:
      true only if the wizard is finished.
    • getResults

      public java.util.Optional<java.util.Map<java.lang.String,​?>> getResults()
      Returns the results of all pages visited in a sequence to an end.
      Returns:
      Optional.empty() only if the wizard is not finished yet, otherwise the results of the visited pages.
      Throws:
      IllegalCallableException - Only thrown if thrown by one of the result functions of the visited pages.
    • atBeginningProperty

      public javafx.beans.property.ReadOnlyBooleanProperty atBeginningProperty()
      Property containing a boolean value representing whether the current page shown is the first one.
      See Also:
      isAtBeginning()
    • isAtBeginning

      public boolean isAtBeginning()
      Returns a boolean value representing whether the current page shown is the first one.
      Returns:
      true only if the current page is the first one.
    • atFinishProperty

      public javafx.beans.property.ReadOnlyBooleanProperty atFinishProperty()
      Property containing a boolean value representing whether the current page shown is a last one.
      See Also:
      isAtFinish()
    • isAtFinish

      public boolean isAtFinish()
      Returns a boolean value representing whether the current page shown is a last one.
      Returns:
      true only if the current page is a last one.
    • currentPageProperty

      public javafx.beans.property.ReadOnlyProperty<WizardPage<?>> currentPageProperty()
      Returns the property holding the currently shown page.
      See Also:
      getCurrentPage()
    • getCurrentPage

      public WizardPage<?> getCurrentPage()
      Returns the currently shown page.
      Returns:
      The currently shown page.