Package com.tagtraum.beatunes
Class ActionManager
- java.lang.Object
-
- com.tagtraum.beatunes.ActionManager
-
- All Implemented Interfaces:
ApplicationComponent<BeaTunes>
public class ActionManager extends Object implements ApplicationComponent<BeaTunes>
The centralActionManagerallows registration and retrieval of theBaseActions used throughout the application. Actions can be accessed via their id (ApplicationAction.getId()). UsingApplicationAction.getActionLocations(), actions may be installed automatically in the application's UI.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description ActionManager(BeaTunes application)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaseActiongetAction(String id)Returns an action object for an id.Set<String>getActionIds()Set of registered ids.BeaTunesgetApplication()Returns the main application component.StringgetId()Unique id for each instance of this object.voidinit()Installs actions in the UI (if they have a location specified).voidinstallApplicationsInto(Object root)Installs all registered actions in the given root object using theirActionLocations.voidinstallApplicationsInto(Object root, Predicate<ActionLocation> actionLocationFilter)Installs registered actions that fit the given predicate in the given root object using theirActionLocations.voidregisterActionPlugins()Registers all plugins that implementBaseActionwith their ids in this manager.voidsetApplication(BeaTunes beaTunes)Sets the main application component.voidshutdown()Shuts down this component and its sub-components.
-
-
-
Constructor Detail
-
ActionManager
public ActionManager(BeaTunes application)
- Parameters:
application- beatunes
-
-
Method Detail
-
getApplication
public BeaTunes getApplication()
Description copied from interface:ApplicationComponentReturns the main application component.- Specified by:
getApplicationin interfaceApplicationComponent<BeaTunes>- Returns:
- application object
-
setApplication
public void setApplication(BeaTunes beaTunes)
Description copied from interface:ApplicationComponentSets the main application component.- Specified by:
setApplicationin interfaceApplicationComponent<BeaTunes>- Parameters:
beaTunes- main application component
-
getId
public String getId()
Description copied from interface:ApplicationComponentUnique id for each instance of this object.- Specified by:
getIdin interfaceApplicationComponent<BeaTunes>- Returns:
- id
-
getAction
public BaseAction getAction(String id)
Returns an action object for an id.- Parameters:
id- id for the requested action- Returns:
- action or null, if id unknown
- See Also:
addAction(com.tagtraum.beatunes.action.BaseAction)
-
registerActionPlugins
public void registerActionPlugins()
Registers all plugins that implementBaseActionwith their ids in this manager.
-
init
public void init()
Installs actions in the UI (if they have a location specified).- Specified by:
initin interfaceApplicationComponent<BeaTunes>
-
shutdown
public void shutdown()
Description copied from interface:ApplicationComponentShuts down this component and its sub-components.- Specified by:
shutdownin interfaceApplicationComponent<BeaTunes>
-
installApplicationsInto
public void installApplicationsInto(Object root)
Installs all registered actions in the given root object using theirActionLocations.- Parameters:
root- UI root object
-
installApplicationsInto
public void installApplicationsInto(Object root, Predicate<ActionLocation> actionLocationFilter)
Installs registered actions that fit the given predicate in the given root object using theirActionLocations.- Parameters:
root- UI root objectactionLocationFilter- filter predicate for the location collections
-
-