Author: ips
Date: 2010-05-26 12:13:35 -0400 (Wed, 26 May 2010)
New Revision: 942
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/ui/nav/BaseTreeNode.java
Log:
only add a child node for a subcategory if the subcategory contains either at least one
child subcategory or at least one child resource type
Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/nav/BaseTreeNode.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/nav/BaseTreeNode.java 2010-05-25
20:22:40 UTC (rev 941)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/nav/BaseTreeNode.java 2010-05-26
16:13:35 UTC (rev 942)
@@ -1,6 +1,6 @@
/*
* Embedded Jopr Project
- * Copyright (C) 2006-2009 Red Hat, Inc.
+ * Copyright (C) 2006-2010 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,6 @@
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-
package org.jboss.on.embedded.ui.nav;
import java.util.ArrayList;
@@ -276,7 +275,12 @@
Set<ResourceSubCategory> sortedSubCategories = new
TreeSet<ResourceSubCategory>(subCategories);
for (ResourceSubCategory subCategory : sortedSubCategories)
{
- addChild(new SubCategoryTreeNode(getUniqueKey(), subCategory,
parentResource));
+ // Only add a child node for the subcategory if the subcategory contains
either at least one child
+ // subcategory or at least one child resource type.
+ if (!subCategory.getChildSubCategories().isEmpty() ||
!subCategory.findTaggedResourceTypes().isEmpty())
+ {
+ addChild(new SubCategoryTreeNode(getUniqueKey(), subCategory,
parentResource));
+ }
}
}
Show replies by date