Interface IAvatar

    • Field Detail

      • DEFAULT

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

      • getWidgetClass

        default java.lang.String getWidgetClass()
        Returns the client widget class.

        Default: "zul.wgt.Avatar"

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

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

        Default: "circle".

      • withShape

        IAvatar withShape​(@Nullable
                          java.lang.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 java.lang.String getSize()
        Returns the size of this avatar, or null when it was reset to the default.

        Default: "medium".

      • withSize

        IAvatar withSize​(@Nullable
                         java.lang.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​(java.lang.String label)
        Returns the instance with the given label.
        Parameters:
        label - The label of the avatar
      • of

        static IAvatar of​(java.lang.String label,
                          java.lang.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​(java.lang.String image)
        Returns the instance with the given image.
        Parameters:
        image - The image of the avatar
      • ofId

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