You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.component.avatar.

Class AvatarGroup.AvatarGroupItem

    • Constructor Detail

      • AvatarGroupItem

        public AvatarGroupItem()

        Creates a new empty avatar group item.

        The avatar displays the user icon in the avatar and "Anonymous" in the tooltip unless overridden by setting other properties.

      • AvatarGroupItem

        public AvatarGroupItem​(String name)

        Creates a new avatar group item with the provided name.

        Parameters:

        name - the name for the avatar

        See Also:

        setName(String)

      • AvatarGroupItem

        public AvatarGroupItem​(String name,
                               String url)

        Creates a new avatar group item with the provided name and url.

        Parameters:

        name - the name for the avatar

        url - the image url

        See Also:

        setName(String), setImage(String)

    • Method Detail

      • getName

        public String getName()

        Gets the name that was set for the avatar.

        Returns:

        the name

      • setName

        public void setName​(String name)

        Sets the name for the avatar.

        The name is displayed in a tooltip on hover.

        Automatically deduced abbreviation is displayed in the avatar if no abbreviation or image is set.

        Parameters:

        name - the name for the avatar

      • getAbbreviation

        public String getAbbreviation()

        Gets the abbreviation that was set for the avatar.

        Returns:

        the abbreviation

      • setAbbreviation

        public void setAbbreviation​(String abbr)

        Sets the abbreviation for the avatar.

        The abbreviation will be displayed in the avatar if no image has been set.

        Parameters:

        abbr - the abbreviation

      • getImage

        public String getImage()

        Gets the image url that was set for the avatar.

        Returns:

        the image url

      • getImageResource

        public AbstractStreamResource getImageResource()

        Gets the image that was set for the avatar.

        Returns:

        the image resource value or null if the resource has not been set

      • setImageResource

        public void setImageResource​(AbstractStreamResource resource)

        Sets the image for the avatar.

        Setting the image as a resource with this method resets the image URL that was set with setImage(String)

        Parameters:

        resource - the resource value or null to remove the resource

        See Also:

        setImage(String)

      • getColorIndex

        public Integer getColorIndex()

        Gets the color index for the avatar group item.

        Returns:

        the color index or null if the index has not been set

      • setColorIndex

        public void setColorIndex​(Integer colorIndex)

        Sets the color index for the avatar group item.

        The color index defines which color will be used for the border of the avatar. Color index N applies CSS variable --vaadin-user-color-N to the border.

        Parameters:

        colorIndex - the color index or null to remove the index