Class ActionManager

    • Field Detail

      • ownActions

        protected java.util.HashSet<Action> ownActions
        List of action handlers. Guaranteed to keep the original insertion order.
      • actionHandlers

        protected java.util.HashSet<Action.Handler> actionHandlers
        List of action handlers. Guaranteed to keep the original insertion order.
    • Constructor Detail

      • ActionManager

        public ActionManager()
      • ActionManager

        public ActionManager​(T viewer)
    • Method Detail

      • removeActionHandler

        public void removeActionHandler​(Action.Handler actionHandler)
        Description copied from interface: Action.Container
        Removes a previously registered action handler for the contents of this container.
        Specified by:
        removeActionHandler in interface Action.Container
        Parameters:
        actionHandler - the handler to be removed.
      • removeAllActionHandlers

        public void removeAllActionHandlers()
      • handleActions

        public void handleActions​(java.util.Map<java.lang.String,​java.lang.Object> variables,
                                  Action.Container sender)
      • getActions

        public Action[] getActions​(java.lang.Object target,
                                   java.lang.Object sender)
        Description copied from interface: Action.Handler
        Gets the list of actions applicable to this handler.
        Specified by:
        getActions in interface Action.Handler
        Parameters:
        target - the target handler to list actions for. For item containers this is the item id.
        sender - the party that would be sending the actions. Most of this is the action container.
        Returns:
        the list of Action
      • handleAction

        public void handleAction​(Action action,
                                 java.lang.Object sender,
                                 java.lang.Object target)
        Description copied from interface: Action.Handler
        Handles an action for the given target. The handler method may just discard the action if it's not suitable.
        Specified by:
        handleAction in interface Action.Handler
        Parameters:
        action - the action to be handled.
        sender - the sender of the action. This is most often the action container.
        target - the target of the action. For item containers this is the item id.