WebObjects 5.2.3

com.webobjects.eointerface
Class EOMasterDetailAssociation

java.lang.Object
  extended bycom.webobjects.eocontrol.EODelayedObserver
      extended bycom.webobjects.eointerface.EOAssociation
          extended bycom.webobjects.eointerface.EOMasterAssociation
              extended bycom.webobjects.eointerface.EOMasterDetailAssociation
All Implemented Interfaces:
EOObserving, NSDisposable
Direct Known Subclasses:
EOMasterPeerAssociation

public class EOMasterDetailAssociation
extends EOMasterAssociation

An EOMasterDetailAssociation object binds one EODisplayGroup (the detail) to a relationship in another (the master), so that the detail display group contains the destination objects for the object selected in the master. The display group's data sources also operate in a master-detail arrangement, meaning changes to one are immediately reflected in the other. In this arrangement, the detail EODisplayGroup's data source must be an EODetailDataSource. The detail objects are taken directly from the selected object in the master EODisplayGroup, so that changes to the objects in one EODisplayGroup are instantly reflected in the other.

In com.webobjects.eointerface.cocoa, by contrast, with an EOMasterPeerAssociation, the two EODisplayGroups are independent of each other. In a master-peer setup, insertions and deletions in the detail EODisplayGroup don't affect the corresponding relationship property of the selected object in the master EODisplayGroup. Master-peer setups are more appropriate when no insertions or deletions will be made in the detail EODisplayGroup. See the EOMasterPeerAssociation class specification for more information.


Usable With:
EODisplayGroup with a null or detail datasource

Aspects

parentAn EODisplayGroup with which the association's display group should be synchronized.

Example

Suppose you have a master EODisplayGroup displaying Movie objects and a detail display group displaying Talent objects. The two display groups are bound to one another through Movie's directors relationship -- a to-many relationship from Movie to Talent. When a Movie is selected, you want the Talent display group to display the Talents who directed the Movie. Inserting a new director into the Talent display group should add the director to the selected Movie's directors relationship; and similarly, deleting a director from the Talent display group should remove the director from the selected Movie's directors relationship.

To do this, in Interface Builder, Control-drag a connection from the Talent display group to the Movie display group. In the Connections inspector, choose EOMasterDetailAssociation, and bind parent aspect to the directors key.


Field Summary
 
Fields inherited from class com.webobjects.eointerface.EOAssociation
ActionAspect, ArgumentAspect, AttributeAspectSignature, AttributeToManyAspectSignature, AttributeToOneAspectSignature, AttributeToOneToManyAspectSignature, BackgroundColorAspect, BoldAspect, ChildrenAspect, DestinationAspect, EnabledAspect, ExpandedIconAspect, IconAspect, IgnoreValue, IsLeafAspect, ItalicAspect, MatchKey1Aspect, MatchKey2Aspect, MatchKey3Aspect, NullAspectSignature, ParentAspect, RootAspect, SelectedIndexAspect, SelectedObjectAspect, SelectedTitleAspect, SetValue, SourceAspect, TextColorAspect, TitlesAspect, ToManyAspectSignature, ToOneAspectSignature, ToOneToManyAspectSignature, UnsetValue, URLAspect, ValueAspect
 
Fields inherited from class com.webobjects.eocontrol.EODelayedObserver
ObserverNumberOfPriorities, ObserverPriorityFifth, ObserverPriorityFirst, ObserverPriorityFourth, ObserverPriorityImmediate, ObserverPriorityLater, ObserverPrioritySecond, ObserverPrioritySixth, ObserverPriorityThird
 
Constructor Summary
EOMasterDetailAssociation(Object object)
          Creates a new EOMasterDetailAssociation to monitor and update the objects in object, an EODisplayGroup.
 
Method Summary
 void dispose()
          Clears all references this association has to other objects, especially its display object and EODisplayGroup.
 boolean isUsableWithObject(Object object)
          Returns true if object is an instance of EODisplayGroup and its data source is either null or an EODetailDataSource (EOControl).
 void subjectChanged()
          See the subjectChanged method description in the superclass EOAssociation.
 
Methods inherited from class com.webobjects.eointerface.EOMasterAssociation
primaryAspect, priority
 
Methods inherited from class com.webobjects.eointerface.EOAssociation
aspects, aspectSignatures, associationClassesForObject, bindAspect, breakConnection, copyMatchingBindingsFromAssociation, displayGroupForAspect, displayGroupKeyForAspect, endEditing, establishConnection, isConnected, isEnabled, isEnabledAtIndex, isExplicitlyDisabled, object, objectKeysTaken, registerAssociationClass, setExplicitlyDisabled, setObject, setValueForAspect, setValueForAspectAtIndex, shouldEndEditing, shouldEndEditingAtIndex, valueForAspect, valueForAspectAtIndex
 
Methods inherited from class com.webobjects.eocontrol.EODelayedObserver
discardPendingNotification, objectWillChange, observerQueue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOMasterDetailAssociation

public EOMasterDetailAssociation(Object object)
Creates a new EOMasterDetailAssociation to monitor and update the objects in object, an EODisplayGroup. You normally set up associations with Interface Builder, in which case you don't need to create them programmatically. However, if you do create them up programmatically, setting them up is a multi-step process. After creating an association, you must bind its aspects and establish its connections.

Parameters:
object - EODisplayGroup for this association to monitor and update
See Also:
EOAssociation.bindAspect(java.lang.String, com.webobjects.eointerface.EODisplayGroup, java.lang.String), EOAssociation.establishConnection()
Method Detail

dispose

public void dispose()
Clears all references this association has to other objects, especially its display object and EODisplayGroup. Call this method before nulling out a reference to this association to ensure it gets garbage collected properly. Subclasses should override this method to do any additional cleanup that may be needed and invoke super's implementation at the end.

Specified by:
dispose in interface NSDisposable
Overrides:
dispose in class EOAssociation
See Also:
NSDisposable

isUsableWithObject

public boolean isUsableWithObject(Object object)
Returns true if object is an instance of EODisplayGroup and its data source is either null or an EODetailDataSource (EOControl).

Overrides:
isUsableWithObject in class EOMasterAssociation
Parameters:
object - this method should verify that object is usable with the association.
Returns:
true if object is an instance of EODisplayGroup and its data source is either null or an EODetailDataSource (EOControl)
See Also:
EOAssociation.isUsableWithObject(java.lang.Object)

subjectChanged

public void subjectChanged()
See the subjectChanged method description in the superclass EOAssociation.

Overrides:
subjectChanged in class EOAssociation
See Also:
EOAssociation.subjectChanged()

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.