Class Action

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    ShortcutAction

    public class Action
    extends java.lang.Object
    implements java.io.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 interface  Action.Container
      Interface implemented by all components where actions can be registered.
      static interface  Action.Handler
      Interface implemented by classes who wish to handle actions.
      static interface  Action.Listener
      An Action that implements this interface can be added to an Action.Notifier (or NotifierProxy) via the addAction() -method, which in many cases is easier than implementing the Action.Handler interface.
      static interface  Action.Notifier
      Action.Containers implementing this support an easier way of adding single Actions than the more involved Action.Handler.
      static interface  Action.ShortcutNotifier  
    • Constructor Summary

      Constructors 
      Constructor Description
      Action​(java.lang.String caption)
      Constructs a new action with the given caption.
      Action​(java.lang.String caption, Resource icon)
      Constructs a new action with the given caption string and icon.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getCaption()
      Returns the action's caption.
      Resource getIcon()
      Returns the action's icon.
      void setCaption​(java.lang.String caption)
      Sets the caption.
      void setIcon​(Resource icon)
      Sets the icon.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Action

        public Action​(java.lang.String caption)
        Constructs a new action with the given caption.
        Parameters:
        caption - the caption for the new action.
      • Action

        public Action​(java.lang.String caption,
                      Resource icon)
        Constructs a new action with the given caption string and icon.
        Parameters:
        caption - the caption for the new action.
        icon - the icon for the new action.
    • Method Detail

      • getCaption

        public java.lang.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​(java.lang.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.