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>
public interface IChip extends ILabelImageElement<IChip>, IAnyGroup<IChip>, IDisable<IChip>
ImmutableChipcomponent.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 closablechip. It carries no action data; unlikeChip.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 Classes Modifier and Type Interface Description static classIChip.BuilderBuilds instances of typeIChip.static classIChip.UpdaterBuilds an updater of typeIChipforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.StringgetSeverity()Returns the severity (color theme), or null when it was reset to the default.default java.lang.StringgetSize()Returns the size of this chip, or null when it was reset to the default.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisClosable()Returns whether this chip displays a close button.default booleanisRounded()Returns whether this chip is rounded (pill-shaped).static IChipof(java.lang.String label)Returns the instance with the given label.static IChipofId(java.lang.String id)Returns the instance with the given id.IChipwithClosable(boolean closable)Returns a copy ofthisimmutable component with the specifiedclosable.IChipwithRounded(boolean rounded)Returns a copy ofthisimmutable component with the specifiedrounded.IChipwithSeverity(java.lang.String severity)Returns a copy ofthisimmutable component with the specifiedseverity.IChipwithSize(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.IDisable
isDisabled, withDisabled
-
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 IChip 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.Chip"- Specified by:
getWidgetClassin interfaceIComponent<IChip>
-
getSeverity
@Nullable default java.lang.String getSeverity()
Returns the severity (color theme), or null when it was reset to the default.Default:
"info".
-
withSeverity
IChip withSeverity(@Nullable java.lang.String severity)
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
@Nullable default java.lang.String 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
IChip withSize(@Nullable java.lang.String size)
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
IChip withRounded(boolean rounded)
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
IChip withClosable(boolean closable)
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
static IChip of(java.lang.String label)
Returns the instance with the given label.- Parameters:
label- The label of the chip
-
ofId
static IChip ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
-