Is it possible to activate multiple selection for a JavaFX TreeView with FXML?
If you want to set the selection mode programmatically, you would call
treeView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
But how can that be described in FXML? The best I came up with for now was:
<?import javafx.scene.control.TreeView.TreeViewBitSetSelectionModel?>
...
<TreeView>
<selectionModel>
<TreeViewBitSetSelectionModel selectionMode="MULTIPLE"/>
</selectionModel>
</TreeView>
This leads to this exception:
javafx.fxml.LoadException: TreeViewBitSetSelectionModel is not a valid type.
I assume that this is either because is not a public class or because it only has a non default constructor.
I read in the FXML documentation, that there are builders for various types, but I did not see a Builder or a Factory for selection model classes. Did I miss this?
Any hints on how to achieve this are very welcome!