net.wotonomy.ui
Class MasterDetailAssociation

java.lang.Object
  extended by net.wotonomy.control.EODelayedObserver
      extended by net.wotonomy.ui.EOAssociation
          extended by net.wotonomy.ui.MasterDetailAssociation
All Implemented Interfaces:
java.util.Observer, net.wotonomy.control.EOObserving
Direct Known Subclasses:
MirrorDetailAssociation

public class MasterDetailAssociation
extends EOAssociation

MasterDetailAssociation binds a display group to a property on the selected object of another display group. Bindings are:

Version:
$Revision: 904 $
Author:
michael@mpowers.net, $Author: cgruber $

Field Summary
protected  net.wotonomy.foundation.NSMutableArray observableArray
          Used to be notified of changes to objects in the controlled display group.
 
Fields inherited from class net.wotonomy.ui.EOAssociation
ActionAspect, ArgumentAspect, aspectToGroup, aspectToKey, AttributeAspectSignature, AttributeToManyAspectSignature, AttributeToOneAspectSignature, AttributeToOneToManyAspectSignature, BoldAspect, ChildrenAspect, control, DestinationAspect, EditableAspect, EnabledAspect, IconAspect, IsLeafAspect, ItalicAspect, LabelAspect, NullAspectSignature, ObjectsAspect, ParentAspect, SelectedObjectAspect, SelectedTitleAspect, SourceAspect, TitlesAspect, ToManyAspectSignature, ToOneAspectSignature, ToOneToManyAspectSignature, URLAspect, ValueAspect, VisibleAspect
 
Fields inherited from class net.wotonomy.control.EODelayedObserver
ObserverNumberOfPriorities, ObserverPriorityFifth, ObserverPriorityFirst, ObserverPriorityFourth, ObserverPriorityImmediate, ObserverPriorityLater, ObserverPrioritySecond, ObserverPrioritySixth, ObserverPriorityThird
 
Constructor Summary
MasterDetailAssociation(java.lang.Object anObject)
          Constructor expecting an EODisplayGroup.
 
Method Summary
static net.wotonomy.foundation.NSArray aspects()
          Returns a List that describes the aspects supported by this class.
static net.wotonomy.foundation.NSArray aspectSignatures()
          Returns a List of aspect signatures whose contents correspond with the aspects list.
static net.wotonomy.foundation.NSArray associationClassesSuperseded()
          Returns a List of EOAssociation subclasses that, for the objects that are usable for this association, are less suitable than this association.
 void breakConnection()
          Breaks the connection between this association and its object.
 boolean canBindAspect(java.lang.String anAspect, EODisplayGroup aDisplayGroup, java.lang.String aKey)
          Returns whether this association can bind to the specified display group on the specified key for the specified aspect.
 void establishConnection()
          Establishes a connection between this association and the controlled object.
static boolean isUsableWithObject(java.lang.Object anObject)
          Returns whether this class can control the specified object.
static net.wotonomy.foundation.NSArray objectKeysTaken()
          Returns a List of properties of the controlled object that are controlled by this class.
 void objectWillChange(java.lang.Object anObject)
          Overridden to intercept notifications of changes to objects in the controlled display group and broadcast a change on the parent group's selected object.
static java.lang.String primaryAspect()
          Returns the aspect that is considered primary or default.
 int priority()
          This implementation returns ObserverPrioritySecond so that master detail assocations are notified before other associations.
protected  void requalify()
          Called by subjectChanged() to requalify the controlled display group with the selected object and the bound key.
 void subjectChanged()
          Called when either the selection or the contents of an associated display group have changed.
 
Methods inherited from class net.wotonomy.ui.EOAssociation
associationClassesForObject, bindAspect, copyMatchingBindingsFromAssociation, displayGroupForAspect, displayGroupKeyForAspect, displayName, endEditing, object, setValueForAspect, setValueForAspectAtIndex, shouldEndEditing, shouldEndEditingAtIndex, valueForAspect, valueForAspectAtIndex
 
Methods inherited from class net.wotonomy.control.EODelayedObserver
discardPendingNotification, observerQueue, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

observableArray

protected net.wotonomy.foundation.NSMutableArray observableArray
Used to be notified of changes to objects in the controlled display group. requalify() should place all objects fetched into the controlled group into this array. Otherwise, the parent object is only marked as changed for inserts and deletes.

Constructor Detail

MasterDetailAssociation

public MasterDetailAssociation(java.lang.Object anObject)
Constructor expecting an EODisplayGroup. If the controlled display group does not have a data source, a new PropertyDataSource will be used.

Method Detail

aspectSignatures

public static net.wotonomy.foundation.NSArray aspectSignatures()
Returns a List of aspect signatures whose contents correspond with the aspects list. Each element is a string whose characters represent a capability of the corresponding aspect. An empty signature "" means that the aspect can bind without needing a key. This implementation returns "A1M" for each element in the aspects array.


aspects

public static net.wotonomy.foundation.NSArray aspects()
Returns a List that describes the aspects supported by this class. Each element in the list is the string name of the aspect. This implementation returns an empty list.


associationClassesSuperseded

public static net.wotonomy.foundation.NSArray associationClassesSuperseded()
Returns a List of EOAssociation subclasses that, for the objects that are usable for this association, are less suitable than this association.


isUsableWithObject

public static boolean isUsableWithObject(java.lang.Object anObject)
Returns whether this class can control the specified object.


objectKeysTaken

public static net.wotonomy.foundation.NSArray objectKeysTaken()
Returns a List of properties of the controlled object that are controlled by this class. For example, "stringValue", or "selected".


primaryAspect

public static java.lang.String primaryAspect()
Returns the aspect that is considered primary or default. This is typically "value" or somesuch.


canBindAspect

public boolean canBindAspect(java.lang.String anAspect,
                             EODisplayGroup aDisplayGroup,
                             java.lang.String aKey)
Returns whether this association can bind to the specified display group on the specified key for the specified aspect.

Overrides:
canBindAspect in class EOAssociation

establishConnection

public void establishConnection()
Establishes a connection between this association and the controlled object. Subclasses should begin listening for events from their controlled object here.

Overrides:
establishConnection in class EOAssociation

breakConnection

public void breakConnection()
Breaks the connection between this association and its object. Override to stop listening for events from the object.

Overrides:
breakConnection in class EOAssociation

subjectChanged

public void subjectChanged()
Called when either the selection or the contents of an associated display group have changed.

Overrides:
subjectChanged in class EOAssociation

objectWillChange

public void objectWillChange(java.lang.Object anObject)
Overridden to intercept notifications of changes to objects in the controlled display group and broadcast a change on the parent group's selected object. All other notifications are passed to the super implementation.

Specified by:
objectWillChange in interface net.wotonomy.control.EOObserving
Overrides:
objectWillChange in class net.wotonomy.control.EODelayedObserver

requalify

protected void requalify()
Called by subjectChanged() to requalify the controlled display group with the selected object and the bound key.


priority

public int priority()
This implementation returns ObserverPrioritySecond so that master detail assocations are notified before other associations.

Overrides:
priority in class net.wotonomy.control.EODelayedObserver


Copyright © 2006 null. All Rights Reserved.