|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.action.ActionManager
public class ActionManager
ActionManager provides methods to retrieve MuAction instances and invoke them. It keeps track of all the
action instances it has created and allows them to be reused whithin a MainFrame.
MuAction subclasses should not be instanciated directly, getActionInstance
methods should be used instead. Using ActionManager to retrieve a MuAction ensures that only one instance
exists for a given MainFrame. This is particularly important because actions are stateful and can be used
in several components of a MainFrame at the same time; if an action's state changes, the change must be reflected
everywhere the action is used. It is also important for performance reasons: sharing one action throughout a
MainFrame saves some memory and also CPU cycles as some actions listen to particular events to change
their state accordingly.
MuAction,
ActionDescriptor,
ActionKeymap| Constructor Summary | |
|---|---|
ActionManager()
|
|
| Method Summary | |
|---|---|
static MuAction |
getActionInstance(ActionDescriptor actionDescriptor,
MainFrame mainFrame)
Returns an instance of the MuAction class denoted by the given ActionDescriptor, for the specified MainFrame. |
static MuAction |
getActionInstance(java.lang.Class actionClass,
MainFrame mainFrame)
Convenience method that returns an instance of the given MuAction class, and associated with the specified MainFrame. |
static java.util.Vector |
getActionInstances(java.lang.Class muActionClass)
Returns a Vector of all MuAction instances matching the specified Class. |
static boolean |
performAction(ActionDescriptor actionDescriptor,
MainFrame mainFrame)
Convenience method that retrieves an instance of the MuAction denoted by the given ActionDescriptor
and associated with the given MainFrame and calls MuAction.performAction() on it. |
static boolean |
performAction(java.lang.Class actionClass,
MainFrame mainFrame)
Convenience method that retrieves an instance of the MuAction denoted by the given Class and associated with the given MainFrame and calls MuAction.performAction() on it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ActionManager()
| Method Detail |
|---|
public static MuAction getActionInstance(java.lang.Class actionClass,
MainFrame mainFrame)
getActionInstance(ActionDescriptor, MainFrame) and returns the MuAction instance.
actionClass - the MuAction class to instanciatemainFrame - the MainFrame instance the action belongs to
null if the
class could not be found or could not be instanciated.
public static MuAction getActionInstance(ActionDescriptor actionDescriptor,
MainFrame mainFrame)
null is returned.
actionDescriptor - a descriptor of the action class to instanciate with initial propertiesmainFrame - the MainFrame instance the action belongs to
null if the
MuAction class denoted by the ActionDescriptor could not be found or could not be instanciated.public static java.util.Vector getActionInstances(java.lang.Class muActionClass)
muActionClass - the MuAction class to compare instances against
public static boolean performAction(java.lang.Class actionClass,
MainFrame mainFrame)
MainFrame and calls MuAction.performAction() on it.
Returns true if an instance of the action could be retrieved and performed, false
if the MuAction could not be found or could not be instanciated.
actionClass - the class of the MuAction to performmainFrame - the MainFrame the action belongs to
public static boolean performAction(ActionDescriptor actionDescriptor,
MainFrame mainFrame)
ActionDescriptor
and associated with the given MainFrame and calls MuAction.performAction() on it.
Returns true if an instance of the action could be retrieved and performed, false
if the MuAction could not be found or could not be instanciated.
actionDescriptor - the ActionDescriptor of the action to performmainFrame - the MainFrame the action belongs to
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard