* <code>TableTree</code> if the node is the root node or a
* <code>TreeItem</code> otherwise.
*/
private void updateChildrenOf(Object node, Widget widget) {
// cast the entry or category
IPropertySheetEntry entry = null;
PropertySheetCategory category = null;
if (node instanceof IPropertySheetEntry) {
entry = (IPropertySheetEntry) node;
} else {
category = (PropertySheetCategory) node;
}
// get the current child tree items
TreeItem[] childItems = getChildItems(widget);
// optimization! prune collapsed subtrees
TreeItem item = null;
if (widget instanceof TreeItem) {
item = (TreeItem) widget;
}
if (item != null && !item.getExpanded()) {
// remove all children
for (int i = 0; i < childItems.length; i++) {
if (childItems[i].getData() != null) {
removeItem(childItems[i]);
}
}
// append a dummy if necessary
if (category != null || entry.hasChildEntries()) {
// may already have a dummy
// It is either a category (which always has at least one child)
// or an entry with chidren.
// Note that this test is not perfect, if we have filtering on
// then there in fact may be no entires to show when the user