carlw
08/23/2018, 9:07 PMcarlw
08/23/2018, 9:07 PMcarlw
08/23/2018, 9:08 PMchickenfresh
08/23/2018, 9:41 PMpike
08/24/2018, 12:53 AMedvin
08/24/2018, 5:29 AMedvin
08/24/2018, 5:29 AMedvin
08/24/2018, 5:29 AMedvin
08/24/2018, 5:30 AMchickenfresh
08/24/2018, 5:41 AMtext-align = center
, how would it look like in there?edvin
08/24/2018, 5:43 AMedvin
08/24/2018, 5:43 AMedvin
08/24/2018, 5:43 AMlabel("Centered").addClass(MyStyles.centeredText)
chickenfresh
08/24/2018, 5:46 AMedvin
08/24/2018, 7:22 AMRoman
08/24/2018, 11:39 AMcarlw
08/24/2018, 11:42 AMcarlw
08/24/2018, 11:46 AMbeepdog
08/24/2018, 12:43 PMcarlw
08/24/2018, 12:47 PMcarlw
08/24/2018, 12:48 PMchickenfresh
08/24/2018, 1:30 PMsealed class
so I’d be able to use different objects in a same listview
, each of models have its id
but I’m unable to reach it with find
and removeIf
function. How can I do that? I can show off the code if you need it to understand my questioncarlw
08/24/2018, 1:42 PMchickenfresh
08/24/2018, 2:09 PMmutableListOf
?
I have this for now:
val itemsList = FXCollections.observableArrayList<SingleKindModel>()
thats how my itemlist
looks like, on selection I’m using this:
curSelectedItem.value = itemsList.find { it.id == itemid }
it works good with this model:
class SingleKindModel(val id: Int) {
constructor(item: Item) : this(
item.id)
}
but I wanna use another-kind-models in a same list, so new class looks like this in my case:
sealed class ItemViewInstance {
data class Item1(val item1: SingleKindModel): ItemViewInstance()
data class Item2(val item2: SecondKindModel): ItemViewInstance()
}
so SingleKindModel
in itemsList
changes to ItemViewInstance
and itemsList.find { it.id == itemid }
no longer workscarlw
08/24/2018, 2:44 PMseiv
08/24/2018, 3:24 PMchickenfresh
08/24/2018, 4:33 PMchickenfresh
08/24/2018, 4:58 PMalignment = Pos.BASELINE_CENTER
didnt put label in center 🧐carlw
08/24/2018, 5:01 PMcarlw
08/24/2018, 5:01 PM