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:
- ActionListener, Serializable, Cloneable, EventListener, 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 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,
Class<?> resourceClass,
String actionPrefix,
boolean enabled,
Object controller,
String method,
Object... parameters)
Creates an action with properties retrieved from a resource bundle
in which key starts with actionPrefix. |
ControllerAction(UserPreferences preferences,
Class<?> resourceClass,
String actionPrefix,
Object controller,
String method,
Object... parameters)
Creates a disabled action with properties retrieved from a resource bundle
in which key starts with actionPrefix. |
ControllerAction
public ControllerAction(UserPreferences preferences,
Class<?> resourceClass,
String actionPrefix,
Object controller,
String method,
Object... parameters)
throws 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:
NoSuchMethodException - if method with a
matching parameters list doesn't exist
ControllerAction
public ControllerAction(UserPreferences preferences,
Class<?> resourceClass,
String actionPrefix,
boolean enabled,
Object controller,
String method,
Object... parameters)
throws 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:
NoSuchMethodException - if method with a
matching parameters list doesn't exist
actionPerformed
public void actionPerformed(ActionEvent ev)
- Calls the method on controller given in constructor.
- Specified by:
actionPerformed in interface ActionListener- Overrides:
actionPerformed in class ResourceAction