if (parent == null) {
return tree.isNodeExpanded();
}
TreeState treestate = tree.getDataModel().getTreeState();
String[] ids = tree.getPathInformation(tree.getNodeId());
if (ids.length < 3) {
return false;
}
String parentIdentifier = ids[ids.length - 2];
if (treestate.isNodeExpanded(parentIdentifier)) {
int siblingCount = parent.getChildCount();
for (int i = 0; i < siblingCount; i++) {
String childIdentifier = parentIdentifier + ":" + i;
if (treestate.isNodeExpanded(childIdentifier)) {
return false;
}
}
} else {
return false;