it.unibo.tuprolog.ui.gui.ListCellView.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ide Show documentation
Show all versions of ide Show documentation
Customisable, JavaFX-based GUI for logic solvers
package it.unibo.tuprolog.ui.gui
import javafx.scene.Node
import javafx.scene.control.ListCell
class ListCellView(private val viewGenerator: (T) -> Node) : ListCell() {
override fun updateItem(
item: T?,
empty: Boolean,
) {
super.updateItem(item, empty)
graphic =
if (empty || item == null) {
null
} else {
viewGenerator(item)
}
}
}