Search in sources :

Example 1 with AbstractContainerObject

use of org.knime.workbench.repository.model.AbstractContainerObject in project knime-core by knime.

the class RepositoryManager method removeEmptyCategories.

private static void removeEmptyCategories(final AbstractContainerObject treeNode) {
    for (IRepositoryObject object : treeNode.getChildren()) {
        if (object instanceof AbstractContainerObject) {
            AbstractContainerObject cat = (AbstractContainerObject) object;
            removeEmptyCategories(cat);
            if (!cat.hasChildren() && (cat.getParent() != null)) {
                cat.getParent().removeChild((AbstractContainerObject) object);
            }
        }
    }
}
Also used : AbstractContainerObject(org.knime.workbench.repository.model.AbstractContainerObject) IRepositoryObject(org.knime.workbench.repository.model.IRepositoryObject)

Aggregations

AbstractContainerObject (org.knime.workbench.repository.model.AbstractContainerObject)1 IRepositoryObject (org.knime.workbench.repository.model.IRepositoryObject)1