Author: julien(a)jboss.com
Date: 2008-03-27 06:49:24 -0400 (Thu, 27 Mar 2008)
New Revision: 10391
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model2/Refresh.java
Log:
more compact code
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model2/Refresh.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model2/Refresh.java 2008-03-27
10:45:01 UTC (rev 10390)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model2/Refresh.java 2008-03-27
10:49:24 UTC (rev 10391)
@@ -366,42 +366,37 @@
{
return false;
}
-
- //
- context.addObject(object);
-
- //
- if (tmp == ObjectTraversalType.RECURSIVE)
+ else
{
- Collection<StructuralObject> structuralChildren =
structuralStateContext.loadChildren(object.structuralObject);
+ context.addObject(object);
//
- Map<String, UIObjectImpl.ChildRef> childrenRefs = new
HashMap<String, UIObjectImpl.ChildRef>(structuralChildren.size());
-
- //
- context.createChildren(structuralObject.getId());
-
- //
- for (StructuralObject structuralChild : structuralChildren)
+ if (tmp == ObjectTraversalType.RECURSIVE)
{
- boolean loaded = load(structuralChild);
+ Collection<StructuralObject> structuralChildren =
structuralStateContext.loadChildren(object.structuralObject);
+ Map<String, UIObjectImpl.ChildRef> childrenRefs = new
HashMap<String, UIObjectImpl.ChildRef>(structuralChildren.size());
+ context.createChildren(structuralObject.getId());
//
- childrenRefs.put(structuralChild.getId(), new
UIObjectImpl.ChildRef(structuralChild.getId(), loaded));
-
- //
- if (loaded)
+ for (StructuralObject structuralChild : structuralChildren)
{
- context.addChild(structuralObject.getId(), structuralChild.getId());
+ boolean loaded = load(structuralChild);
+ childrenRefs.put(structuralChild.getId(), new
UIObjectImpl.ChildRef(structuralChild.getId(), loaded));
+
+ //
+ if (loaded)
+ {
+ context.addChild(structuralObject.getId(),
structuralChild.getId());
+ }
}
+
+ // Update
+ object.childrenRefs = childrenRefs;
}
- // Update
- object.childrenRefs = childrenRefs;
+ //
+ return true;
}
-
- //
- return true;
}
finally
{