public static class AvatarGroup.AvatarGroupItem extends Object implements Serializable
Constructor and Description |
---|
AvatarGroupItem()
Creates a new empty avatar group item.
|
AvatarGroupItem(String name)
Creates a new avatar group item with the provided name.
|
AvatarGroupItem(String name,
String url)
Creates a new avatar group item with the provided name and url.
|
Modifier and Type | Method and Description |
---|---|
String |
getAbbreviation()
Gets the abbreviation that was set for the avatar.
|
Integer |
getColorIndex()
Gets the color index for the avatar group item.
|
String |
getImage()
Gets the image url that was set for the avatar.
|
AbstractStreamResource |
getImageResource()
Gets the image that was set for the avatar.
|
String |
getName()
Gets the name that was set for the avatar.
|
void |
setAbbreviation(String abbr)
Sets the abbreviation for the avatar.
|
void |
setColorIndex(Integer colorIndex)
Sets the color index for the avatar group item.
|
void |
setImage(String url)
Sets the image url for the avatar.
|
void |
setImageResource(AbstractStreamResource resource)
Sets the image for the avatar.
|
void |
setName(String name)
Sets the name for the avatar.
|
public AvatarGroupItem()
The avatar displays the user icon in the avatar and "Anonymous" in the tooltip unless overridden by setting other properties.
public AvatarGroupItem(String name)
name
- the name for the avatarsetName(String)
public AvatarGroupItem(String name, String url)
name
- the name for the avatarurl
- the image urlsetName(String)
,
setImage(String)
public String getName()
public void setName(String name)
The name is displayed in a tooltip on hover.
Automatically deduced abbreviation is displayed in the avatar if no abbreviation or image is set.
name
- the name for the avatarpublic String getAbbreviation()
public void setAbbreviation(String abbr)
The abbreviation will be displayed in the avatar if no image has been set.
abbr
- the abbreviationpublic String getImage()
public AbstractStreamResource getImageResource()
null
if the resource has
not been setpublic void setImage(String url)
The image will be displayed in the avatar even if abbreviation or name is set.
Setting the image with this method resets the image resource provided
with setImageResource(AbstractStreamResource)
url
- the image urlsetImageResource(AbstractStreamResource)
public void setImageResource(AbstractStreamResource resource)
Setting the image as a resource with this method resets the image URL
that was set with setImage(String)
resource
- the resource value or null
to remove the resourcesetImage(String)
public Integer getColorIndex()
null
if the index has not been setpublic void setColorIndex(Integer colorIndex)
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.
colorIndex
- the color index or null
to remove the indexCopyright © 2025. All rights reserved.