edvin
08/20/2017, 8:51 AMedvin
08/20/2017, 8:56 AMSequence
before iterating could actually be detrimental to performance. Using immediate operations allow the CPU to utilize it's cache and as well as other optimizations like prefetching.thomasnield
08/20/2017, 4:11 PMpike
08/21/2017, 7:34 AMpike
08/21/2017, 7:38 AMedvin
08/21/2017, 8:40 AMedvin
08/21/2017, 8:55 AMPerson
object has a parent
property which is also of of type Person
. To create a column for the parent name, we
have several options. Our first attempt is simply extracting the name property manually:
column<Person, String>("Parent name", { it.value.parentProperty.value.nameProperty })
While this works, it has one major drawback. If the parent changes, the list won't be updated. We can partially remedy this
by defining the value for the property as the parent itself, and formatting it's name:
column("Parent name", Person::parentProperty).cellFormat {
textProperty().bind(it.parentProperty.value.nameProperty)
}
It might still not update right away, even though it would eventually become consistent as the TableView refreshes.
To create a binding that would reflect a change to the parent property immediately, consider using a select binding:
column<Person, String>("Parent name", { it.value.parentProperty.select(Person::nameProperty) })
edvin
08/21/2017, 8:57 AMitems.sizeProperty.stringBinding { "$it items in the table" }
edvin
08/21/2017, 8:57 AMabhinay
08/21/2017, 10:53 AMedvin
08/21/2017, 11:10 AMjchildress
08/21/2017, 11:50 AMedvin
08/21/2017, 11:51 AMpike
08/21/2017, 11:52 AMpike
08/21/2017, 11:52 AMthomasnield
08/21/2017, 11:55 AMedvin
08/21/2017, 11:56 AMdr.fornax
08/21/2017, 12:14 PMedvin
08/21/2017, 12:16 PMdr.fornax
08/21/2017, 12:19 PMedvin
08/21/2017, 12:21 PMdr.fornax
08/21/2017, 12:21 PMdr.fornax
08/21/2017, 12:22 PMdr.fornax
08/21/2017, 12:25 PMdr.fornax
08/21/2017, 12:26 PMdr.fornax
08/21/2017, 12:27 PMedvin
08/21/2017, 12:29 PMdr.fornax
08/21/2017, 12:32 PMdr.fornax
08/21/2017, 12:32 PMdr.fornax
08/21/2017, 12:37 PM