public class ControllerAction extends ResourceAction
actionPerformed
method
will call a parametrizable method.ResourceAction.ButtonAction, ResourceAction.MenuItemAction, ResourceAction.PopupMenuItemAction, ResourceAction.ToolBarAction
POPUP, TOGGLE_BUTTON_MODEL
changeSupport, enabled
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 and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent ev)
Calls the method on controller given in constructor.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public ControllerAction(UserPreferences preferences, Class<?> resourceClass, String actionPrefix, Object controller, String method, Object... parameters) throws NoSuchMethodException
actionPrefix
.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 actionPerfomed
parameters
- list of parameters to be used with method
NoSuchMethodException
- if method
with a
matching parameters
list doesn't existpublic ControllerAction(UserPreferences preferences, Class<?> resourceClass, String actionPrefix, boolean enabled, Object controller, String method, Object... parameters) throws NoSuchMethodException
actionPrefix
.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 actionPerfomed
parameters
- list of parameters to be used with method
NoSuchMethodException
- if method
with a
matching parameters
list doesn't existpublic void actionPerformed(ActionEvent ev)
actionPerformed
in interface ActionListener
actionPerformed
in class ResourceAction
© Copyrights 2006-2016 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License