com.gridsystems.config.tools.swing
Class ReflectedAction
java.lang.Object
javax.swing.AbstractAction
com.gridsystems.config.tools.swing.ReflectedAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public class ReflectedAction
- extends javax.swing.AbstractAction
Action implementation that invokes a specified method of another class through
reflection.
It allows the minimization of class creation for actions.
- Version:
- 1.0
- Author:
- Rodrigo Ruiz Aguayo
- See Also:
- Serialized Form
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary |
ReflectedAction(java.lang.Object target,
java.lang.String methodName,
java.lang.String key)
Creates an action that will invoke the specified method name on the
target object on ActionEvents. |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectedAction
public ReflectedAction(java.lang.Object target,
java.lang.String methodName,
java.lang.String key)
- Creates an action that will invoke the specified method name on the
target object on ActionEvents.
It first searches for a method taking an ActionEvent instance as argument,
and if not found, it will search for a method with no arguments.
The key parameter contains an string indicating from where to obtain this
action name. Its syntax is one of:
-
key
: searches the key through UI.getString()
-
#key
: as the previous one
-
bundleName#key
: searches key in a bundle with name
"bundleName"
- Parameters:
target
- The object whose method will be invokedmethodName
- The name of the method to invokekey
- The key for i18n of the action name.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
-
Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.