Class ActionManager
java.lang.Object
com.levigo.jadice.web.client.util.action.ActionManager
A manager for
ActionRegistrys. The manager holds an ActionRegistry for each
context. The actions are registered to the ActionRegistry belonging to their personal
context.
To react to KeyEvents the ActionManager has to be initialized with a view
component. The view component should be always visible.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisable()Disables the ActionManager, so no actions will be performedstatic RegisteredActiongetRegisteredAction(Command command, Collection<Object> context) Returns a registered action in the given context with the given command if there is one.static voidregisterAction(RegisteredAction action) Registers theRegisteredActionin theActionRegistryof its context.static voidIf the alternative KeyStroke is set to anRegisteredActionafter the creation, the alternativeKeyStrokecan be registered here by calling this method.static voidremoveHandler(Object context) Removes an existing DOM-Handler from a given object.static voidRemoves all actions which are registered in the givenContext.
-
Constructor Details
-
ActionManager
public ActionManager()
-
-
Method Details
-
removeHandler
Removes an existing DOM-Handler from a given object.- Parameters:
context-
-
registerAction
Registers theRegisteredActionin theActionRegistryof its context.- Parameters:
action- the action to register- Throws:
RegistrationException- when the accelerator or alternative accelerator key of the givenRegisteredActionis already bound to an existing (i.e. previously registered) action
-
registerAlternativeAcceleratorKey
public static void registerAlternativeAcceleratorKey(RegisteredAction action) throws RegistrationException If the alternative KeyStroke is set to anRegisteredActionafter the creation, the alternativeKeyStrokecan be registered here by calling this method.This method is automatically called by a
RegisteredAction.- Parameters:
action- the action for which the alternativeKeyStrokeshould be registered- Throws:
RegistrationException- when the alternativeKeyStrokeof the given action is already bound to a previously registered action
-
getRegisteredAction
Returns a registered action in the given context with the given command if there is one.- Parameters:
command- the command for which the registered action should be returnedcontext- the context of the action- Returns:
- the registered action
-
removeRegisteredActionsForContext
Removes all actions which are registered in the givenContext.- Parameters:
context- the Context for which the actions should be deregistered
-
disable
public static void disable()Disables the ActionManager, so no actions will be performed
-