Is it possible to have the OpenCloseButton show even if there are no children below an item?
I am trying to build something that is like a PropertyPanel but with a list of items instead of PropertyComponents.
The way I have t working is by creating a tree that is only two items deep. When I draw the first level items I set the background color. If there are no children, there is no OpenCloseButton and the background is white.
In case anyone else has this problem i figured out the solution.
If you want your drawTreeviewPlusMinusBox called no matter what you need to return true from mightContainSubItems. Normally you would do something like this
return tree.getNumChildren() > 0;
I changed it to this for my app
int id = tree.getProperty("id");
if (id == 0)
return true;
else
return tree.getNumChildren() > 0;