- Inherits from:
- EOGenericControlAssociation : EOAssociation : EODelayedObserver (EOControl) : NSObject
- EOObserving (EODelayedObserver)
EOActionCellAssociation is the default association class for use with NSActionCells (Application Kit).
|Note: This class doesn't exist in the com.apple.client.eointerface package.|
An EOActionCellAssociation object displays the value of the selected object in its NSActionCell, and updates the object when the NSActionCell's value changes. A sibling class, EOControlAssociation, can be used with independent controls such as NSButtons and NSTextFields. Other associations, such as EOPopUpAssociation and EOColumnAssociation, supersede these classes for more specialized behavior.
When multiple EOActionCellAssociations are bound to cells
in the same control (such as in an Application Kit NSMatrix), one
of them becomes the delegate of the control and forwards appropriate messages,
to the others. This eliminates the need to add an EOControlAssociation
just to handle delegate messages.
EOActionCellAssociations access values using NSActionCell's
which allows values with non-string representations to be displayed.
An EOActionCellAssociation can be bound to an NSImageCell, for example,
with an attribute whose class is NSImage.
|value||An attribute of the selected object, displayed in the NSActionCell.|
|enabled||A boolean attribute of the selected object, which determines whether the NSActionCell is enabled.|
|Object Keys Taken|
|target||On receiving an action message from the NSActionCell, an EOActionCellAssociation sends the NSActionCell's value to the EODisplayGroup.|
|delegate||See the class description.|
To display a movie's budget in an NSTextFieldCell, in Interface
Builder, control-drag a connection from the text field to the Movie
display group. Select EOActionCellAssociation in the Connections
inspector, and bind the
value aspect to
the "budget" key. Then, if the NSTextFieldCell is editable,
when the user types a new value and presses Enter or Tab, the selected
budget attribute is changed.
Assuming that Movie objects implement an
you can make the NSTextFieldCell uneditable depending on the selected
movie. To do so, bind the
to the "isBudgetNegotiable" key.
Creates a new EOActionCellAssociation to monitor
and update the value in aDisplayObject,
which is typically an Application Kit NSActionCell.
You normally set up associations with the Interface Builder application, 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.
See Also: bindAspect (EOAssociation), establishConnection (EOAssociation)