com.gridsystems.config.tools.swing
Class ReflectedAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by 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

Field Summary
 
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.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent event)
          
 
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
 

Constructor Detail

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:

Parameters:
target - The object whose method will be invoked
methodName - The name of the method to invoke
key - The key for i18n of the action name.
Method Detail

actionPerformed

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



Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.