Package com.vaadin.event
Class Action
- java.lang.Object
-
- com.vaadin.event.Action
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ShortcutAction
public class Action extends Object implements Serializable
Implements the action framework. This class contains subinterfaces for action handling and listing, and for action handler registrations and unregistration.- Since:
- 3.0
- Author:
- Vaadin Ltd.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAction.ContainerInterface implemented by all components where actions can be registered.static interfaceAction.HandlerInterface implemented by classes who wish to handle actions.static interfaceAction.ListenerAn Action that implements this interface can be added to an Action.Notifier (or NotifierProxy) via theaddAction()-method, which in many cases is easier than implementing the Action.Handler interface.static interfaceAction.NotifierAction.Containers implementing this support an easier way of adding single Actions than the more involved Action.Handler.static interfaceAction.ShortcutNotifier
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCaption()Returns the action's caption.ResourcegetIcon()Returns the action's icon.voidsetCaption(String caption)Sets the caption.voidsetIcon(Resource icon)Sets the icon.
-
-
-
Constructor Detail
-
Action
public Action(String caption)
Constructs a new action with the given caption.- Parameters:
caption- the caption for the new action.
-
-
Method Detail
-
getCaption
public String getCaption()
Returns the action's caption.- Returns:
- the action's caption as a
String.
-
getIcon
public Resource getIcon()
Returns the action's icon.- Returns:
- the action's Icon.
-
setCaption
public void setCaption(String caption)
Sets the caption.- Parameters:
caption- the caption to set.
-
setIcon
public void setIcon(Resource icon)
Sets the icon.- Parameters:
icon- the icon to set.
-
-