I tried to change the BackgroundColor of specific TreeNodes during runtime inside my Class which contains my TreeViewer, but it doesn't work:
....
Display display = Display.getCurrent();
for (TreeItem item : treeItems) {
if (item.getParentItem() != null) {
Object parentElement = item.getParentItem().getData();
if(parentElement instanceof Or){
System.out.println(item);
Color color = new Color(display,12, 197, 77);
item.setBackground(color);
item.setForeground(color);
}
}
}
......
I'm wondering why this doesn't work, as TreeItem has the according methods for this.
Note that I don't want to use my Labelprovider for this, as I've to check several dependencies between nodes to determine the right Color and therefor, the Labelprovider don't fit in.
Cheers, Phil