DataContainer

class DataContainer<M, C, CONT>(    model: MutableList<M>,     factory: <Error class: unknown class>.(M, Int, MutableList<M>) -> C,     container: CONT,     containerAdd: CONT.(C, M) -> Unit? = null,     filter: (M) -> Boolean? = null,     sorter: (M) -> Comparable<*>?? = null,     sorterType: () -> SorterType = { SorterType.ASC },     init: DataContainer<M, C, CONT>.() -> Unit? = null) : DataUpdatable

A container class with support for mutable/observable data model.

Parameters

M

data model type

C

visual component type

CONT

container type

model

data model of type MutableList

factory

a function which creates component C from data model at given index

container

internal container

containerAdd

function to add component C to the internal container CONT

filter

a filtering function

sorter

a sorting function

sorterType

a sorting type selection function

init

an initializer extension function

Constructors

Link copied to clipboard
fun <M, C, CONT> DataContainer(    model: MutableList<M>,     factory: <Error class: unknown class>.(M, Int, MutableList<M>) -> C,     container: CONT,     containerAdd: CONT.(C, M) -> Unit? = null,     filter: (M) -> Boolean? = null,     sorter: (M) -> Comparable<*>?? = null,     sorterType: () -> SorterType = { SorterType.ASC },     init: DataContainer<M, C, CONT>.() -> Unit? = null)

Creates DataContainer bound to given data model.

Functions

Link copied to clipboard
open fun add(child: <Error class: unknown class>): DataContainer<M, C, CONT>
open fun add(position: Int, child: <Error class: unknown class>): DataContainer<M, C, CONT>
Link copied to clipboard
open fun addAll(children: List<<Error class: unknown class>>): DataContainer<M, C, CONT>
Link copied to clipboard
fun clearOnUpdate(): DataContainer<M, C, CONT>

Clears notification handler.

Link copied to clipboard
open fun disposeAll(): DataContainer<M, C, CONT>
Link copied to clipboard
open fun getChildren(): List<<Error class: unknown class>>
Link copied to clipboard
fun onUpdate(handler: () -> Unit): DataContainer<M, C, CONT>

Sets a notification handler called after every update.

Link copied to clipboard
open fun remove(child: <Error class: unknown class>): DataContainer<M, C, CONT>
Link copied to clipboard
open fun removeAll(): DataContainer<M, C, CONT>
Link copied to clipboard
open fun removeAt(position: Int): DataContainer<M, C, CONT>
Link copied to clipboard
open fun renderVNode(): <Error class: unknown class>
Link copied to clipboard
open override fun update()

Updates view from the current data model state.

Properties

Link copied to clipboard
open var visible: <Error class: unknown class>