net.wotonomy.control
Class ChildDataSource

java.lang.Object
  extended by net.wotonomy.control.EODataSource
      extended by net.wotonomy.control.ChildDataSource

public class ChildDataSource
extends EODataSource

A data source that automates the process of creating a child editing context and copying objects from a parent context into it. Attach this data source to a display group that represents a "detail" or "drill-down" view.

Once created, editingContext() will return the child context, and fetch() will return the objects that were copied into the child context.


Constructor Summary
ChildDataSource(EODataSource aParentSource, java.util.Collection anObjectList)
          Creates a child editing context for the specified parent's context and copies the specified objects into the child context.
ChildDataSource(EODataSource aParentSource, java.lang.Object anObject)
          Creates a child editing context for the specified parent's context and copies the specified object into the child context.
 
Method Summary
 EOClassDescription classDescriptionForObjects()
          Returns the description of the class of the objects that is vended by this data source, or null if this cannot be determined.
 EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
          Returns a data source that is capable of manipulating objects of the type returned by applying the specified key to objects vended by this data source.
 void deleteObject(java.lang.Object anObject)
          This implementation does nothing.
 EOEditingContext editingContext()
          Returns the editing context for this data source, which was created in the constructor and whose parent is the editing context specified in the constructor.
 net.wotonomy.foundation.NSArray fetchObjects()
          Returns a List containing the objects in this data source.
 void insertObject(java.lang.Object anObject)
          This implementation does nothing.
 void qualifyWithRelationshipKey(java.lang.String aKey, java.lang.Object anObject)
          Restricts this data source to vend those objects that are associated with the specified key on the specified object.
 
Methods inherited from class net.wotonomy.control.EODataSource
createObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildDataSource

public ChildDataSource(EODataSource aParentSource,
                       java.lang.Object anObject)
Creates a child editing context for the specified parent's context and copies the specified object into the child context. The object must exist in the parent context. fetch() will return the child's object.


ChildDataSource

public ChildDataSource(EODataSource aParentSource,
                       java.util.Collection anObjectList)
Creates a child editing context for the specified parent's context and copies the specified objects into the child context. The objects must exist in the parent context. The order of the parent's objects in the collection will determine the order in which the child objects are returned from fetch().

Method Detail

editingContext

public EOEditingContext editingContext()
Returns the editing context for this data source, which was created in the constructor and whose parent is the editing context specified in the constructor.

Overrides:
editingContext in class EODataSource

insertObject

public void insertObject(java.lang.Object anObject)
This implementation does nothing.

Specified by:
insertObject in class EODataSource

deleteObject

public void deleteObject(java.lang.Object anObject)
This implementation does nothing.

Specified by:
deleteObject in class EODataSource

fetchObjects

public net.wotonomy.foundation.NSArray fetchObjects()
Returns a List containing the objects in this data source. This implementation returns all TestObjects that have been persisted to the datastore in the data directory.

Overrides:
fetchObjects in class EODataSource

dataSourceQualifiedByKey

public EODataSource dataSourceQualifiedByKey(java.lang.String aKey)
Returns a data source that is capable of manipulating objects of the type returned by applying the specified key to objects vended by this data source. This implementation forwards the call to the parent data source.

Specified by:
dataSourceQualifiedByKey in class EODataSource
See Also:
qualifyWithRelationshipKey(java.lang.String, java.lang.Object)

qualifyWithRelationshipKey

public void qualifyWithRelationshipKey(java.lang.String aKey,
                                       java.lang.Object anObject)
Restricts this data source to vend those objects that are associated with the specified key on the specified object. This implementation forwards the call to the parent data source.

Specified by:
qualifyWithRelationshipKey in class EODataSource

classDescriptionForObjects

public EOClassDescription classDescriptionForObjects()
Returns the description of the class of the objects that is vended by this data source, or null if this cannot be determined. This implementation returns the class of the objects passed to the constructor if they are all the same class, otherwise returns null.

Overrides:
classDescriptionForObjects in class EODataSource


Copyright © 2006 null. All Rights Reserved.