com.eteks.sweethome3d.swing
Class ControllerAction
java.lang.Object
javax.swing.AbstractAction
com.eteks.sweethome3d.swing.ResourceAction
com.eteks.sweethome3d.swing.ControllerAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public class ControllerAction
- extends ResourceAction
An action which actionPerformed method
will call a parametrizable method.
- Author:
- Emmanuel Puybaret
- 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 |
ControllerAction(UserPreferences preferences,
java.lang.Class<?> resourceClass,
java.lang.String actionPrefix,
boolean enabled,
java.lang.Object controller,
java.lang.String method,
java.lang.Object... parameters)
Creates an action with properties retrieved from a resource bundle
in which key starts with actionPrefix. |
ControllerAction(UserPreferences preferences,
java.lang.Class<?> resourceClass,
java.lang.String actionPrefix,
java.lang.Object controller,
java.lang.String method,
java.lang.Object... parameters)
Creates a disabled action with properties retrieved from a resource bundle
in which key starts with actionPrefix. |
|
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent ev)
Calls the method on controller given in constructor. |
| 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 |
ControllerAction
public ControllerAction(UserPreferences preferences,
java.lang.Class<?> resourceClass,
java.lang.String actionPrefix,
java.lang.Object controller,
java.lang.String method,
java.lang.Object... parameters)
throws java.lang.NoSuchMethodException
- Creates a disabled action with properties retrieved from a resource bundle
in which key starts with
actionPrefix.
- Parameters:
preferences - user preferences used to retrieve localized description of the actionresourceClass - the class used as a context to retrieve localized properties of the actionactionPrefix - prefix used in resource bundle to search action propertiescontroller - the controller on which the method will be calledmethod - the name of the controller method that will be invoked
in actionPerfomedparameters - list of parameters to be used with method
- Throws:
java.lang.NoSuchMethodException - if method with a
matching parameters list doesn't exist
ControllerAction
public ControllerAction(UserPreferences preferences,
java.lang.Class<?> resourceClass,
java.lang.String actionPrefix,
boolean enabled,
java.lang.Object controller,
java.lang.String method,
java.lang.Object... parameters)
throws java.lang.NoSuchMethodException
- Creates an action with properties retrieved from a resource bundle
in which key starts with
actionPrefix.
- Parameters:
preferences - user preferences used to retrieve localized description of the actionresourceClass - the class used as a context to retrieve localized properties of the actionactionPrefix - prefix used in resource bundle to search action propertiesenabled - true if the action should be enabled at creation.controller - the controller on which the method will be calledmethod - the name of the controller method that will be invoked
in actionPerfomedparameters - list of parameters to be used with method
- Throws:
java.lang.NoSuchMethodException - if method with a
matching parameters list doesn't exist
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent ev)
- Calls the method on controller given in constructor.
- Specified by:
actionPerformed in interface java.awt.event.ActionListener- Overrides:
actionPerformed in class ResourceAction