Inherits From:
EOGenericControlAssociation :
EOAssociation :
EODelayedObserver (EOControl) :
NSObject
EOObserving (EODelayedObserver)
Inherits From:
com.apple.yellow.eointerface (Yellow Box)
Class Description
EOControlAssociation is the default EOAssociation subclass for use with NSControl objects (Application Kit). It is for use in Yellow Box applications only; there isn't an equivalent class for Java Client.
A control association displays the value of the selected object in its control, and updates the object when the control's value changes. A sibling class, EOActionCellAssociation, can be used with individual cells in an NSMatrix or NSForm (both defined in the Application Kit). Some other subclasses of EOAssociation, such as EOPopUpAssociation and EOColumnAssociation, supersede these classes for more specialized behavior.
EOControlAssociations access values using NSControl's
Usable With |
---|
Any NSControl (Application Kit) |
Aspects | |
---|---|
value | An attribute of the selected object, displayed in the NSControl. |
enabled | A boolean attribute of the selected object, which determines whether the NSControl is enabled. |
Object Keys Taken | |
---|---|
target | On receiving an action message from the NSControl, an EOControlAssociation sends the NSControl's value to the EODisplayGroup. |
delegate | An EOControlAssociation accepts messages related to editing and validation of text, such as
controlTextShouldBeginEditing and controlDidFailToFormatStringErrorDescription . |
Examples
To display a movie's budget in an NSTextField, in Interface Builder, control-drag a connection from the text field and a Movie display group. In the Connections inspector, choose EOControlAssociation, and bind the value
aspect to the "budget" key. Then, if the NSTextField is editable, when the user types a new value and presses Enter or Tab, the selected movie's budget
attribute is changed.
Assuming that Movie objects implement an isBudgetNegotiable
method, you can make the NSTextField uneditable depending on the selected movie. To do so, bind the enabled
aspect to the "isBudgetNegotiable" key.
Constructors
public EOControlAssociation
(java.lang.Object aDisplayObject)
Creates a new EOControlAssociation to monitor and update the row values in aDisplayObject, an NSControl object(Application Kit).
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)
Instance Methods
control
public com.apple.yellow.application.NSControl control
()
Returns the receiver's control object. For EOControlAssociation, this method is equivalent to EOAssociation's object
method.
editingAssociation
public EOGenericControlAssociation editingAssociation
()
Returns this
.