PATH  Documentation > WebObjects 4.5 > EOInterface Reference

Table of Contents

EOActionInsertionAssociation


Inherits from:
(com.apple.client.eointerface) EOAssociation : EODelayedObserver (EOControl) : Object
(com.apple.yellow.eointerface) EOAssociation : EODelayedObserver (EOControl) : NSObject
Implements:
EOObserving (EODelayedObserver)
(com.apple.client.eointerface only) java.awt.event.ActionListener
(com.apple.client.eointerface only) NSDisposable (EOAssociation)
Package:
com.apple.client.eointerface
com.apple.yellow.eointerface


Class Description


An EOActionInsertionAssociation object inserts objects from one display group into another.


Usable With
(com.apple.client.eointerface) Any object that implements the method addActionListener (javax.swing.JButton and javax.swing.JMenuItem, for example)
(com.apple.yellow.eointerface) Any object that responds to setAction, typically an NSControl


Aspects
source Bound to the EODisplayGroup containing objects to insert. This aspect doesn't use a key.
destination A relationship of the selected object into which objects from the source EODisplayGroup are inserted. Usually bound to a different EODisplayGroup than source.
enabled A boolean attribute of the selected object (usually in the destination EODisplayGroup), which determines whether the NSControl is enabled.


Object Keys Taken
target On receiving an action message from the display object, an EOActionInsertionAssociation inserts objects from the source EODisplayGroup into the destination EODisplayGroup.


Example

Suppose an application shows Talent in one display group and Movies in another. You want a user to be able to select a talent, select a movie, and then click an Assign Director button that assigns the selected talent as one of the movie's directors. To do this, in Interface Builder, control-drag a connection from the button to the Talent display group. Select EOActionInsertionAssociation in the Connections inspector, and double-click the association's source aspect, binding it to the Talent display group. Similarly, control-drag a connection from the button to the Movie display group. Select EOActionAssociation in the Connections inspector, and bind the association's destination aspect to the "directors" key. Now, when the user clicks the button, the selected Talent is added to the directors relationship of the selected Movie. If more than one talent is selected, both are added to the relationship. If more than one Movie is selected, the selected talent are added to the relationship of the first Movie in the selection.




Constructors



EOActionInsertionAssociation

public EOActionInsertionAssociation(Object aDisplayObject)

Creates a new EOActionInsertionAssociation to monitor and update the value in aDisplayObject.

You normally set up associations in 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.

See Also: bindAspect (EOAssociation), establishConnection (EOAssociation)




Instance Methods



actionPerformed

public void actionPerformed(java.awt.event.ActionEvent event)

(com.apple.client.eointerface) Invoked when the receiver's display object is acted upon. Sends the method identified by the receiver's action aspect (with an argument, if the argument aspect is bound) to the selected objects.

breakConnection

public void breakConnection()

(com.apple.client.eointerface) See the breakConnection method description in the superclass ( EOAssociation).

establishConnection

public void establishConnection()

(com.apple.client.eointerface) See the establishConnection method description in the superclass ( EOAssociation).

isUsableWithObject

public boolean isUsableWithObject(Object aDisplayObject)

(com.apple.client.eointerface) Returns true if aDisplayObject implements the method addActionListener, false otherwise.

See Also: isUsableWithObject ( EOAssociation)



primaryAspect

public String primaryAspect()

(com.apple.client.eointerface) Returns EOAssociation. SourceAspect.

See Also: primaryAspect ( EOAssociation)



subjectChanged

public void subjectChanged()

(com.apple.client.eointerface) See the subjectChanged method description in the superclass ( EOAssociation).


Table of Contents