public class ControllerAction extends ResourceAction
actionPerformed
method
will call a parametrizable method.ResourceAction.ButtonAction, ResourceAction.MenuItemAction, ResourceAction.PopupMenuItemAction, ResourceAction.ToolBarAction
POPUP, RESOURCE_CLASS, RESOURCE_PREFIX, TOGGLE_BUTTON_MODEL, TOOL_BAR_ICON, UNLOCALIZED_NAME, VISIBLE
Constructor and Description |
---|
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 . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ev)
Calls the method on controller given in constructor.
|
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
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
java.lang.NoSuchMethodException
- if method
with a
matching parameters
list doesn't existpublic 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
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
java.lang.NoSuchMethodException
- if method
with a
matching parameters
list doesn't existpublic void actionPerformed(java.awt.event.ActionEvent ev)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class ResourceAction
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License