java.lang.Object
io.github.palexdev.materialfx.dialogs.MFXStageDialogBuilder
Builder class for
MFXStageDialogs with fluent api.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Event>
MFXStageDialogBuilderaddEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Delegate forWindow.addEventFilter(EventType, EventHandler).<T extends Event>
MFXStageDialogBuilderaddEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Delegate forWindow.addEventHandler(EventType, EventHandler).static MFXStageDialogBuilderbuild()Uses the no-arg constructor, starts from a newMFXStageDialog.static MFXStageDialogBuilderbuild(MFXStageDialog stageDialog) Uses theMFXStageDialogBuilder(MFXStageDialog)constructor, starts from the given dialog.get()initModality(Modality modality) Sets the dialog's modality.Sets the dialog's owner window.<T extends Event>
MFXStageDialogBuilderremoveEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Delegate forWindow.removeEventFilter(EventType, EventHandler).<T extends Event>
MFXStageDialogBuilderremoveEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Delegate forWindow.removeEventHandler(EventType, EventHandler).setAlwaysOnTop(boolean alwaysOnTop) Sets whether the dialog should stay always on top.setCenterInOwnerNode(boolean centerInOwnerNode) Sets whether the dialog should be centered on the owner node when shown.setContent(AbstractMFXDialog content) Sets the dialog's content.setDraggable(boolean draggable) Sets whether the dialog is draggable.setOnCloseRequest(EventHandler<WindowEvent> handler) Sets tha action to perform on a close request.setOnHidden(EventHandler<WindowEvent> handler) Sets tha action to perform on hidden.setOnHiding(EventHandler<WindowEvent> handler) Sets tha action to perform on hiding.setOnShowing(EventHandler<WindowEvent> handler) Sets tha action to perform on showing.setOnShown(EventHandler<WindowEvent> handler) Sets tha action to perform on shown.setOverlayClose(boolean overlayClose) Sets whether to close the dialog when pressing on its owner node.setOwnerNode(Pane ownerNode) Sets the dialog's owner node.setScrimOwner(boolean scrimOwner) Sets whether to scrim the dialog's owner node on showing.setScrimPriority(ScrimPriority scrimPriority) Sets the enum constant used to specify how to apply the scrim effect.setScrimStrength(double scrimStrength) Sets the scrim effect strength(opacity).Sets the dialog's title.
-
Constructor Details
-
MFXStageDialogBuilder
public MFXStageDialogBuilder() -
MFXStageDialogBuilder
-
-
Method Details
-
build
Uses the no-arg constructor, starts from a newMFXStageDialog. -
build
Uses theMFXStageDialogBuilder(MFXStageDialog)constructor, starts from the given dialog. -
setContent
Sets the dialog's content. -
setOwnerNode
Sets the dialog's owner node. -
setCenterInOwnerNode
Sets whether the dialog should be centered on the owner node when shown. -
setScrimOwner
Sets whether to scrim the dialog's owner node on showing. -
setScrimStrength
Sets the scrim effect strength(opacity). -
setScrimPriority
Sets the enum constant used to specify how to apply the scrim effect. You can have two owners, one is the stage owner(Window) and the other is the dialog owner(Pane). Sometimes it's better to apply the scrim to the window (for example the owner node would not allow to apply the scrim effect, for example AnchorPanes, VBoxes, HBoxes...), but you still want to center the dialog in the owner node. Setting this toScrimPriority.WINDOWwill tell the dialog to apply the effect to owner window, setting this toScrimPriority.NODEwill tell the dialog to apply the effect to owner node. -
setDraggable
Sets whether the dialog is draggable. -
setOverlayClose
Sets whether to close the dialog when pressing on its owner node. -
initModality
Sets the dialog's modality. -
initOwner
Sets the dialog's owner window. -
setTitle
Sets the dialog's title. -
setAlwaysOnTop
Sets whether the dialog should stay always on top. -
setOnCloseRequest
Sets tha action to perform on a close request. -
setOnShowing
Sets tha action to perform on showing. -
setOnShown
Sets tha action to perform on shown. -
setOnHiding
Sets tha action to perform on hiding. -
setOnHidden
Sets tha action to perform on hidden. -
addEventHandler
public <T extends Event> MFXStageDialogBuilder addEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Delegate forWindow.addEventHandler(EventType, EventHandler). -
removeEventHandler
public <T extends Event> MFXStageDialogBuilder removeEventHandler(EventType<T> eventType, EventHandler<? super T> eventHandler) Delegate forWindow.removeEventHandler(EventType, EventHandler). -
addEventFilter
public <T extends Event> MFXStageDialogBuilder addEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Delegate forWindow.addEventFilter(EventType, EventHandler). -
removeEventFilter
public <T extends Event> MFXStageDialogBuilder removeEventFilter(EventType<T> eventType, EventHandler<? super T> eventFilter) Delegate forWindow.removeEventFilter(EventType, EventHandler). -
get
- Returns:
- the built stage dialog
-