public class Bag { public String caption,assignment=""; Boolean eval; public Set<Vertex> Nodes = new HashSet<Vertex>(); public Vector<Bag> ChildBags = new Vector<Bag>(); @Override public String toString() { return assignment+ " " +caption; } }
.true{ -fx-text-fill:#33cc00 ; } .assignment{ -fx-text-fill: #0033cc }
TreeView<Bag> treeView = new TreeView(root); treeView.getStylesheets().add("format.css"); PseudoClass childPseudoClass = PseudoClass.getPseudoClass("child"); treeView.setCellFactory(tv -> new TreeCell<Bag>() { @Override protected void updateItem(Bag item, boolean empty) { super.updateItem(item, empty); if (empty || item == null) { } else { if(item.eval==true){ //how to assign different style to different components } } } });
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)