com.vaadin.event.
Class ActionManager
java.lang.Object
com.vaadin.event.ActionManager
All Implemented Interfaces:
Action.Container, Action.Handler, Action.Notifier, Serializable
- extends Object
- implements Action.Container, Action.Handler, Action.Notifier
public class ActionManager
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:
Field Summary | |
---|---|
protected HashSet<Action.Handler> |
actionHandlers
List of action handlers. |
protected KeyMapper |
actionMapper
Action mapper |
protected HashSet<Action> |
ownActions
List of action handlers. |
protected Component |
viewer
|
Constructor Summary | |
---|---|
ActionManager()
|
|
ActionManager(T viewer)
|
Method Summary | ||
---|---|---|
|
addAction(T action)
|
|
void |
addActionHandler(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. |
|
void |
handleAction(Action action,
Object sender,
Object target)
Handles an action for the given target. |
|
void |
handleActions(Map<String,Object> variables,
Action.Container sender)
|
|
void |
paintActions(Object actionTarget,
PaintTarget paintTarget)
|
|
|
removeAction(T action)
|
|
void |
removeActionHandler(Action.Handler actionHandler)
Removes a previously registered action handler for the contents of this container. |
|
void |
removeAllActionHandlers()
|
|
|
setViewer(T viewer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
actionMapper
protected KeyMapper actionMapper
Action mapper
viewer
protected Component viewer
Constructor Detail |
---|
ActionManager
public ActionManager()
ActionManager
public ActionManager(T viewer)
Method Detail |
---|
setViewer
public <T extends Component & Action.Container> void setViewer(T viewer)
addAction
public <T extends Action & Action.Listener> void addAction(T action)
- Specified by:
addAction
in interfaceAction.Notifier
removeAction
public <T extends Action & Action.Listener> void removeAction(T action)
- Specified by:
removeAction
in interfaceAction.Notifier
addActionHandler
public void addActionHandler(Action.Handler actionHandler)
- Specified by:
addActionHandler
in interfaceAction.Container
- Parameters:
actionHandler
- the new handler to be added.
Description copied from interface: Action.Container
Registers a new action handler for this container
removeActionHandler
public void removeActionHandler(Action.Handler actionHandler)
- Specified by:
removeActionHandler
in interfaceAction.Container
- Parameters:
actionHandler
- the handler to be removed.
Description copied from interface: Action.Container
Removes a previously registered action handler for the contents of this container.
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)
- Specified by:
getActions
in 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
Description copied from interface: Action.Handler
Gets the list of actions applicable to this handler.
handleAction
public void handleAction(Action action,
Object sender,
Object target)
- Specified by:
handleAction
in 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.
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.