- Inherits from:
 - (com.apple.client.eointerface) EODelayedObserver (EOControl) : Object
 
(com.apple.yellow.eointerface) EODelayedObserver (EOControl) : NSObject
- Implements:
 - EOObserving (EODelayedObserver)
 - (com.apple.client.eointerface only) NSDisposable
 
- Package:
 - com.apple.client.eointerface
 - com.apple.yellow.eointerface
 
An EOAssociation maintains a two-way binding between the properties of a display object, such as a text field or combo box, and the properties of one or more enterprise objects contained in one or more EODisplayGroups. You typically create and configure associations in Interface Builder, using the programmatic interface only when you write your own EOAssociation subclasses.
value and enabled)EOAssociation defines the mechanism that transfers values between EODisplayGroups and the user interface of an application. An EOAssociation instance is tied to a single display object, a user interface object or other kind of object that manages values intended for display. The EOAssociation takes over certain outlets of the display object and sets its value according to the selection in the EODisplayGroup. An EOAssociation also has various aspects, which define the different parameters of the display object that it controls, such as the value or values displayed and whether the display object is enabled or editable. Each aspect can be bound to an EODisplayGroup with a key denoting a property of the enterprise objects in the EODisplayGroup. The value or values of this property determine the value for the EOAssociation's aspect.
EOAssociation is an abstract class, defining only the general mechanism for binding display objects to EODisplayGroups. You always create instances of its various subclasses, which define behavior specific to different kinds of display objects. For information on the different EOAssociation subclasses you can use, see the following subclass specifications:
| com.apple.client.eointerface Associations | |
| EOActionAssociation | EOActionInsertionAssociation | 
| EOComboBoxAssociation | EOMasterDetailAssociation | 
| EOTableAssociation | EOTableColumnAssociation | 
| EOTableViewAssociation | EOTextAssociation | 
You normally set up EOAssociations using Interface Builder; each of the class specifications for EOAssociation's subclasses provide an example using Interface Builder to set them up. EOAssociation's programmatic interface is more important when defining custom EOAssociation subclasses. For more information on EOAssociations, see the sections:
(com.apple.client.eointerface only) EOAssociation defines the following String constants to identify the names of association aspects:
| ActionAspect | EnabledAspect | SourceAspect | 
| ArgumentAspect | ParentAspect | TitlesAspect | 
| BoldAspect | SelectedObjectAspect | ValueAspect | 
| DestinationAspect | SelectedTitleAspect | URLAspect | 
| ItalicAspect | 
(com.apple.client.eointerface only) The class defines additional String constants to identify association signatures (see the method description aspectSignatures for more information):
NSDisposable
dispose
- Declaring capabilities
 - aspects (com.apple.yellow.eointerface static method)
 - aspects (com.apple.client.eointerface instance method)
 - aspectSignatures (com.apple.yellow.eointerface static method)
 - aspectSignatures (com.apple.client.eointerface instance method)
 - objectKeysTaken (com.apple.yellow.eointerface)
 - isUsableWithObject (com.apple.yellow.eointerface static method)
 - isUsableWithObject (com.apple.client.eointerface instance method)
 - associationClassesSuperseded (com.apple.yellow.eointerface static method)
 - associationClassesSuperseded (com.apple.client.eointerface instance method)
 - displayName (com.apple.yellow.eointerface static method)
 - displayName (com.apple.client.eointerface instance method)
 - primaryAspect (com.apple.yellow.eointerface static method)
 - primaryAspect (com.apple.client.eointerface instance method)
 - canBindAspect
 
- Getting all possible EOAssociations for a display object
 - associationClassesForObject:
 
- Getting the display object
 - object
 
- Examining bindings
 - displayGroupForAspect
 - displayGroupKeyForAspect
 
- Updating values
 - subjectChanged
 - endEditing
 
- Accessing enterprise object values
 - setValueForAspect
 - setValueForAspectAtIndex
 - valueForAspect
 - valueForAspectAtIndex
 
- Handling validation errors
 - shouldEndEditing
 - shouldEndEditingAtIndex
 
public EOAssociation(Object  aDisplayObject)
public static NSArray aspects()
(com.apple.yellow.eointerface only) Overridden by subclasses to return the names of the receiving class's aspects as an array of string objects. Subclasses should include their superclass's aspects and add their own when overriding this method.
See Also: aspects instance method
public static NSArray aspectSignatures()
| Signature Character | Meaning | 
| A | The aspect can be bound to attributes. | 
| 1 (one) | The aspect can be bound to to-one relationships. | 
| M | The aspect can be bound to to-many relationships. | 
An aspect signature string of "A1", for example, means the corresponding aspect can be bound to either attributes or to-one relationships. An empty signature indicates that the corresponding aspect can be bound to an EODisplayGroup without a key (that is, the key is irrelevant). Interface Builder uses aspect signatures to enable and disable keys in its Connections inspectors.
EOAssociation's implementation of this method returns an array of "A1M" of the length of its aspects array.
See Also: aspectSignatures instance method
public static NSArray associationClassesForObject(Object  aDisplayObject)
Returns the subclasses of EOAssociation
usable with  aDisplayObject.  Sends  isUsableWithObject to every
loaded subclass of EOAssociation, adding those that respond true to
the array. Subclasses shouldn't override this method; override isUsableWithObject instead.
public static NSArray associationClassesSuperseded()
(com.apple.yellow.eointerface only) Overridden by subclasses to return the other EOAssociation classes that the receiver supplants. This allows a subclass to mask its superclasses from the Connection Inspector's pop-up list in Interface Builder, since the subclass always includes the aspects and functionality of its superclasses. For example, EOPopUpAssociation supersedes EOControlAssociation, because EOPopUpAssociation is always more appropriate to use with pop-up buttons.
See Also: associationClassesSuperseded instance method
public static String displayName()
(com.apple.yellow.eointerface only) Returns the name used by Interface Builder in the Connection Inspector's pop-up list. EOAssociation's implementation simply returns the name of the receiving class.
See Also: displayName instance method
public static boolean isUsableWithObject(Object  aDisplayObject)
(com.apple.yellow.eointerface only) Overridden by subclasses to return true if instances of the receiving class are usable with aDisplayObject, false if they aren't. The receiving class can examine any relevant characteristic of aDisplayObject -its class, configuration (such as whether an NSMatrix operates in radio mode), and so on.
See Also: isUsableWithObject instance method
public static NSArray objectKeysTaken()
(com.apple.yellow.eointerface only) Overridden by subclasses to return the names of display object outlets that instances assume control of, such as "target" and "delegate". Interface Builder uses this information to disable connections from these outlets in its Connections Inspector.
See Also: objectKeysTaken instance method
public static String primaryAspect()
(com.apple.yellow.eointerface only) Overridden by subclasses to return the default aspect, usually one denoting the displayed value, which by convention is named "value". EOAssociation's implementation returns null.
See Also: primaryAspect instance method
public NSArray aspects()
(com.apple.client.eointerface only) Overridden by subclasses to return the names of the receiving class's aspects, as string objects. Subclasses should include their superclass's aspects and add their own when overriding this method.
See Also: aspects static method
public NSArray aspectSignatures()
| Constant | The Aspect Can Be Bound to | 
| AttributeAspectSignature | Attributes | 
| AttributeToOneAspectSignature | Attributes and to-one relationships | 
| AttributeToManyAspectSignature | Attributes and to-many relationships | 
| AttributeToOneToManyAspectSignature | Attributes, to-one relationships, and to-many relationships | 
| ToOneAspectSignature | To-one relationships | 
| ToOneToManyAspectSignature | To-one and to-many relationships | 
| ToManyAttributeSignature | To-many relationships | 
| NullAspectSignature | An EODisplayGroup without a key (the key is irrelevant). | 
Interface Builder uses aspect signatures to enable and disable keys in its Connections inspectors.
EOAssociation's
implementation of this method returns an array of AttributeToOneToManyAspectSignature strings.
See Also: aspectSignatures static method
public NSArray associationClassesSuperseded()
(com.apple.client.eointerface only) Overridden by subclasses to return the other EOAssociation classes that the receiver supplants. This allows a subclass to mask its superclasses from the Connection Inspector's pop-up list in Interface Builder, since the subclass always includes the aspects and functionality of its superclasses. For example, EOPopUpAssociation supersedes EOControlAssociation, because EOPopUpAssociation is always more appropriate to use with pop-up buttons.
See Also: associationClassesSuperseded static method
public void bindAspect(
String  aspectName, 
EODisplayGroup  aDisplayGroup, 
String  key)
See Also: establishConnection
public void breakConnection()
super's implementation
at the end.See Also: establishConnection
public boolean canBindAspect(
String  aspectName, 
EODisplayGroup  aDisplayGroup, 
String  key)
Interface Builder uses this information to disable aspects in its Connections Inspector. Subclasses can override this method to base their answers on other binds already made, or on characteristics of the receiver's display object or of aDisplayGroup. EOAssociation's implementation always returns true.
See
Also:   localKeys (EODisplayGroup), attributeKeys (EOClassDescription), toOneRelationshipKeys (EOClassDescription), toManyRelationshipKeys (EOClassDescription)
public void copyMatchingBindingsFromAssociation(EOAssociation  anAssociation)
public EODisplayGroup displayGroupForAspect(String  aspectName)
See Also: displayGroupKeyForAspect
public String displayGroupKeyForAspect(String  aspectName)
See Also: displayGroupForAspect
public String displayName()
(com.apple.client.eointerface only) Returns the name used for display purposes. EOAssociation's implementation simply returns the name of the receiver's class.
See Also: displayName static method
public boolean endEditing()
associationDidEndEditing: message
to its EODisplayGroup.Subclasses whose display objects immediately pass their changes back to the EOAssociation-such as a button or pop-up list-need not override this method. It's only needed when the display object's value is edited rather than simply set.
EOAssociation's implementation does nothing but return true.
public void establishConnection()
super's implementation
after establishing their own connections.See "Setting up an EOAssociation Programmatically" in the class description for more information.
See Also: breakConnection
protected boolean isEnabled()
false if
the receiver has explicitly disabled its display object or if the
receiver's EnabledAspect (if
bound) resolves to false; true otherwise.protected boolean isEnabledAtIndex(int  index)
false if
the receiver has explicitly disabled its display object or if the
receiver's EnabledAspect (if
bound) resolves to false for
index; true otherwise.public boolean isExplicitlyDisabled()
true if
the receiver has explicitly disabled its display object, false otherwise.public boolean isUsableWithObject(Object  aDisplayObject)
(com.apple.client.eointerface only) Overridden
by subclasses to return true if instances
of the receiving class are usable with  aDisplayObject,  false if
they aren't. The receiving class can examine any relevant characteristic
of  aDisplayObject -its class, configuration,
and so on. EOAssociation's implementation returns false.
See Also: isUsableWithObject static method
public Object object()
public NSArray objectKeysTaken()
See Also: objectKeysTaken static method
public String primaryAspect()
(com.apple.client.eointerface only) Overridden
by subclasses to return the default aspect, usually one denoting
the displayed value, which by convention is named "value". EOAssociation's implementation
returns null.
See Also: primaryAspect static method
public int priority()
public void setAutoCreated(boolean  aBoolean)
public void setExplicitlyDisabled(boolean  flag)
public boolean setValueForAspect(
Object  value, 
String  aspectName)
See Also: valueForAspect
public boolean setValueForAspectAtIndex(
Object  value, 
String  aspectName, 
int  index)
See Also: valueForAspectAtIndex
public boolean shouldEndEditing(
String  aspectName, 
String  inputString, 
String  errorDescription)
For
example, an association bound to an NSControl object (Application
Kit) receives a controlDidFailToFormatStringErrorDescription delegate
message when the control's formatter fails to format the input
string. Its implementation of that method invokes shouldEndEditing.
See Also: shouldEndEditingAtIndex
public boolean shouldEndEditingAtIndex(
String  aspectName, 
String  inputString, 
String  errorDescription, 
int  index)
public void subjectChanged()
public Object valueForAspect(String  aspectName)
See Also: setValueForAspect
public Object valueForAspectAtIndex(
String  aspectName, 
int  index)
See Also: setValueForAspectAtIndex