This is related to my previous question.
I have a TreeView in the center pane of a BorderPane layout. This TreeView is populated by the selection of an element from a list in the left pane. The center view looks like this:
class CenterView : View() {
override val root = TreeView<IStoryItem>()
init {
with(root) {
root = TreeItem(controller.storySet)
setCellFactory {
object : StoryEditorCell() {
init {
System.out.println("Creating StoryEditorCell")
onDragDetected = EventHandler {...}
onDragOver= EventHandler {...}
onDragEntered= EventHandler {...}
...
}
}
}
cellFormat { ... }
populate { ... }
}
}
}
The setCellFactory
function is being called but, for some reason, the init
of the factory itself is never being called. So my Drag/Drop handlers are never set up and my TreeCell
isn't of the correct type.
The cell format is correct and the TreeView
is populated correctly so that part is working right. What else needs to be done to get the cell factory correct?