com.vaadin.ui.

Class Image

    • Constructor Detail

      • Image

        public Image()

        Creates a new empty Image.

      • Image

        public Image​(String caption)

        Creates a new empty Image with caption.

        Parameters:

        caption -

      • Image

        public Image​(String caption,
                     Resource source)

        Creates a new Image whose contents is loaded from given resource. The dimensions are assumed if possible. The type is guessed from resource.

        Parameters:

        caption -

        source - the Source of the embedded object.

    • Method Detail

      • getState

        protected ImageState getState()

        Description copied from class: AbstractComponent

        Returns the shared state bean with information to be sent from the server to the client. Subclasses should override this method and set any relevant fields of the state returned by super.getState().

        Overrides:

        getState in class AbstractEmbedded

        Returns:

        updated component shared state

      • addClickListener

        public Registration addClickListener​(MouseEvents.ClickListener listener)

        Add a click listener to the component. The listener is called whenever the user clicks inside the component. Depending on the content the event may be blocked and in that case no event is fired.

        Parameters:

        listener - The listener to add, not null

        Returns:

        a registration object for removing the listener

        Since:

        8.0

        See Also:

        Registration