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
You also can style it using CSS. Following CSS classes are available:
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
- Since:
- 1.0
- Author:
- Stefan Huber
-
Property Summary
Properties Type Property Description javafx.beans.property.ReadOnlyBooleanPropertyatBeginningProperty containing a boolean value representing whether the current page shown is the first one.javafx.beans.property.ReadOnlyBooleanPropertyatFinishProperty containing a boolean value representing whether the current page shown is a last one.javafx.beans.property.ReadOnlyProperty<WizardPage<?>>currentPageReturns the property holding the currently shown page.javafx.beans.property.ReadOnlyBooleanPropertyfinishedReturns the property representing whether the wizard is finished. -
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Wizard(java.util.Map<java.lang.String,WizardPage<?>> pages)Constructs a wizard with showingpagesand using default stylesheet. -
Method Summary
Modifier and Type Method Description javafx.beans.property.ReadOnlyBooleanPropertyatBeginningProperty()Property containing a boolean value representing whether the current page shown is the first one.javafx.beans.property.ReadOnlyBooleanPropertyatFinishProperty()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.ReadOnlyBooleanPropertyfinishedProperty()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.booleanisAtBeginning()Returns a boolean value representing whether the current page shown is the first one.booleanisAtFinish()Returns a boolean value representing whether the current page shown is a last one.booleanisFinished()Checks whether the wizard is finished.voidput(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.voidstart(javafx.stage.Stage stage)Initializes the wizard.
-
Property Details
-
finished
public javafx.beans.property.ReadOnlyBooleanProperty finishedPropertyReturns 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 atBeginningPropertyProperty containing a boolean value representing whether the current page shown is the first one.- See Also:
isAtBeginning()
-
atFinish
public javafx.beans.property.ReadOnlyBooleanProperty atFinishPropertyProperty containing a boolean value representing whether the current page shown is a last one.- See Also:
isAtFinish()
-
currentPage
Returns the property holding the currently shown page.- See Also:
getCurrentPage()
-
-
Constructor Details
-
Wizard
Constructs a wizard with showingpagesand using default stylesheet.- Parameters:
pages- The pages to show.
-
-
Method Details
-
start
public void start(javafx.stage.Stage stage) throws java.io.IOExceptionInitializes the wizard. The wizard is not shown yet. NOTE: Add your own stylesheets only after calling this method.- Specified by:
startin classjavafx.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
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 ofpageis not considered anymore afterstart(...)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:
trueonly 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:
trueonly 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:
trueonly if the current page is a last one.
-
currentPageProperty
Returns the property holding the currently shown page.- See Also:
getCurrentPage()
-
getCurrentPage
Returns the currently shown page.- Returns:
- The currently shown page.
-