R - The dialog's result type.public abstract class DialogController<R> extends FXMLController<javafx.scene.control.Dialog<R>>
Dialog based windows.FXMLController| Constructor and Description |
|---|
DialogController() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addButtonEventFilter(javafx.scene.control.ButtonType buttonType,
javafx.event.EventHandler<? super javafx.event.ActionEvent> filter)
Register a button event filter.
|
protected javafx.stage.Modality |
getModality()
This function is called during dialog initialization to initialize the dialog's modality.
|
protected javafx.stage.StageStyle |
getStyle()
This function is called during dialog initialization to initialize the dialog's style.
|
javafx.stage.Window |
getWindow()
Get the UI window.
|
static <R,C extends DialogController<R>> |
loadDialog(javafx.stage.Window owner,
java.util.function.Function<C,javafx.scene.control.Dialog<R>> dialogFactory,
java.lang.Class<C> controllerClass)
Load and create new dialog.
|
protected javafx.scene.Node |
lookupButton(javafx.scene.control.ButtonType buttonType)
Lookup a dialog button.
|
protected void |
setupDialog(javafx.scene.control.Dialog<R> dialog)
This function is called during dialog initialization to perform the actual dialog setup.
|
protected void |
setupUI(javafx.stage.Window owner,
javafx.scene.control.Dialog<R> dialog,
javafx.scene.Parent fxmlRoot)
This function is called during UI initialization to perform the actual UI setup.
|
void |
show()
Show the controller's dialog and return.
|
java.util.Optional<R> |
showAndWait()
Show the controller's dialog and wait until it is closed.
|
getResources, getUI, loadUIpublic static <R,C extends DialogController<R>> C loadDialog(javafx.stage.Window owner, java.util.function.Function<C,javafx.scene.control.Dialog<R>> dialogFactory, java.lang.Class<C> controllerClass) throws java.io.IOException
R - The dialog's result type.C - The actual DialogController type.owner - The dialog's owner (may be null).dialogFactory - The factory function used to create the actual dialog object by invoking it with the
constructed controller.controllerClass - The controller class to use.java.io.IOException - if an I/O error occurs during dialog loading.public final javafx.stage.Window getWindow()
FXMLControllergetWindow in class FXMLController<javafx.scene.control.Dialog<R>>protected void setupUI(@Nullable
javafx.stage.Window owner,
javafx.scene.control.Dialog<R> dialog,
javafx.scene.Parent fxmlRoot)
FXMLControllersetupUI in class FXMLController<javafx.scene.control.Dialog<R>>owner - The UI object's owner (may by null).dialog - The constructed UI object.fxmlRoot - The scene's root node as defined by the FXML resource.protected javafx.stage.StageStyle getStyle()
The default style is StageStyle.DECORATED.
StageStyleprotected javafx.stage.Modality getModality()
The default modality is Modality.WINDOW_MODAL.
Modalityprotected void setupDialog(javafx.scene.control.Dialog<R> dialog)
dialog - The dialog to setup.protected final javafx.scene.Node lookupButton(javafx.scene.control.ButtonType buttonType)
buttonType - The button type to look up.null if the button type has not been created.DialogPane.lookupButton(ButtonType)protected final void addButtonEventFilter(javafx.scene.control.ButtonType buttonType,
javafx.event.EventHandler<? super javafx.event.ActionEvent> filter)
buttonType - The button type to register the filter for.filter - The filter to register.public void show()
Dialog.show()public java.util.Optional<R> showAndWait()
Dialog.showAndWait()