AutoDialog

org.scalafx.extras.auto_dialog.AutoDialog
class AutoDialog[A >: Null](data: A)(implicit evidence$1: DialogEncoder[A], evidence$2: DialogDecoder[A])

Automatically created a dialog from a case class. Names of the members of the input data will be used as labels for fields corresponding to their values. Initially case with members of Boolean, Int, Double, and String are supported.

Use methods showDialog to display the dialog and retrieve edited content.

 case class FilterOptions(kernelSize: Int = 7,
                          start: Double = 3.14,
                          tag: String = "alpha",
                          debugMode: Boolean = false)

 val result: Option[FilterOptions] =
   new AutoDialog(FilterOptions())
     .showDialog(
       "Filter Options",
       "Fields below were auto generated from `FilterOptions` object")

 println(s"Result: result")

Value parameters

data

data that will define the dialog and its initial values

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def showDialog(title: String, header: String, ownerWindow: Option[Window]): Option[A]

Display the dialog and block till the dialog is closed.

Display the dialog and block till the dialog is closed.

Value parameters

header

dialog header

ownerWindow

optional parent window that will be blocked when dialog is displayed

title

dialog title

Attributes

Returns

when dialog was confirmed with OK it will return content of the fields of the dialog. If dialog was cancelled it will return None