java.lang.Object
qupath.fx.dialogs.Dialogs.Builder
- Enclosing class:
- Dialogs
Builder class to create a custom
Dialog
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionalertType
(javafx.scene.control.Alert.AlertType type) Create a dialog styled as a specified alert type.javafx.scene.control.Dialog<javafx.scene.control.ButtonType>
build()
Build the dialog.Specify the buttons to display in the dialog.buttons
(javafx.scene.control.ButtonType... buttonTypes) Specify the buttons to display in the dialog.Create an confirmation alert dialog.content
(javafx.scene.Node content) Specify aNode
to display within the dialog.contentText
(String content) Specify the dialog content text.error()
Create an error alert dialog.expandableContent
(javafx.scene.Node content) Specify aNode
to display within the dialog as expandable content, not initially visible.headerText
(String header) Specify the dialog header text.height
(double height) Specify the dialog height.Create an information alert dialog.modality
(javafx.stage.Modality modality) Specify the modality of the dialog.nonModal()
Specify that the dialog should be non-modal.owner
(javafx.stage.Window owner) Specify the dialog owner.prefHeight
(double prefHeight) Specify the preferred height of the dialog pane.prefWidth
(double prefWidth) Specify the preferred width of the dialog pane.Make the dialog resizable (but default it is not).void
show()
Show the dialog.Optional<javafx.scene.control.ButtonType>
Show the dialog.size
(double width, double height) Specify the dialog height.Specify the dialog title.warning()
Create a warning alert dialog.width
(double width) Specify the dialog width.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
title
Specify the dialog title.- Parameters:
title
- dialog title- Returns:
- this builder
-
headerText
Specify the dialog header text. This is text that is displayed prominently within the dialog.- Parameters:
header
- dialog header- Returns:
- this builder
- See Also:
-
contentText
Specify the dialog content text. This is text that is displayed within the dialog.- Parameters:
content
- dialog content text- Returns:
- this builder
- See Also:
-
content
Specify aNode
to display within the dialog.- Parameters:
content
- dialog content- Returns:
- this builder
- See Also:
-
expandableContent
Specify aNode
to display within the dialog as expandable content, not initially visible.- Parameters:
content
- dialog expandable content- Returns:
- this builder
- See Also:
-
owner
Specify the dialog owner.- Parameters:
owner
- dialog title- Returns:
- this builder
-
resizable
Make the dialog resizable (but default it is not).- Returns:
- this builder
-
nonModal
Specify that the dialog should be non-modal. By default, most dialogs are modal (and therefore block clicks to other windows).- Returns:
- this builder
-
modality
Specify the modality of the dialog.- Parameters:
modality
- requested modality- Returns:
- this builder
-
alertType
Create a dialog styled as a specified alert type.- Parameters:
type
-- Returns:
- this builder
-
warning
Create a warning alert dialog.- Returns:
- this builder
-
error
Create an error alert dialog.- Returns:
- this builder
-
information
Create an information alert dialog.- Returns:
- this builder
-
confirmation
Create an confirmation alert dialog.- Returns:
- this builder
-
buttons
Specify the buttons to display in the dialog.- Parameters:
buttonTypes
- buttons to use- Returns:
- this builder
-
buttons
Specify the buttons to display in the dialog.- Parameters:
buttonNames
- names of buttons to use- Returns:
- this builder
-
width
Specify the dialog width.- Parameters:
width
- requested width- Returns:
- this builder
-
height
Specify the dialog height.- Parameters:
height
- requested height- Returns:
- this builder
-
prefWidth
Specify the preferred width of the dialog pane.- Parameters:
prefWidth
- preferred width- Returns:
- this builder
- Since:
- v0.4.0
-
prefHeight
Specify the preferred height of the dialog pane.- Parameters:
prefHeight
- preferred height- Returns:
- this builder
- Since:
- v0.4.0
-
size
Specify the dialog height.- Parameters:
width
- requested widthheight
- requested height- Returns:
- this builder
-
build
public javafx.scene.control.Dialog<javafx.scene.control.ButtonType> build()Build the dialog.- Returns:
- a
Dialog
created with the specified features.
-
show
public void show()Show the dialog. This is similar tobuild().show()
except that it will automatically be called on the JavaFX application thread even if called from another thread. -
showAndWait
Show the dialog. This is similar tobuild().showAndWait()
except that it will automatically be called on the JavaFX application thread even if called from another thread. Callers should be cautious that this does not result in deadlock (e.g. if called from the Swing Event Dispatch Thread on some platforms).- Returns:
-