Class ActionManager

java.lang.Object
com.levigo.jadice.web.client.util.action.ActionManager

public class ActionManager extends Object
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 Details

    • ActionManager

      public ActionManager()
  • Method Details

    • registerAction

      public static void registerAction(RegisteredAction action) throws RegistrationException
      Registers the RegisteredAction in the ActionRegistry of its context.
      Parameters:
      action - the action to register
      Throws:
      RegistrationException - when the accelerator or alternative accelerator key of the given RegisteredAction 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 an RegisteredAction after the creation, the alternative KeyStroke can be registered here by calling this method.

      This method is automatically called by a RegisteredAction.

      Parameters:
      action - the action for which the alternative KeyStroke should be registered
      Throws:
      RegistrationException - when the alternative KeyStroke of the given action is already bound to a previously registered action
    • getRegisteredAction

      public static RegisteredAction getRegisteredAction(Command command, Collection<Object> context)
      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 returned
      context - the context of the action
      Returns:
      the registered action
    • removeRegisteredActionsForContext

      public static void removeRegisteredActionsForContext(Collection<Object> context)
      Removes all actions which are registered in the given Context.
      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