com.webobjects.eointerface.swing
Class EOControlActionAdapter
java.lang.Object
|
+--com.webobjects.eointerface.swing.EOControlActionAdapter
- All Implemented Interfaces:
- ActionListener, EventListener, NSDisposable
- public class EOControlActionAdapter
- extends Object
- implements ActionListener, NSDisposable
The EOControlActionAdapter class is used to connect user interface widgets to the
actions performed with those controls. They are usually generated automatically
to represent connections made in Interface Builder.
For example, suppose you create a connection from a "Fetch" button to a display group and
that you connect the button to the display group's fetch
method. At runtime, an
EOControlActionAdapter object is used to invoke the display group's fetch
method
when a user clicks the Fetch button. In this example, the display group is the EOControlActionAdapter's
target, "fetch" is the name of the action method to perform on the target, and the button is the listenee.
An EOControlActionAdapter listens for the listenee (the button) to be acted upon (to be pushed).
When the listenee is acted upon, the EOControlActionAdapter performs the action on its target
(invokes the display group's fetch
method).
Constructor Summary |
EOControlActionAdapter(Object target,
String actionName,
Object listenee)
Constructs a new EOControlActionAdapter that performs the method identified by actionName
on the object target when the widget listenee is acted upon. |
EOControlActionAdapter(String actionName,
Object listenee)
Constructs a new EOControlActionAdapter that performs the method identified by actionName
when the widget listenee is acted upon. |
Method Summary |
void |
actionPerformed(ActionEvent event)
Invokes the action method on the target of the EOControlActionAdaptor. |
void |
dispose()
Releases all resources used by this object and ensures that it becomes available for garbage collection. |
void |
setTarget(Object target)
Sets the receiver's target to target . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EOControlActionAdapter
public EOControlActionAdapter(Object target,
String actionName,
Object listenee)
- Constructs a new EOControlActionAdapter that performs the method identified by
actionName
on the object target
when the widget listenee
is acted upon.
- Parameters:
target
- the action targetactionName
- the name of the action methodlistenee
- listenee (widget) to be acted upon- Throws:
java.lang.illegalStateException
- if listenee
is null
EOControlActionAdapter
public EOControlActionAdapter(String actionName,
Object listenee)
- Constructs a new EOControlActionAdapter that performs the method identified by
actionName
when the widget listenee
is acted upon. Note that you have to set the target later if you
want this action to have any effect.
- Parameters:
actionName
- the name of the action methodlistenee
- listenee (widget) to be acted upon- Throws:
java.lang.illegalStateException
- if listenee
is null
actionPerformed
public void actionPerformed(ActionEvent event)
- Invokes the action method on the target of the EOControlActionAdaptor. Invoked when the listenee is acted upon.
- Specified by:
actionPerformed
in interface ActionListener
- Parameters:
event
- the user event triggering the action
dispose
public void dispose()
- Releases all resources used by this object and ensures that it becomes available for garbage collection.
Note that you should not use the object any further after invoking
dispose
.
- Specified by:
dispose
in interface NSDisposable
setTarget
public void setTarget(Object target)
- Sets the receiver's target to
target
.
- Parameters:
target
- the action target
Copyright © 2003 Apple Computer, Inc.