org.favabeans.base
Class MethodAction
java.lang.Object
|
+--javax.swing.AbstractAction
|
+--org.favabeans.base.MethodAction
- All Implemented Interfaces:
- Action, ActionFeature, ActionListener, Cloneable, EventListener, Faceted, Feature, Serializable
- public class MethodAction
- extends AbstractAction
- implements Faceted, ActionFeature
A MethodAction, when performed, invokes a single
public method of a specific object. It is a fairly low-level construct,
and will generally only be presented to the end-user as a last resort
or as part of some development tool.
Note: This implementation does not listen for
changes in the underlying MethodDescriptor; this saves
us some storage at the cost of some generality. It is very unlikely
that this shortcut will lead to problems.
Note: In the current implementation, we do
not have a "wizard" that pops up to allow the end-user to supply
method arguments (we use null values) and we also have
no way to communicate any return values of the method. This needs
to be fixed soon.
- See Also:
- Serialized Form
MethodAction
public MethodAction(Object target,
MethodDescriptor descriptor)
- Create a new
MethodAction.
- Parameters:
target - the object on which the method will be performed.descriptor - the Java reflection MethodDescriptor
for the method to be called.
getTarget
public Object getTarget()
- Description copied from interface:
Feature
- Obtain the target of this
Feature.
- Specified by:
getTarget in interface Feature
- Following copied from interface:
org.favabeans.base.Feature
- Returns:
- the target.
getFacet
public Facet getFacet(Type type)
- Description copied from interface:
Faceted
- Obtain a
Facet of the requested Type
for this object.
- Specified by:
getFacet in interface Faceted
- Following copied from interface:
org.favabeans.base.Faceted
- Parameters:
type - the Type of Facet
requested for this object.- Returns:
- a
Facet, or null if none can
be created as requested.
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed in interface ActionListener- Overrides:
actionPerformed in class AbstractAction
getDescriptor
public MethodDescriptor getDescriptor()
- Obtain the Java reflection
MethodDescriptor
for the method which this MethodAction will
execute upon #actionPerformed().
- Returns:
- a
MethodDescriptor.
doActionPerformed
protected Object doActionPerformed()
- Invoke the method which this object represents.
Note: We supply
null for
all method parameters for the moment. See class docs for
other limitations.
Copyright © 2000-2001, Regents of the University of Minnesota. All Rights Reserved.