Class ActionManager
java.lang.Object
com.levigo.jadice.web.client.util.action.ActionManager
A manager for
ActionRegistry
s. The manager holds an ActionRegistry
for each
context. The actions are registered to the ActionRegistry
belonging to their personal
context.
To react to KeyEvent
s 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 void
disable()
Disables the ActionManager, so no actions will be performedstatic RegisteredAction
getRegisteredAction
(Command command, Collection<Object> context) Returns a registered action in the given context with the given command if there is one.static void
registerAction
(RegisteredAction action) Registers theRegisteredAction
in theActionRegistry
of its context.static void
If the alternative KeyStroke is set to anRegisteredAction
after the creation, the alternativeKeyStroke
can be registered here by calling this method.static void
removeHandler
(Object context) Removes an existing DOM-Handler from a given object.static void
Removes 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 theRegisteredAction
in theActionRegistry
of its context.- Parameters:
action
- the action to register- Throws:
RegistrationException
- when the accelerator or alternative accelerator key of the givenRegisteredAction
is 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 anRegisteredAction
after the creation, the alternativeKeyStroke
can be registered here by calling this method.This method is automatically called by a
RegisteredAction
.- Parameters:
action
- the action for which the alternativeKeyStroke
should be registered- Throws:
RegistrationException
- when the alternativeKeyStroke
of 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
-