Package com.vaadin.event
Class ActionManager
- java.lang.Object
-
- com.vaadin.event.ActionManager
-
- All Implemented Interfaces:
Action.Container,Action.Handler,Action.Notifier,Serializable
- Direct Known Subclasses:
ConnectorActionManager
public class ActionManager extends Object implements Action.Handler, Action.Notifier
Javadoc TODO Notes:Empties the keymapper for each repaint to avoid leaks; can cause problems in the future if the client assumes key don't change. (if lazyloading, one must not cache results)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected HashSet<Action.Handler>actionHandlersList of action handlers.protected KeyMapper<Action>actionMapperAction mapper.protected HashSet<Action>ownActionsList of action handlers.protected Componentviewer
-
Constructor Summary
Constructors Constructor Description ActionManager()ActionManager(T viewer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Action & Action.Listener>
voidaddAction(T action)voidaddActionHandler(Action.Handler actionHandler)Registers a new action handler for this container.Action[]getActions(Object target, Object sender)Gets the list of actions applicable to this handler.voidhandleAction(Action action, Object sender, Object target)Handles an action for the given target.voidhandleActions(Map<String,Object> variables, Action.Container sender)voidpaintActions(Object actionTarget, PaintTarget paintTarget)<T extends Action & Action.Listener>
voidremoveAction(T action)voidremoveActionHandler(Action.Handler actionHandler)Removes a previously registered action handler for the contents of this container.voidremoveAllActionHandlers()<T extends Component & Action.Container & VariableOwner>
voidsetViewer(T viewer)
-
-
-
Field Detail
-
ownActions
protected HashSet<Action> ownActions
List of action handlers. Guaranteed to keep the original insertion order.
-
actionHandlers
protected HashSet<Action.Handler> actionHandlers
List of action handlers. Guaranteed to keep the original insertion order.
-
viewer
protected Component viewer
-
-
Method Detail
-
setViewer
public <T extends Component & Action.Container & VariableOwner> void setViewer(T viewer)
-
addAction
public <T extends Action & Action.Listener> void addAction(T action)
- Specified by:
addActionin interfaceAction.Notifier
-
removeAction
public <T extends Action & Action.Listener> void removeAction(T action)
- Specified by:
removeActionin interfaceAction.Notifier
-
addActionHandler
public void addActionHandler(Action.Handler actionHandler)
Description copied from interface:Action.ContainerRegisters a new action handler for this container.- Specified by:
addActionHandlerin interfaceAction.Container- Parameters:
actionHandler- the new handler to be added.
-
removeActionHandler
public void removeActionHandler(Action.Handler actionHandler)
Description copied from interface:Action.ContainerRemoves a previously registered action handler for the contents of this container.- Specified by:
removeActionHandlerin interfaceAction.Container- Parameters:
actionHandler- the handler to be removed.
-
removeAllActionHandlers
public void removeAllActionHandlers()
-
paintActions
public void paintActions(Object actionTarget, PaintTarget paintTarget) throws PaintException
- Throws:
PaintException
-
handleActions
public void handleActions(Map<String,Object> variables, Action.Container sender)
-
getActions
public Action[] getActions(Object target, Object sender)
Description copied from interface:Action.HandlerGets the list of actions applicable to this handler.- Specified by:
getActionsin interfaceAction.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, Object sender, Object target)
Description copied from interface:Action.HandlerHandles an action for the given target. The handler method may just discard the action if it's not suitable.- Specified by:
handleActionin interfaceAction.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.
-
-