diff options
author | Robert Jaros <rjaros@finn.pl> | 2018-02-12 12:00:15 +0100 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2018-02-12 12:00:15 +0100 |
commit | eea44b35add0d036119888f41e4ed38e75190934 (patch) | |
tree | 01ff2b73042ab08941df082d74241dc5e229a37d /src/main/kotlin/pl/treksoft/kvision/data | |
parent | 4191287261b46b95908469c2ec3fa9d886681861 (diff) | |
download | kvision-eea44b35add0d036119888f41e4ed38e75190934.tar.gz kvision-eea44b35add0d036119888f41e4ed38e75190934.tar.bz2 kvision-eea44b35add0d036119888f41e4ed38e75190934.zip |
DSL builders returning built components.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/data')
-rw-r--r-- | src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt b/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt index fa545dc8..c008c47b 100644 --- a/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt +++ b/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt @@ -126,7 +126,7 @@ class DataContainer<M : DataComponent, C : Component>( companion object { /** - * DSL builder extension function + * DSL builder extension function. * * It takes the same parameters as the constructor of the built component. */ @@ -135,8 +135,10 @@ class DataContainer<M : DataComponent, C : Component>( binding: (Int) -> C, child: Container = VPanel(), init: (DataContainer<M, C>.() -> Unit)? = null - ) { - this.add(DataContainer(model, binding, child, init)) + ): DataContainer<M, C> { + val dataContainer = DataContainer(model, binding, child, init) + this.add(dataContainer) + return dataContainer } } } |