Author: julien(a)jboss.com
Date: 2007-12-21 16:36:43 -0500 (Fri, 21 Dec 2007)
New Revision: 9380
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIManagedObject.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContainer.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContext.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectOneToMany.java
Log:
move the relationship fields from the managed object to its context
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIManagedObject.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIManagedObject.java 2007-12-21
21:28:29 UTC (rev 9379)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIManagedObject.java 2007-12-21
21:36:43 UTC (rev 9380)
@@ -52,12 +52,6 @@
/** The context. */
protected final UIObjectContext context;
- /** . */
- final UIObjectOneToMany childrenRelationship;
-
- /** . */
- final UIObjectManyToOne parentRelationship;
-
public UIManagedObject(UIObjectContext context)
{
if (context == null)
@@ -67,8 +61,6 @@
//
this.context = context;
- this.childrenRelationship = new UIObjectOneToMany(context);
- this.parentRelationship = new UIObjectManyToOne(context);
}
// UIObject interface implementation
--------------------------------------------------------------------------------
@@ -296,7 +288,7 @@
}
//
- return parentRelationship.get();
+ return context.parent.get();
}
public final List<UIContainerObject> getChildren()
@@ -307,7 +299,7 @@
}
//
- return childrenRelationship.get();
+ return context.children.get();
}
public final <T extends UIObject> T createChild(String name, Class<T>
type) throws IllegalArgumentException
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContainer.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContainer.java 2007-12-21
21:28:29 UTC (rev 9379)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContainer.java 2007-12-21
21:36:43 UTC (rev 9380)
@@ -357,8 +357,8 @@
//
context.structuralObject = structuralObject;
- context.managedObject.parentRelationship.clear();
- context.managedObject.childrenRelationship.clear();
+ context.parent.clear();
+ context.children.clear();
}
//
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContext.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContext.java 2007-12-21
21:28:29 UTC (rev 9379)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectContext.java 2007-12-21
21:36:43 UTC (rev 9380)
@@ -41,17 +41,23 @@
{
/** . */
- UIObjectContainer container;
+ final UIObjectContainer container;
/** . */
+ final UIManagedObject managedObject;
+
+ /** . */
+ final UIObjectOneToMany children;
+
+ /** . */
+ final UIObjectManyToOne parent;
+
+ /** . */
StructuralObject structuralObject;
/** . */
UIObject.Status status;
- /** . */
- UIManagedObject managedObject;
-
public UIObjectContext(UIObjectContainer container, StructuralObject
structuralObject)
{
if (container == null)
@@ -68,6 +74,8 @@
this.structuralObject = structuralObject;
this.status = UIObject.Status.VALID;
this.managedObject = new UIManagedObject(this);
+ this.children = new UIObjectOneToMany(this);
+ this.parent = new UIObjectManyToOne(this);
}
// Public
***********************************************************************************************************
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectOneToMany.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectOneToMany.java 2007-12-21
21:28:29 UTC (rev 9379)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/container/UIObjectOneToMany.java 2007-12-21
21:36:43 UTC (rev 9380)
@@ -65,10 +65,14 @@
{
throw new IllegalStateException("Relationship not valid");
}
+
+ // Load the entire relationship
if (content == null)
{
content = owner.container.getChildren(owner.structuralObject);
}
+
+ //
return content.get(i);
}
Show replies by date