A helper for crating custom dialogs. Particularly suited for creation of input dialogs.
There are 3 steps to using a dialog:
- Creation, where elements of the dialog are appended vertically using
add*(...)methods, for instance,addStringField(label, defaultText) - User interaction, dialog is displayed using
showDialog()method - Reading of input, once the dialog is closed, dialog content can be read using
next*()methods. Content is read in the order it is added.
Here is en example:
val dialog =
new GenericDialogFX(
title = "GenericDialogFX Demo",
"Fancy description can go here."
) {
addCheckbox("Check me out!", defaultValue = false)
addCheckbox("Check me too!", defaultValue = true)
}
dialog.showDialog()
if (dialog.wasOKed) {
val select1 = dialog.nextBoolean()
val select2 = dialog.nextBoolean()
println(s"Selection 1: $select1")
println(s"Selection 2: $select2")
}
Value parameters
- header
-
dialog header
- lastDirectoryHandler
-
customize how directory selections are remembered between uses of the dialog. Used with
addDirectoryFieldandaddFileField. - ownerWindow
-
optional owner window that will be blocked when this dialog is displayed.
- title
-
dialogs title
Attributes
- See also
-
GenericPane
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Adds a "Help" button that opens the specified URL in the default browser.
Adds a "Help" button that opens the specified URL in the default browser.
Value parameters
- url
-
the URL to open in the default browser
Attributes
Display the dialog and block till the dialog is closed
Display the dialog and block till the dialog is closed
Attributes
true if the dialog was closed by cancelling
true if the dialog was closed by cancelling
Attributes
Inherited methods
Adds a checkbox.
Adds a checkbox.
Value parameters
- defaultValue
-
the initial state
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Adds a choice list.
Adds a choice list.
Value parameters
- defaultItem
-
the initial item, must be equal to one of the
items - items
-
items on the list
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Attributes
- Inherited from:
- GenericPaneBase
Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.
Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.
Value parameters
- columns
-
width of the text field
- defaultPath
-
initial path
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.
Adds a directory text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the directory path.
Value parameters
- defaultPath
-
initial path
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Adds a file text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the file path.
Adds a file text field and "Browse" button, where the field width is determined by the length of 'defaultPath', with a minimum of 25 columns. Use nextString to retrieve the file path.
Value parameters
- columns
-
width of the text field
- defaultPath
-
initial path
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Adds a message consisting of one or more lines of text.
Adds a message consisting of one or more lines of text.
That message cannot be edited, cannot be edited with a next*()
Value parameters
- font
-
Optional font used to render the message
- message
-
message
Attributes
- Inherited from:
- GenericPaneBase
Adds a message consisting of one or more lines of text.
Adds a message consisting of one or more lines of text.
That message cannot be edited, cannot be edited with a next*()
Value parameters
- font
-
font used to render the message
- message
-
message
Attributes
- Inherited from:
- GenericPaneBase
Add a custom node
Add a custom node
Value parameters
- label
-
the label
- node
-
custom node. It is not included in
next*()readouts, needs to be handled by the creator
Attributes
- Inherited from:
- GenericPaneBase
Add a custom node that will occupy a whole row
Add a numeric field.
Add a numeric field.
Value parameters
- columnWidth
-
number of columns used to display the number
- decimalPlaces
-
number of decimal places to display
- defaultValue
-
the initial value
- label
-
the label
- units
-
text displayed after the number
Attributes
- Inherited from:
- GenericPaneBase
Add a numeric field.
Add a numeric field.
Value parameters
- defaultValue
-
the initial value
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Adds a text field.
Adds a text field.
Value parameters
- columns
-
width of the text field
- defaultText
-
text initially displayed
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Adds an 8 column text field.
Adds an 8 column text field.
Value parameters
- defaultText
-
the text initially displayed
- label
-
the label
Attributes
- Inherited from:
- GenericPaneBase
Returns the state of the next checkbox
Attributes
- Inherited from:
- GenericPaneBase
Returns the value of the next number
Returns the value of the next string
Attributes
- Inherited from:
- GenericPaneBase
Attributes
- Inherited from:
- GenericPaneBase
Attributes
- Inherited from:
- GenericPaneBase
Attributes
- Inherited from:
- GenericPaneBase
Concrete fields
Customize how directory selections are remembered between uses of the dialog. Used with addDirectoryField and addFileField
Customize how directory selections are remembered between uses of the dialog. Used with addDirectoryField and addFileField