Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Use a custom callback to determine the style of the tree item
- layersTree.setCellFactory(new Callback<TreeView<String>, TreeCell<String>>() {
- @Override
- public TreeCell<String> call(TreeView<String> param) {
- return new CheckBoxTreeCell<String>(){
- @Override
- public void updateItem(String item, boolean empty){
- super.updateItem(item, empty);
- // If there is no information for the Cell, make it empty
- if(empty){
- setGraphic(null);
- setText(null);
- // Otherwise if it's not representation as an item of the tree
- // is not a CheckBoxTreeItem, remove the checkbox item
- }else if (!(getTreeItem() instanceof CheckBoxTreeItem)){
- setGraphic(null);
- }
- }
- };
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement