Package bayern.steinbrecher.wizard
Class WizardableController<T extends java.util.Optional<?>>
java.lang.Object
bayern.steinbrecher.wizard.WizardableController<T>
- Type Parameters:
T- The type of the result represented by this controller.
- Direct Known Subclasses:
SelectionController
public abstract class WizardableController<T extends java.util.Optional<?>>
extends java.lang.Object
Represents a controller of a
WizardableView.- Since:
- 1.2
- Author:
- Stefan Huber
-
Property Summary
-
Constructor Summary
Constructors Constructor Description WizardableController() -
Method Summary
Modifier and Type Method Description protected voidbindValidProperty(javafx.beans.value.ObservableValue<? extends java.lang.Boolean> binding)protected abstract TcalculateResult()Calculates the actual result if any.protected abstract java.util.Optional<java.util.ResourceBundle>getResourceBundle()Returns the resource bundle which contains the resources that the content of theWizardPagerequires.java.lang.StringgetResourceValue(java.lang.String key, java.lang.Object... params)Returns the value behindkeyof the resource bundle inserted params.java.util.List<java.lang.String>getResourceValues(java.lang.String key, java.util.List<java.lang.Object[]> params)Returns a list of values behindkeyof the resource bundle and with inserted params.TgetResult()Returns the current result that the content of the page represents.javafx.stage.StagegetStage()Returns the currently setStage.booleanhasUserAbborted()Checks whether the user aborted his input.booleanisValid()Gets the value of the property valid.voidsetStage(javafx.stage.Stage stage)Sets the stage the controller can refer to.javafx.beans.property.ObjectProperty<javafx.stage.Stage>stageProperty()Returns the property holding the currently setStage.javafx.beans.property.ReadOnlyBooleanPropertyvalidProperty()A property indicating whether all input handled by this controller is valid.
-
Property Details
-
valid
public javafx.beans.property.ReadOnlyBooleanProperty validPropertyA property indicating whether all input handled by this controller is valid.- See Also:
isValid()
-
stage
public javafx.beans.property.ObjectProperty<javafx.stage.Stage> stagePropertyReturns the property holding the currently setStage.- Returns:
- The property holding the currently set
Stage.
-
-
Constructor Details
-
WizardableController
public WizardableController()
-
-
Method Details
-
getResourceBundle
protected abstract java.util.Optional<java.util.ResourceBundle> getResourceBundle()Returns the resource bundle which contains the resources that the content of theWizardPagerequires.- Returns:
- The resource bundle which contains the resources that the content of the
WizardPagerequires. - Since:
- 1.12
-
getResourceValue
public java.lang.String getResourceValue(java.lang.String key, java.lang.Object... params)Returns the value behindkeyof the resource bundle inserted params.- Parameters:
key- The key to search for.params- The params to insert.- Returns:
- The value with inserted params.
- Since:
- 1.12
-
getResourceValues
public java.util.List<java.lang.String> getResourceValues(java.lang.String key, java.util.List<java.lang.Object[]> params)Returns a list of values behindkeyof the resource bundle and with inserted params.- Parameters:
key- The key to search for.params- The list of params to insert each in the value behindkey.- Returns:
- The list of values with inserted params.
- Since:
- 1.12
-
getResult
Returns the current result that the content of the page represents.- Returns:
- Iff the user aborted the wizard or the content of this page is invalid this method returns
Optional.empty(). Otherwise it returns the represented result.
-
calculateResult
Calculates the actual result if any. It does not recognize any criteria about whether to return a result or not. This is handled bygetResult().- Returns:
- The actual result if any.
- See Also:
getResult()
-
validProperty
public javafx.beans.property.ReadOnlyBooleanProperty validProperty()A property indicating whether all input handled by this controller is valid.- See Also:
isValid()
-
isValid
public boolean isValid()Gets the value of the property valid.- Property description:
- A property indicating whether all input handled by this controller is valid.
-
bindValidProperty
protected void bindValidProperty(javafx.beans.value.ObservableValue<? extends java.lang.Boolean> binding) -
stageProperty
public javafx.beans.property.ObjectProperty<javafx.stage.Stage> stageProperty()Returns the property holding the currently setStage.- Returns:
- The property holding the currently set
Stage.
-
setStage
public void setStage(javafx.stage.Stage stage)Sets the stage the controller can refer to. (E.g. for closing the stage) NOTE: It overridesWindow.onCloseRequest.- Parameters:
stage- The stage to refer to.
-
getStage
public javafx.stage.Stage getStage()Returns the currently setStage.- Returns:
- The currently set
Stage.
-
hasUserAbborted
public boolean hasUserAbborted()Checks whether the user aborted his input.- Returns:
trueonly if the user aborted his input explicitly.
-