Hullaballoonatic
07/16/2020, 9:47 PMMarshall
07/17/2020, 12:51 PMMarshall
07/17/2020, 12:51 PMval items = FXCollections.observableArrayList<DrawerItem>()
Marshall
07/17/2020, 12:52 PMHullaballoonatic
07/17/2020, 8:18 PMMarshall
07/17/2020, 8:27 PMBindings.bindContent(A, B)
between two lists of the same type to keep the lists in syncHullaballoonatic
07/17/2020, 8:28 PMHullaballoonatic
07/17/2020, 8:28 PMMarshall
07/17/2020, 8:28 PMHullaballoonatic
07/17/2020, 8:29 PMMarshall
07/17/2020, 8:30 PMMarshall
07/17/2020, 8:35 PMMarshall
07/17/2020, 8:35 PM/**
* Bind this list to the given observable list by converting them into the correct type via the given converter.
* Changes to the observable list are synced.
*/
fun <SourceType, TargetType> MutableList<TargetType>.bind(sourceSet: ObservableSet<SourceType>, converter: (SourceType) -> TargetType): SetConversionListener<SourceType, TargetType> {
Marshall
07/17/2020, 8:35 PMMarshall
07/17/2020, 8:37 PMfun <SourceTypeKey, SourceTypeValue, TargetType> MutableList<TargetType>.bind(
sourceMap: ObservableMap<SourceTypeKey, SourceTypeValue>,
converter: (SourceTypeKey, SourceTypeValue) -> TargetType
): MapConversionListener<SourceTypeKey, SourceTypeValue, TargetType> {
Hullaballoonatic
07/17/2020, 8:39 PMMarshall
07/17/2020, 8:39 PMfun <SourceType, TargetType> MutableList<TargetType>.bind(sourceList: ObservableList<SourceType>, converter: (SourceType) -> TargetType): ListConversionListener<SourceType, TargetType> {
Marshall
07/17/2020, 8:41 PMMarshall
07/17/2020, 8:42 PMMarshall
07/17/2020, 8:42 PMval targetList = mutableListOf<String>().asObservable()
val sourceList = mutableListOf<Int>().asObservable()
targetList.bind(sourceList) {
it.toString()
}
Marshall
07/17/2020, 8:42 PMMarshall
07/17/2020, 8:43 PMHullaballoonatic
07/17/2020, 8:45 PMHullaballoonatic
07/17/2020, 8:53 PM