Package-level declarations

Types

Link copied to clipboard

Always appends the indicator.

Link copied to clipboard

Configuration used to customize slider controls.

Link copied to clipboard

Configuration used to customize circularSlider controls.

Link copied to clipboard
class FieldInfo<T>
Link copied to clipboard
interface FieldVisualizer<T>

Defines the visualization of a Field within a Form.

Link copied to clipboard
class Form : View

A visual component that serves as a strongly-typed constructor of some arbitrary type. Forms are very similar to constructors in that they have typed parameter lists (fields), and can only "create" instances when all their inputs are valid. Like any constructor, a Form can have optional fields, default values, and arbitrary types for its fields.

Link copied to clipboard
Link copied to clipboard

Config for labeled controls.

Link copied to clipboard

Config for labeled controls.

Link copied to clipboard

Configuration for radio and check lists.

Link copied to clipboard

Configuration used to customize rangeSlider controls.

Link copied to clipboard

Defines style of indicator to use when showing labeled fields as required.

Link copied to clipboard

Config for scrolling controls.

Link copied to clipboard

Configuration used to customize slider controls.

Link copied to clipboard

Configuration for textField controls.

Link copied to clipboard

Only appends the indicator after a field is initially (or becomes) invalid.

Link copied to clipboard
class WhenInvalidFocusLost(text: StyledText, focusTarget: View? = null) : RequiredIndicatorStyle

Only appends the indicator after a field is initially (or becomes) invalid and it loses focus.

Link copied to clipboard

Only appends the indicator if explicitly requested. and it loses focus.

Functions

Link copied to clipboard

Creates a CheckBox control that is bound to a Field (of type Boolean).

Link copied to clipboard
fun <T> checkList(first: T, vararg rest: T, config: OptionListConfig<T>.() -> Unit = {}): FieldVisualizer<List<T>>

Creates a list of CheckBoxs that is bound to a Field. This controls lets a user select multiple options from a list. This control lets a user ignore selection entirely, which would result in an empty list.

Link copied to clipboard
@JvmName(name = "circularRangeSliderMeasure")
fun <T : Units> circularRangeSlider(model: ConfinedRangeModel<Measure<T>>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<ClosedRange<Measure<T>>>
@JvmName(name = "circularRangeSliderByte")
fun circularRangeSlider(model: ConfinedRangeModel<Byte>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<ClosedRange<Byte>>
@JvmName(name = "circularRangeSliderChar")
fun circularRangeSlider(model: ConfinedRangeModel<Char>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Char>.() -> Unit = {}): FieldVisualizer<ClosedRange<Char>>
@JvmName(name = "circularRangeSliderDouble")
fun circularRangeSlider(model: ConfinedRangeModel<Double>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Double>.() -> Unit = {}): FieldVisualizer<ClosedRange<Double>>
@JvmName(name = "circularRangeSliderFloat")
fun circularRangeSlider(model: ConfinedRangeModel<Float>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Float>.() -> Unit = {}): FieldVisualizer<ClosedRange<Float>>
@JvmName(name = "circularRangeSliderLong")
fun circularRangeSlider(model: ConfinedRangeModel<Long>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Long>.() -> Unit = {}): FieldVisualizer<ClosedRange<Long>>
@JvmName(name = "circularRangeSliderShort")
fun circularRangeSlider(model: ConfinedRangeModel<Short>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Short>.() -> Unit = {}): FieldVisualizer<ClosedRange<Short>>
@JvmName(name = "circularRangeSliderMeasure")
fun <T : Units> circularRangeSlider(range: ClosedRange<Measure<T>>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<ClosedRange<Measure<T>>>
@JvmName(name = "circularRangeSliderByte")
fun circularRangeSlider(range: ClosedRange<Byte>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<ClosedRange<Byte>>
@JvmName(name = "circularRangeSliderChar")
fun circularRangeSlider(range: ClosedRange<Char>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Char>.() -> Unit = {}): FieldVisualizer<ClosedRange<Char>>
@JvmName(name = "circularRangeSliderDouble")
fun circularRangeSlider(range: ClosedRange<Double>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Double>.() -> Unit = {}): FieldVisualizer<ClosedRange<Double>>
@JvmName(name = "circularRangeSliderFloat")
fun circularRangeSlider(range: ClosedRange<Float>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Float>.() -> Unit = {}): FieldVisualizer<ClosedRange<Float>>
@JvmName(name = "circularRangeSliderLong")
fun circularRangeSlider(range: ClosedRange<Long>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Long>.() -> Unit = {}): FieldVisualizer<ClosedRange<Long>>
@JvmName(name = "circularRangeSliderShort")
fun circularRangeSlider(range: ClosedRange<Short>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<Short>.() -> Unit = {}): FieldVisualizer<ClosedRange<Short>>

Creates a CircularRangeSlider control that is bound to a Field. This control lets the user select a value within a range.

fun <T : Comparable<T>> circularRangeSlider(model: ConfinedRangeModel<T>, converter: Interpolator<T>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<T>.() -> Unit = {}): FieldVisualizer<ClosedRange<T>>
inline fun <T : Number, Comparable<T>> circularRangeSlider(model: ConfinedRangeModel<T>, noinline config: CircularRangeSliderConfig<T>.() -> Unit = {}, type: KClass<T>, function: InvertibleFunction = LinearFunction): FieldVisualizer<ClosedRange<T>>
fun <T : Comparable<T>> circularRangeSlider(range: ClosedRange<T>, converter: Interpolator<T>, function: InvertibleFunction = LinearFunction, config: CircularRangeSliderConfig<T>.() -> Unit = {}): FieldVisualizer<ClosedRange<T>>
Link copied to clipboard
@JvmName(name = "circularSliderMeasure")
fun <T : Units> circularSlider(model: ConfinedValueModel<Measure<T>>, config: CircularSliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<Measure<T>>
@JvmName(name = "circularSliderByte")
fun circularSlider(model: ConfinedValueModel<Byte>, config: CircularSliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<Byte>
@JvmName(name = "circularSliderChar")
fun circularSlider(model: ConfinedValueModel<Char>, config: CircularSliderConfig<Char>.() -> Unit = {}): FieldVisualizer<Char>
@JvmName(name = "circularSliderDouble")
fun circularSlider(model: ConfinedValueModel<Double>, config: CircularSliderConfig<Double>.() -> Unit = {}): FieldVisualizer<Double>
@JvmName(name = "circularSliderFloat")
fun circularSlider(model: ConfinedValueModel<Float>, config: CircularSliderConfig<Float>.() -> Unit = {}): FieldVisualizer<Float>
@JvmName(name = "circularSliderLong")
fun circularSlider(model: ConfinedValueModel<Long>, config: CircularSliderConfig<Long>.() -> Unit = {}): FieldVisualizer<Long>
@JvmName(name = "circularSliderShort")
fun circularSlider(model: ConfinedValueModel<Short>, config: CircularSliderConfig<Short>.() -> Unit = {}): FieldVisualizer<Short>
@JvmName(name = "circularSliderMeasure")
fun <T : Units> circularSlider(range: ClosedRange<Measure<T>>, config: CircularSliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<Measure<T>>
@JvmName(name = "circularSliderChar")
fun circularSlider(range: ClosedRange<Char>, config: CircularSliderConfig<Char>.() -> Unit = {}): FieldVisualizer<Char>

Creates a CircularSlider control that is bound to a Field. This control lets the user select a value within a range.

@JvmName(name = "circularSliderByte")
fun circularSlider(range: ClosedRange<Byte>, config: CircularSliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<Byte>
@JvmName(name = "circularSliderDouble")
fun circularSlider(range: ClosedRange<Double>, config: CircularSliderConfig<Double>.() -> Unit = {}): FieldVisualizer<Double>
@JvmName(name = "circularSliderFloat")
fun circularSlider(range: ClosedRange<Float>, config: CircularSliderConfig<Float>.() -> Unit = {}): FieldVisualizer<Float>
@JvmName(name = "circularSliderLong")
fun circularSlider(range: ClosedRange<Long>, config: CircularSliderConfig<Long>.() -> Unit = {}): FieldVisualizer<Long>
@JvmName(name = "circularSliderShort")
fun circularSlider(range: ClosedRange<Short>, config: CircularSliderConfig<Short>.() -> Unit = {}): FieldVisualizer<Short>

Creates a CircularSlider control that is bound to a Field. In this control lets the user select a value within a range.

fun <T : Comparable<T>> circularSlider(model: ConfinedValueModel<T>, numberTypeConverter: Interpolator<T>, config: CircularSliderConfig<T>.() -> Unit = {}): FieldVisualizer<T>
inline fun <T : Number, Comparable<T>> circularSlider(model: ConfinedValueModel<T>, noinline config: CircularSliderConfig<T>.() -> Unit = {}, type: KClass<T>): FieldVisualizer<T>
fun <T : Comparable<T>> circularSlider(range: ClosedRange<T>, numberTypeConverter: Interpolator<T>, config: CircularSliderConfig<T>.() -> Unit = {}): FieldVisualizer<T>
Link copied to clipboard
fun <T, M : ListModel<T>> dropDown(model: M, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, config: (SelectBox<T, *>) -> Unit = {}): FieldVisualizer<T>
fun <T> dropDown(first: T, vararg rest: T, label: (T) -> String = { "$it" }, config: (SelectBox<T, *>) -> Unit = {}): FieldVisualizer<T>
fun <T> dropDown(first: T, vararg rest: T, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, config: (SelectBox<T, *>) -> Unit = {}): FieldVisualizer<T>

Creates a SelectBox control that is bound to a Field. This control lets a user select a single item within a list. It is similar to radioList, except it DOES set a default value and its field is therefore ALWAYS Valid.

fun <T : Any> dropDown(first: T, vararg rest: T, label: (T) -> String = { "$it" }, unselectedLabel: String, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T>
fun <T : Any> dropDown(first: T, vararg rest: T, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, unselectedBoxItemVisualizer: ItemVisualizer<Unit, IndexedItem>, unselectedListItemVisualizer: ItemVisualizer<Unit, IndexedItem> = unselectedBoxItemVisualizer, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T>

Creates a SelectBox control that is bound to a Field. This control lets a user select a single item within a list. It is similar to radioList, in that it DOES NOT set a default value and its field is Invalid if no initial value is bound to it. The control actually has an "unselected" state when it is invalid.

Link copied to clipboard
fun <T> field(block: FieldInfo<T>.() -> View): FieldVisualizer<T>

Helper for creating a FieldVisualizer from a lambda.

Link copied to clipboard
fun file(acceptedTypes: Set<MimeType<*>> = emptySet()): FieldVisualizer<LocalFile>

Creates a FileSelector control that is bound to a Field (of type LocalFile).

Link copied to clipboard
fun files(acceptedTypes: Set<MimeType<*>> = emptySet()): FieldVisualizer<List<LocalFile>>

Creates a FileSelector control that is bound to a Field (of type List of LocalFile).

Link copied to clipboard

Creates a Form component that is bound to a Field. This control allows nesting of forms using a DSL like that used for top-level forms.

Link copied to clipboard

Creates a Container with the result of visualizer as its only child, that is bound to a Field. This control simply wraps an existing one with a configurable container.

Link copied to clipboard
fun <T> labeled(name: StyledText, showRequired: RequiredIndicatorStyle? = WhenInvalid(), visualizer: NamedConfig.() -> FieldVisualizer<T>): FieldVisualizer<T>
fun <T> labeled(name: String, showRequired: RequiredIndicatorStyle? = WhenInvalid(), visualizer: NamedConfig.() -> FieldVisualizer<T>): FieldVisualizer<T>

Creates a component with a Label and the result of visualizer that is bound to a Field. This control simply wraps an existing one with a configurable text label.

fun <T> labeled(name: StyledText, help: StyledText, showRequired: RequiredIndicatorStyle? = WhenInvalid(), visualizer: LabeledConfig.() -> FieldVisualizer<T>): FieldVisualizer<T>
fun <T> labeled(name: String, help: String, showRequired: RequiredIndicatorStyle? = WhenInvalid(), visualizer: LabeledConfig.() -> FieldVisualizer<T>): FieldVisualizer<T>

Creates a component with a name Label, the result of visualizer and a helper Label that is bound to a Field. This control simply wraps an existing one with configurable text labels.

Link copied to clipboard
fun <T, M : ListModel<T>> list(model: M, itemVisualizer: ItemVisualizer<T, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<T, M>) -> Unit = {}): FieldVisualizer<List<T>>
fun list(progression: IntProgression, itemVisualizer: ItemVisualizer<Int, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<Int, *>) -> Unit = {}): FieldVisualizer<List<Int>>
fun <T> list(first: T, vararg rest: T, itemVisualizer: ItemVisualizer<T, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<T, *>) -> Unit = {}): FieldVisualizer<List<T>>

Creates a List control that is bound to a Field. This controls lets a user select multiple options from a list. This control lets a user ignore selection entirely, which would result in an empty list. It is similar to a checkList.

Link copied to clipboard
fun <T : Any> optionalDropDown(first: T, vararg rest: T, label: (T) -> String = { "$it" }, unselectedLabel: String, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T?>
fun <T : Any, M : ListModel<T>> optionalDropDown(model: M, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, unselectedBoxItemVisualizer: ItemVisualizer<Unit, IndexedItem>, unselectedListItemVisualizer: ItemVisualizer<Unit, IndexedItem> = unselectedBoxItemVisualizer, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T?>
fun <T : Any> optionalDropDown(first: T, vararg rest: T, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, unselectedBoxItemVisualizer: ItemVisualizer<Unit, IndexedItem>, unselectedListItemVisualizer: ItemVisualizer<Unit, IndexedItem> = unselectedBoxItemVisualizer, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T?>

Creates a SelectBox control that is bound to a Field. This control lets a user select a single item within a list. It is similar to optionalRadioList. This control lets a user ignore selection entirely and therefore the resulting type is T?.

Link copied to clipboard
fun <T : Any> optionalRadioList(first: T, vararg rest: T, config: OptionListConfig<T>.() -> Unit = {}): FieldVisualizer<T?>

Creates a list of RadioButtons within a ButtonGroup that is bound to a Field. This controls lets a user select an option from a list. This control lets a user ignore selection entirely and therefore the resulting type is T?.

Link copied to clipboard
fun <T : Any> optionalSelectBox(first: T, vararg rest: T, label: (T) -> String = { "$it" }, unselectedLabel: String, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T?>
fun <T : Any, M : ListModel<T>> optionalSelectBox(model: M, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, unselectedBoxItemVisualizer: ItemVisualizer<Unit, IndexedItem>, unselectedListItemVisualizer: ItemVisualizer<Unit, IndexedItem> = unselectedBoxItemVisualizer, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T?>
fun <T : Any> optionalSelectBox(first: T, vararg rest: T, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, unselectedBoxItemVisualizer: ItemVisualizer<Unit, IndexedItem>, unselectedListItemVisualizer: ItemVisualizer<Unit, IndexedItem> = unselectedBoxItemVisualizer, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T?>

Creates a SelectBox control that is bound to a Field. This control lets a user select a single item within a list. It is similar to optionalRadioList. This control lets a user ignore selection entirely and therefore the resulting type is T?.

Link copied to clipboard
fun <T, M : ListModel<T>> optionalSingleChoiceList(model: M, itemVisualizer: ItemVisualizer<T, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<T, M>) -> Unit = {}): FieldVisualizer<T?>
fun optionalSingleChoiceList(progression: IntProgression, itemVisualizer: ItemVisualizer<Int, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<Int, *>) -> Unit = {}): FieldVisualizer<Int?>
fun <T> optionalSingleChoiceList(first: T, vararg rest: T, itemVisualizer: ItemVisualizer<T, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<T, *>) -> Unit = {}): FieldVisualizer<T?>

Creates a List control that is bound to a Field. This controls lets a user select a single option from a list. This control lets a user ignore selection entirely, which would result in a null value. This behaves like optionalRadioList.

Link copied to clipboard
fun <T> radioList(first: T, vararg rest: T, config: OptionListConfig<T>.() -> Unit = {}): FieldVisualizer<T>

Creates a list of RadioButtons within a ButtonGroup that is bound to a Field. This controls lets a user select an option from a list.

Link copied to clipboard
@JvmName(name = "rangeSliderMeasure")
fun <T : Units> rangeSlider(model: ConfinedRangeModel<Measure<T>>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<ClosedRange<Measure<T>>>
@JvmName(name = "rangeSliderByte")
fun rangeSlider(model: ConfinedRangeModel<Byte>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<ClosedRange<Byte>>
@JvmName(name = "rangeSliderChar")
fun rangeSlider(model: ConfinedRangeModel<Char>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Char>.() -> Unit = {}): FieldVisualizer<ClosedRange<Char>>
@JvmName(name = "rangeSliderDouble")
fun rangeSlider(model: ConfinedRangeModel<Double>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Double>.() -> Unit = {}): FieldVisualizer<ClosedRange<Double>>
@JvmName(name = "rangeSliderFloat")
fun rangeSlider(model: ConfinedRangeModel<Float>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Float>.() -> Unit = {}): FieldVisualizer<ClosedRange<Float>>
fun rangeSlider(model: ConfinedRangeModel<Int>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Int>.() -> Unit = {}): FieldVisualizer<ClosedRange<Int>>
@JvmName(name = "rangeSliderLong")
fun rangeSlider(model: ConfinedRangeModel<Long>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Long>.() -> Unit = {}): FieldVisualizer<ClosedRange<Long>>
@JvmName(name = "rangeSliderShort")
fun rangeSlider(model: ConfinedRangeModel<Short>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Short>.() -> Unit = {}): FieldVisualizer<ClosedRange<Short>>
@JvmName(name = "rangeSliderMeasure")
fun <T : Units> rangeSlider(range: ClosedRange<Measure<T>>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<ClosedRange<Measure<T>>>
@JvmName(name = "rangeSliderByte")
fun rangeSlider(range: ClosedRange<Byte>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<ClosedRange<Byte>>
@JvmName(name = "rangeSliderChar")
fun rangeSlider(range: ClosedRange<Char>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Char>.() -> Unit = {}): FieldVisualizer<ClosedRange<Char>>
@JvmName(name = "rangeSliderDouble")
fun rangeSlider(range: ClosedRange<Double>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Double>.() -> Unit = {}): FieldVisualizer<ClosedRange<Double>>
@JvmName(name = "rangeSliderFloat")
fun rangeSlider(range: ClosedRange<Float>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Float>.() -> Unit = {}): FieldVisualizer<ClosedRange<Float>>
fun rangeSlider(range: ClosedRange<Int>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Int>.() -> Unit = {}): FieldVisualizer<ClosedRange<Int>>
@JvmName(name = "rangeSliderLong")
fun rangeSlider(range: ClosedRange<Long>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Long>.() -> Unit = {}): FieldVisualizer<ClosedRange<Long>>
@JvmName(name = "rangeSliderShort")
fun rangeSlider(range: ClosedRange<Short>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<Short>.() -> Unit = {}): FieldVisualizer<ClosedRange<Short>>

Creates a RangeSlider control that is bound to a Field. This control lets the user select a value within a range.

fun <T : Comparable<T>> rangeSlider(model: ConfinedRangeModel<T>, converter: Interpolator<T>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<T>.() -> Unit = {}): FieldVisualizer<ClosedRange<T>>
inline fun <T : Number, Comparable<T>> rangeSlider(model: ConfinedRangeModel<T>, orientation: Orientation = Horizontal, noinline config: RangeSliderConfig<T>.() -> Unit = {}, type: KClass<T>, function: InvertibleFunction = LinearFunction): FieldVisualizer<ClosedRange<T>>
fun <T : Comparable<T>> rangeSlider(range: ClosedRange<T>, converter: Interpolator<T>, orientation: Orientation = Horizontal, function: InvertibleFunction = LinearFunction, config: RangeSliderConfig<T>.() -> Unit = {}): FieldVisualizer<ClosedRange<T>>
Link copied to clipboard

Creates a ScrollPanel with the result of visualizer as its content, that is bound to a Field. This control simply wraps an existing one with a configurable scroll panel.

Link copied to clipboard
fun <T, M : ListModel<T>> selectBox(model: M, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, config: (SelectBox<T, *>) -> Unit = {}): FieldVisualizer<T>
fun <T> selectBox(first: T, vararg rest: T, label: (T) -> String = { "$it" }, config: (SelectBox<T, *>) -> Unit = {}): FieldVisualizer<T>
fun <T> selectBox(first: T, vararg rest: T, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, config: (SelectBox<T, *>) -> Unit = {}): FieldVisualizer<T>

Creates a SelectBox control that is bound to a Field. This control lets a user select a single item within a list. It is similar to radioList, except it DOES set a default value and its field is therefore ALWAYS Valid.

fun <T : Any> selectBox(first: T, vararg rest: T, label: (T) -> String = { "$it" }, unselectedLabel: String, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T>
fun <T : Any> selectBox(first: T, vararg rest: T, boxItemVisualizer: ItemVisualizer<T, IndexedItem>, listItemVisualizer: ItemVisualizer<T, IndexedItem> = boxItemVisualizer, unselectedBoxItemVisualizer: ItemVisualizer<Unit, IndexedItem>, unselectedListItemVisualizer: ItemVisualizer<Unit, IndexedItem> = unselectedBoxItemVisualizer, config: (SelectBox<T?, *>) -> Unit = {}): FieldVisualizer<T>

Creates a SelectBox control that is bound to a Field. This control lets a user select a single item within a list. It is similar to radioList, in that it DOES NOT set a default value and its field is Invalid if no initial value is bound to it. The control actually has an "unselected" state when it is invalid.

Link copied to clipboard
fun singleChoiceList(progression: IntProgression, itemVisualizer: ItemVisualizer<Int, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<Int, *>) -> Unit = {}): FieldVisualizer<Int>

Creates a List control that is bound to a Field. This controls lets a user select a single option from a list.

fun <T, M : ListModel<T>> singleChoiceList(first: T, vararg rest: T, itemVisualizer: ItemVisualizer<T, IndexedItem> = toString(StringVisualizer()), fitContents: Set<Dimension> = setOf(Height), config: (List<T, *>) -> Unit = {}): FieldVisualizer<T>

Creates a List control that is bound to a Field. This controls lets a user select a single option from a list. This behaves like radioList.

Link copied to clipboard
@JvmName(name = "sliderMeasure")
fun <T : Units> slider(model: ConfinedValueModel<Measure<T>>, orientation: Orientation = Horizontal, config: SliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<Measure<T>>
@JvmName(name = "sliderByte")
fun slider(model: ConfinedValueModel<Byte>, orientation: Orientation = Horizontal, config: SliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<Byte>
@JvmName(name = "sliderChar")
fun slider(model: ConfinedValueModel<Char>, orientation: Orientation = Horizontal, config: SliderConfig<Char>.() -> Unit = {}): FieldVisualizer<Char>
@JvmName(name = "sliderDouble")
fun slider(model: ConfinedValueModel<Double>, orientation: Orientation = Horizontal, config: SliderConfig<Double>.() -> Unit = {}): FieldVisualizer<Double>
@JvmName(name = "sliderFloat")
fun slider(model: ConfinedValueModel<Float>, orientation: Orientation = Horizontal, config: SliderConfig<Float>.() -> Unit = {}): FieldVisualizer<Float>
fun slider(model: ConfinedValueModel<Int>, orientation: Orientation = Horizontal, config: SliderConfig<Int>.() -> Unit = {}): FieldVisualizer<Int>
@JvmName(name = "sliderLong")
fun slider(model: ConfinedValueModel<Long>, orientation: Orientation = Horizontal, config: SliderConfig<Long>.() -> Unit = {}): FieldVisualizer<Long>
@JvmName(name = "sliderShort")
fun slider(model: ConfinedValueModel<Short>, orientation: Orientation = Horizontal, config: SliderConfig<Short>.() -> Unit = {}): FieldVisualizer<Short>
@JvmName(name = "sliderMeasure")
fun <T : Units> slider(range: ClosedRange<Measure<T>>, orientation: Orientation = Horizontal, config: SliderConfig<Measure<T>>.() -> Unit = {}): FieldVisualizer<Measure<T>>
@JvmName(name = "sliderByte")
fun slider(range: ClosedRange<Byte>, orientation: Orientation = Horizontal, config: SliderConfig<Byte>.() -> Unit = {}): FieldVisualizer<Byte>
@JvmName(name = "sliderChar")
fun slider(range: ClosedRange<Char>, orientation: Orientation = Horizontal, config: SliderConfig<Char>.() -> Unit = {}): FieldVisualizer<Char>
@JvmName(name = "sliderDouble")
fun slider(range: ClosedRange<Double>, orientation: Orientation = Horizontal, config: SliderConfig<Double>.() -> Unit = {}): FieldVisualizer<Double>
@JvmName(name = "sliderFloat")
fun slider(range: ClosedRange<Float>, orientation: Orientation = Horizontal, config: SliderConfig<Float>.() -> Unit = {}): FieldVisualizer<Float>
fun slider(range: ClosedRange<Int>, orientation: Orientation = Horizontal, config: SliderConfig<Int>.() -> Unit = {}): FieldVisualizer<Int>
@JvmName(name = "sliderLong")
fun slider(range: ClosedRange<Long>, orientation: Orientation = Horizontal, config: SliderConfig<Long>.() -> Unit = {}): FieldVisualizer<Long>
@JvmName(name = "sliderShort")
fun slider(range: ClosedRange<Short>, orientation: Orientation = Horizontal, config: SliderConfig<Short>.() -> Unit = {}): FieldVisualizer<Short>

Creates a Slider control that is bound to a Field. This control lets the user select a value within a range.

fun <T : Comparable<T>> slider(model: ConfinedValueModel<T>, orientation: Orientation = Horizontal, interpolator: Interpolator<T>, config: SliderConfig<T>.() -> Unit = {}): FieldVisualizer<T>
inline fun <T : Number, Comparable<T>> slider(model: ConfinedValueModel<T>, orientation: Orientation = Horizontal, noinline config: SliderConfig<T>.() -> Unit = {}, type: KClass<T>): FieldVisualizer<T>
fun <T : Comparable<T>> slider(range: ClosedRange<T>, orientation: Orientation = Horizontal, interpolator: Interpolator<T>, config: SliderConfig<T>.() -> Unit = {}): FieldVisualizer<T>
Link copied to clipboard
fun <T, M : SpinButtonModel<T>> spinButton(model: M, itemVisualizer: ItemVisualizer<T, SpinButton<T, M>> = toString(StringVisualizer()), config: (SpinButton<T, M>) -> Unit = {}): FieldVisualizer<T>
fun <T> spinButton(values: List<T>, itemVisualizer: ItemVisualizer<T, SpinButton<T, *>>, config: (SpinButton<T, *>) -> Unit = {}): FieldVisualizer<T>
fun <T> spinButton(values: List<T>, label: (T) -> String = { "$it" }, config: (SpinButton<T, *>) -> Unit = {}): FieldVisualizer<T>
fun spinButton(progression: IntProgression, itemVisualizer: ItemVisualizer<Int, SpinButton<Int, *>>, config: (SpinButton<Int, *>) -> Unit = {}): FieldVisualizer<Int>
fun spinButton(progression: IntProgression, label: (Int) -> String = { "$it" }, config: (SpinButton<Int, *>) -> Unit = {}): FieldVisualizer<Int>
fun <T> spinButton(first: T, vararg rest: T, itemVisualizer: ItemVisualizer<T, SpinButton<T, *>>, config: (SpinButton<T, *>) -> Unit = {}): FieldVisualizer<T>
fun <T> spinButton(first: T, vararg rest: T, label: (T) -> String = { "$it" }, config: (SpinButton<T, *>) -> Unit = {}): FieldVisualizer<T>

Creates a SpinButton control that is bound to a Field. This control lets a user select a single item within a list. It is similar to radioList, except it DOES set a default value and its field is therefore ALWAYS Valid.

Link copied to clipboard
fun <T, M : SpinButtonModel<T>> spinner(model: M, itemVisualizer: ItemVisualizer<T, SpinButton<T, M>> = toString(StringVisualizer()), config: (SpinButton<T, M>) -> Unit = {}): FieldVisualizer<T>
fun <T> spinner(first: T, vararg rest: T, itemVisualizer: ItemVisualizer<T, SpinButton<T, *>>, config: (SpinButton<T, *>) -> Unit = {}): FieldVisualizer<T>
fun <T> spinner(first: T, vararg rest: T, label: (T) -> String = { "$it" }, config: (SpinButton<T, *>) -> Unit = {}): FieldVisualizer<T>
Link copied to clipboard

Creates a Switch control that is bound to a Field (of type Boolean).

Link copied to clipboard
fun <T> switchList(first: T, vararg rest: T, config: OptionListConfig<T>.() -> Unit = {}): FieldVisualizer<List<T>>

Creates a list of Switches that is bound to a Field. This controls lets a user select multiple options from a list. This control lets a user ignore selection entirely, which would result in an empty list.

Link copied to clipboard
fun textField(pattern: Regex = Regex(".*"), validator: (String) -> Boolean = { true }, config: TextFieldConfig<String>.() -> Unit = {}): FieldVisualizer<String>

Creates a TextField control that is bounded to a Field (of type String). The associated field will only be valid if the text field's input matches pattern.

fun <T> textField(pattern: Regex = Regex(".*"), encoder: Encoder<T, String>, validator: (T) -> Boolean = { true }, config: TextFieldConfig<T>.() -> Unit = {}): FieldVisualizer<T>

Creates a TextField control that is bounded to a Field. The associated field will only be valid if the text field's input matches pattern and encoder.decode produces a valid T from it.

Link copied to clipboard
fun verticalLayout(container: View, spacing: Double = 2.0, itemHeight: Double? = null): Layout

Inherited functions

Link copied to clipboard
inline fun <R, T> Form.FieldState<T>.fold(onValid: (value: T) -> R, default: R): R
inline fun <R, T> Form.Field<T>.fold(onValid: (value: T) -> R, default: R): R

Returns the result of onValid if this instance is valid or default if it is invalid.

Link copied to clipboard
inline fun <T> Form.FieldState<T>.ifInvalid(onInvalid: () -> Unit)

Does the action of onInvalid if this instance is invalid.

Link copied to clipboard
inline fun <T> Form.FieldState<T>.ifValid(onValid: (value: T) -> Unit)
inline fun <T> Form.Field<T>.ifValid(onValid: (value: T) -> Unit)

Does the action of onValid if this instance is valid.

Link copied to clipboard
inline fun <T, R> Form.FieldState<T>.map(onValid: (value: T) -> R): Form.FieldState<R>

Returns a valid state from the result of onValid if this instance is valid or invalid otherwise.

Link copied to clipboard
inline fun <T, R> Form.Field<T>.mapValue(onValid: (value: T) -> R): Form.FieldState<R>

Returns a valid state from the result of onValid if this instance is valid or invalid otherwise.