Package org.fulib.fx.constructs
Class Modals.ModalBuilder<T extends javafx.scene.Parent>
java.lang.Object
org.fulib.fx.constructs.Modals.ModalBuilder<T>
- Type Parameters:
T- The type of the component
- Enclosing class:
- Modals
Builder class for displaying modals.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.stage.Stagebuild()Builds the stage for the current modal.destroyOnClose(boolean destroyOnClose) dialog(boolean dialog) Adds a pre-made initializer with some default options regarding transparency and modality.init(BiConsumer<javafx.stage.Stage, T> initializer) Adds an initializer.owner(javafx.stage.Stage owner) Sets the owner stage.Sets the parameters to be used when initializing/rendering the component.javafx.stage.Stageshow()Builds and displays the stage for the current modal.
-
Constructor Details
-
ModalBuilder
-
-
Method Details
-
init
Adds an initializer.If another initializer has been added already, the new initializer will be called after the previous one.
- Parameters:
initializer- The initializer to add- Returns:
- The current modal instance
-
owner
Sets the owner stage.If the owner stage is closed, the modal will be closed as well.
If no owner is set, the
FulibFxApp.stage()will be used.- Parameters:
owner- The owner stage.- Returns:
- The current modal instance
-
dialog
Adds a pre-made initializer with some default options regarding transparency and modality.This will set the stage style to
StageStyle.TRANSPARENT, the modality toModality.WINDOW_MODALand the scene fill to transparent (seeFULIBFX_DIALOG).- Parameters:
dialog- Whether the default dialog options should be used- Returns:
- The current modal instance
-
params
Sets the parameters to be used when initializing/rendering the component.The default parameters "modalStage" and "ownerStage" will be added automatically if they are not present already. The modal stage is the current modal stage and the owner stage is the stage that opened the modal (see
owner(Stage)).- Parameters:
params- The parameter map- Returns:
- The current modal instance
-
destroyOnClose
-
build
public javafx.stage.Stage build()Builds the stage for the current modal.This can only be called once per modal builder.
- Returns:
- The stage for the current modal
-
show
public javafx.stage.Stage show()Builds and displays the stage for the current modal.This can only be called once per modal builder.
- Returns:
- The stage for the current modal
-