Package org.zkoss.stateless.sul
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>
ImmutableAvatarcomponent.A user avatar. Supports image, fallback label initials, or an icon font.
- Since:
- 11.0.0
- Author:
- peaker
- See Also:
Avatar
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classIAvatar.BuilderBuilds instances of typeIAvatar.static classIAvatar.UpdaterBuilds an updater of typeIAvatarforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetGap()Returns the horizontal padding (in pixels) around the label text.default java.lang.StringgetShape()Returns the shape of this avatar, or null when it was reset to the default.default java.lang.StringgetSize()Returns the size of this avatar, or null when it was reset to the default.default java.lang.StringgetWidgetClass()Returns the client widget class.static IAvatarof(java.lang.String label)Returns the instance with the given label.static IAvatarof(java.lang.String label, java.lang.String image)Returns the instance with the given label and image.static IAvatarofId(java.lang.String id)Returns the instance with the given id.static IAvatarofImage(java.lang.String image)Returns the instance with the given image.IAvatarwithGap(int gap)Returns a copy ofthisimmutable component with the specifiedgap.IAvatarwithShape(java.lang.String shape)Returns a copy ofthisimmutable component with the specifiedshape.IAvatarwithSize(java.lang.String size)Returns a copy ofthisimmutable component with the specifiedsize.-
Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.ILabelElement
getLabel, withLabel
-
Methods inherited from interface org.zkoss.stateless.sul.ILabelImageElement
getHoverImage, getIconSclass, getIconSclasses, getIconTooltip, getIconTooltips, getImage, isPreloadImage, withHoverImage, withIconSclass, withIconSclasses, withIconTooltip, withIconTooltips, withImage, withPreloadImage
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
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:
getWidgetClassin interfaceIComponent<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 ofthisimmutable component with the specifiedshape.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
thisobject
-
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 ofthisimmutable component with the specifiedsize.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
thisobject
-
getGap
default int getGap()
Returns the horizontal padding (in pixels) around the label text.Default:
4.
-
withGap
IAvatar withGap(int gap)
Returns a copy ofthisimmutable component with the specifiedgap.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
thisobject
-
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 avatarimage- 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
-
-