Author: charles.crouch(a)jboss.com
Date: 2009-04-27 12:17:22 -0400 (Mon, 27 Apr 2009)
New Revision: 350
Modified:
trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java
Log:
EMBJOPR-166 add support for adding resources to types which werent initially in the nav.
Modified: trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java
===================================================================
--- trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java 2009-04-27
15:25:46 UTC (rev 349)
+++ trunk/core/src/main/java/org/jboss/on/embedded/ui/NavigationContent.java 2009-04-27
16:17:22 UTC (rev 350)
@@ -72,7 +72,15 @@
+ "] - updating nav tree...");
JONTreeNode parentResourceNode = findNode(getResourcePath(parentResource));
JONTreeNode resourceTypeNode = findNodeByResourceTypeAndParent(typeOfNewResource,
parentResourceNode);
- resourceTypeNode.reInitializeChildrenMap();
+ if (resourceTypeNode == null) {
+ // the resource type node doesn't exist yet, so lets refresh its parent to
give it a chance
+ // to be generated. This would be the case for non-singleton resource types
which started off
+ // with no children and can't have resource added directly to them, e.g.
Embedded EJB deployments.
+ parentResourceNode.reInitializeChildrenMap();
+ } else {
+ resourceTypeNode.reInitializeChildrenMap();
+ }
+
}
@Observer(ResourceManager.RESOURCE_DELETED_EVENT)
Show replies by date