aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/data
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-02-12 12:00:15 +0100
committerRobert Jaros <rjaros@finn.pl>2018-02-12 12:00:15 +0100
commiteea44b35add0d036119888f41e4ed38e75190934 (patch)
tree01ff2b73042ab08941df082d74241dc5e229a37d /src/main/kotlin/pl/treksoft/kvision/data
parent4191287261b46b95908469c2ec3fa9d886681861 (diff)
downloadkvision-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.kt8
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
}
}
}