but yeah <@U3KRGN7GS> the first and most overt thi...
# random
g
but yeah @nounours the first and most overt thing to me to notice is that your if structure can be an expression:
Copy code
super.updateItem(item, empty)
this.setText(isEmpty ? null : item.toString())
the next thing, if you really dont want to use javafx's built in
StringConverter
system designed for exactly this purpose, would then be to extract a generic type and a delegate:
Copy code
//kotlin
class MyListCell<T>(val toStringDelegate: (T) -> String){
  override fun updateItem(item: T?, empty: Boolean){
    super.updateItem(item, empty)
    this.text = if(item == null) null else toStringDelegate.invoke(item)
  }
}
then you can probably inline your four methods to their callsite
Copy code
createEvaluableCell()
//becomes simpl
new MyListCell(evaluable -> evaluable.getResultSymbol().getCanonicalName())