Package org.zkoss.stateless.sul
Interface IAvatar
- All Superinterfaces:
IAnyGroup<IAvatar>,IChildrenOfInputgroup<IAvatar>,IComponent<IAvatar>,IHtmlBasedComponent<IAvatar>,ILabelElement<IAvatar>,ILabelImageElement<IAvatar>,IXulElement<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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIAvatar.static classBuilds an updater of typeIAvatarforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault intgetGap()Returns the horizontal padding (in pixels) around the label text.default StringgetShape()Returns the shape of this avatar, or null when it was reset to the default.default StringgetSize()Returns the size of this avatar, or null when it was reset to the default.default StringReturns the client widget class.static IAvatarReturns the instance with the given label.static IAvatarReturns the instance with the given label and image.static IAvatarReturns the instance with the given id.static IAvatarReturns the instance with the given image.withGap(int gap) Returns a copy ofthisimmutable component with the specifiedgap.Returns a copy ofthisimmutable component with the specifiedshape.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, withWidgetOverridesMethods 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, withZIndexMethods inherited from interface org.zkoss.stateless.sul.ILabelElement
getLabel, withLabelMethods inherited from interface org.zkoss.stateless.sul.ILabelImageElement
getHoverImage, getIconSclass, getIconSclasses, getIconTooltip, getIconTooltips, getImage, isPreloadImage, withHoverImage, withIconSclass, withIconSclasses, withIconTooltip, withIconTooltips, withImage, withPreloadImageMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.wgt.Avatar"- Specified by:
getWidgetClassin interfaceIComponent<IAvatar>
-
getShape
Returns the shape of this avatar, or null when it was reset to the default.Default:
"circle". -
withShape
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
Returns the size of this avatar, or null when it was reset to the default.Default:
"medium". -
withSize
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
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
Returns the instance with the given label.- Parameters:
label- The label of the avatar
-
of
Returns the instance with the given label and image.- Parameters:
label- The label of the avatarimage- The image of the avatar
-
ofImage
Returns the instance with the given image.- Parameters:
image- The image of the avatar
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-