Interface IAvatar

All Superinterfaces:
IAnyGroup<IAvatar>, IChildrenOfInputgroup<IAvatar>, IComponent<IAvatar>, IHtmlBasedComponent<IAvatar>, ILabelElement<IAvatar>, ILabelImageElement<IAvatar>, IXulElement<IAvatar>

public interface IAvatar extends ILabelImageElement<IAvatar>, IAnyGroup<IAvatar>
Immutable Avatar component.

A user avatar. Supports image, fallback label initials, or an icon font.

Since:
11.0.0
Author:
peaker
See Also:
  • Avatar
  • Field Details

    • DEFAULT

      static final IAvatar DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Avatar"

      Specified by:
      getWidgetClass in interface IComponent<IAvatar>
    • getShape

      @Nullable default String getShape()
      Returns the shape of this avatar, or null when it was reset to the default.

      Default: "circle".

    • withShape

      IAvatar withShape(@Nullable String shape)
      Returns a copy of this immutable component with the specified shape.

      Sets the shape of this avatar.

      Parameters:
      shape - either "circle" or "square", or null to reset to the default.

      Default: "circle".

      Returns:
      A modified copy of the this object
    • getSize

      @Nullable default String getSize()
      Returns the size of this avatar, or null when it was reset to the default.

      Default: "medium".

    • withSize

      IAvatar withSize(@Nullable String size)
      Returns a copy of this immutable component with the specified size.

      Sets the size of this avatar.

      Parameters:
      size - "small", "medium" or "large", or null to reset to the default.

      Default: "medium".

      Returns:
      A modified copy of the this object
    • getGap

      default int getGap()
      Returns the horizontal padding (in pixels) around the label text.

      Default: 4.

    • withGap

      IAvatar withGap(int gap)
      Returns a copy of this immutable component with the specified gap.

      Sets the horizontal padding (in pixels) around the label text.

      Parameters:
      gap - the inset, in pixels, that the rendered initials keep from each side; must be in the range 0 to 24 inclusive.

      Default: 4.

      Returns:
      A modified copy of the this object
    • of

      static IAvatar of(String label)
      Returns the instance with the given label.
      Parameters:
      label - The label of the avatar
    • of

      static IAvatar of(String label, String image)
      Returns the instance with the given label and image.
      Parameters:
      label - The label of the avatar
      image - The image of the avatar
    • ofImage

      static IAvatar ofImage(String image)
      Returns the instance with the given image.
      Parameters:
      image - The image of the avatar
    • ofId

      static IAvatar ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component