Package org.zkoss.stateless.sul
Interface IChip
- All Superinterfaces:
IAnyGroup<IChip>,IChildrenOfInputgroup<IChip>,IComponent<IChip>,IDisable<IChip>,IHtmlBasedComponent<IChip>,ILabelElement<IChip>,ILabelImageElement<IChip>,IXulElement<IChip>
Immutable
Chip component.
A display-only chip used to show categories, statuses, or keywords, with an optional close button and a severity theme.
Support @Action
| Name | Action Type |
|---|---|
| onClose | Denotes the user clicked the close button of a
closable chip. It carries no action data;
unlike Chip.onClose(), nothing is detached for you — render
the tree again without this chip to make it disappear. |
- Since:
- 11.0.0
- Author:
- peaker
- See Also:
-
Chip
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIChip.static classBuilds an updater of typeIChipforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns the severity (color theme), or null when it was reset to the default.default StringgetSize()Returns the size of this chip, or null when it was reset to the default.default StringReturns the client widget class.default booleanReturns whether this chip displays a close button.default booleanReturns whether this chip is rounded (pill-shaped).static IChipReturns the instance with the given label.static IChipReturns the instance with the given id.withClosable(boolean closable) Returns a copy ofthisimmutable component with the specifiedclosable.withRounded(boolean rounded) Returns a copy ofthisimmutable component with the specifiedrounded.withSeverity(String severity) Returns a copy ofthisimmutable component with the specifiedseverity.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.IDisable
isDisabled, withDisabledMethods 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.Chip"- Specified by:
getWidgetClassin interfaceIComponent<IChip>
-
getSeverity
Returns the severity (color theme), or null when it was reset to the default.Default:
"info". -
withSeverity
Returns a copy ofthisimmutable component with the specifiedseverity.Sets the severity (color theme).
- Parameters:
severity- one of"info","success","warning","error"or"neutral".Default:
"info".- Returns:
- A modified copy of the
thisobject
-
getSize
Returns the size of this chip, or null when it was reset to the default.Default:
"medium". Medium maps to the default 22px row, small reduces the row height for dense layouts. -
withSize
Returns a copy ofthisimmutable component with the specifiedsize.Sets the chip size.
- Parameters:
size-"small"or"medium".Default:
"medium".- Returns:
- A modified copy of the
thisobject
-
isRounded
default boolean isRounded()Returns whether this chip is rounded (pill-shaped).Default:
false. -
withRounded
Returns a copy ofthisimmutable component with the specifiedrounded.Sets whether this chip is rounded (pill-shaped).
- Parameters:
rounded- whether the chip is rounded.Default:
false.- Returns:
- A modified copy of the
thisobject
-
isClosable
default boolean isClosable()Returns whether this chip displays a close button.Default:
false. -
withClosable
Returns a copy ofthisimmutable component with the specifiedclosable.Sets whether this chip displays a close button.
- Parameters:
closable- whether the chip displays a close button.Default:
false.- Returns:
- A modified copy of the
thisobject
-
of
Returns the instance with the given label.- Parameters:
label- The label of the chip
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-