Packages

class GenericDialogFX extends GenericPaneBase

A helper for crating custom dialogs. Particularly suited for creation of input dialogs.

There are 3 steps to using a dialog: 1. Creation, where elements of the dialog are appended vertically using add*(...) methods, for instance, addStringField(label, defaultText) 2. User interaction, dialog is displayed using showDialog() method 3. 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")
}
Source
GenericDialogFX.scala
See also

GenericPane

Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. GenericDialogFX
  2. GenericPaneBase
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new GenericDialogFX(title: String, header: String = "", ownerWindow: Option[Window] = None, lastDirectoryHandler: LastDirectoryHandler = new DefaultLastDirectoryHandler())

    title

    dialogs title

    header

    dialog header

    ownerWindow

    optional owner window that will be blocked when this dialog is displayed.

    lastDirectoryHandler

    customize how directory selections are remembered between uses of the dialog. Used with addDirectoryField and addFileField.

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addCheckbox(label: String, defaultValue: Boolean): Unit

    Adds a checkbox.

    Adds a checkbox.

    label

    the label

    defaultValue

    the initial state

    Definition Classes
    GenericPaneBase
  5. def addChoice(label: String, items: Seq[String], defaultItem: String): Unit

    Adds a choice list.

    Adds a choice list.

    label

    the label

    items

    items on the list

    defaultItem

    the initial item, must be equal to one of the items

    Definition Classes
    GenericPaneBase
  6. def addChoice(label: String, items: Array[String], defaultItem: String): Unit
    Definition Classes
    GenericPaneBase
  7. def addDirectoryField(label: String, defaultPath: String, columns: Int): Unit

    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.

    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.

    label

    the label

    defaultPath

    initial path

    columns

    width of the text field

    Definition Classes
    GenericPaneBase
  8. def addDirectoryField(label: String, defaultPath: String): Unit

    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.

    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.

    label

    the label

    defaultPath

    initial path

    Definition Classes
    GenericPaneBase
  9. def addFileField(label: String, defaultPath: String = "", columns: Int = 12): Unit

    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.

    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.

    label

    the label

    defaultPath

    initial path

    columns

    width of the text field

    Definition Classes
    GenericPaneBase
  10. def addHelp(url: String): Unit

    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.

    url

    the URL to open in the default browser

  11. def addMessage(message: String, font: Option[Font] = None): Unit

    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*()

    message

    message

    font

    Optional font used to render the message

    Definition Classes
    GenericPaneBase
  12. def addMessage(message: String, font: Font): Unit

    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*()

    message

    message

    font

    font used to render the message

    Definition Classes
    GenericPaneBase
  13. def addNode(label: String, node: Node): Unit

    Add a custom node

    Add a custom node

    label

    the label

    node

    custom node. It is not included in next*() readouts, needs to be handled by the creator

    Definition Classes
    GenericPaneBase
  14. def addNode(node: Node): Unit

    Add a custom node that will occupy a whole row

    Add a custom node that will occupy a whole row

    Definition Classes
    GenericPaneBase
  15. def addNumericField(label: String, defaultValue: Double, decimalPlaces: Int, columnWidth: Int, units: String): Unit

    Add a numeric field.

    Add a numeric field.

    label

    the label

    defaultValue

    the initial value

    decimalPlaces

    number of decimal places to display

    columnWidth

    number of columns used to display the number

    units

    text displayed after the number

    Definition Classes
    GenericPaneBase
  16. def addNumericField(label: String, defaultValue: Double): Unit

    Add a numeric field.

    Add a numeric field.

    label

    the label

    defaultValue

    the initial value

    Definition Classes
    GenericPaneBase
  17. def addStringField(label: String, defaultText: String, columns: Int): Unit

    Adds a text field.

    Adds a text field.

    label

    the label

    defaultText

    text initially displayed

    columns

    width of the text field

    Definition Classes
    GenericPaneBase
  18. def addStringField(label: String, defaultText: String): Unit

    Adds an 8 column text field.

    Adds an 8 column text field.

    label

    the label

    defaultText

    the text initially displayed

    Definition Classes
    GenericPaneBase
  19. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  20. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. val header: String
  27. def helpLabel: String

    Label used for the help button

  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. val lastDirectoryHandler: LastDirectoryHandler

    Customize how directory selections are remembered between uses of the dialog.

    Customize how directory selections are remembered between uses of the dialog. Used with addDirectoryField and addFileField

    Definition Classes
    GenericDialogFXGenericPaneBase
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. def nextBoolean(): Boolean

    Returns the state of the next checkbox

    Returns the state of the next checkbox

    Definition Classes
    GenericPaneBase
  32. def nextChoice(): String
    Definition Classes
    GenericPaneBase
  33. def nextNumber(): Double

    Returns the value of the next number

    Returns the value of the next number

    Definition Classes
    GenericPaneBase
  34. def nextString(): String

    Returns the value of the next string

    Returns the value of the next string

    Definition Classes
    GenericPaneBase
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. def pane: Node
    Attributes
    protected
    Definition Classes
    GenericPaneBase
  38. def parentWindow: Option[Window]
    Attributes
    protected
    Definition Classes
    GenericPaneBase
  39. def requestFocusOnFirstLabeled(): Unit
    Attributes
    protected
    Definition Classes
    GenericPaneBase
  40. def resetReadout(): Unit
    Attributes
    protected
    Definition Classes
    GenericPaneBase
  41. def showDialog(): Unit

    Display the dialog and block till the dialog is closed

  42. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  43. val title: String
  44. def toString(): String
    Definition Classes
    AnyRef → Any
  45. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  46. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  47. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  48. def wasCanceled: Boolean

    true if the dialog was closed by cancelling

  49. def wasOKed: Boolean

    true if the dialog was closed using OK button

Inherited from GenericPaneBase

Inherited from AnyRef

Inherited from Any

Ungrouped