Hey guys I have been struggling to figure out a solution to my problem. I want to implement a ControlsFX CheckTreeView into my JavaFx app. Basically I have a List of String that are formatted to match a navigation bar on a website. So far example Admin.Config.User would be one of the Strings. I have already parsed these String and converted them into LinkedHashMap where each parent that has children that will store a list of each child and the child's CheckBoxTreeItem.
When creating the CheckTreeView object you can pass the Root CheckBoxTreeItem or initialize with no arguments.
CheckBoxTreeItem Documentation
I'm having a really hard time visualizing how to build a tree bottom up to a root CheckBoxTreeItem.
// Contains the Nodes with children and corresponding CheckBoxTreeItems
LinkedHashMap<String, LinkedHashMap<String, CheckBoxTreeItem<String>>> navPaths = new LinkedHashMap<String, LinkedHashMap<String, CheckBoxTreeItem<String>>>();
// Was thinking about using this as a check to make sure duplicates are not added
LinkedHasMap<String, String> alreadyAdded = new LinkedHashMap<String, String>
// Check Tree View
CheckTreeView<String> checkTreeView = new CheckTreeView<>();
for(String pathNode : navPaths.keySet()){
for(String childName : testPaths.get(pathNode).keySet()){
// Completely lost once I get here
}
}
// Set built root
//checkTreeView.setRoot();
I'm really struggling with this concept so much that I haven't gotten very far and I apologize if it appears I have not put any effort forward. I have been thinking about this concept for the past 12 hours and I'm just getting no where with it. If anyone could provide me with some help that would be great thanks.