Interface IToolbarbutton
- All Superinterfaces:
IAnyGroup<IToolbarbutton>,IButtonBase<IToolbarbutton>,IChildrenOfInputgroup<IToolbarbutton>,IComponent<IToolbarbutton>,IHtmlBasedComponent<IToolbarbutton>,ILabelElement<IToolbarbutton>,ILabelImageElement<IToolbarbutton>,IXulElement<IToolbarbutton>
Toolbarbutton component
The behavior of Toolbarbutton is similar to the button except the appearance is different. The button component uses HTML BUTTON tag, while the toolbarbutton component uses HTML DIV tag.
A toolbarbutton could be placed outside a toolbar. However toolbarbuttons change their appearance if they are placed inside a toolbar.
Toolbarbutton supports getHref(). If getHref() is not null, the onClick handler is ignored and this element is degenerated to HTML's A tag.
Support @Action
| Name | Action Type |
|---|---|
| onCheck | ActionData: CheckData
Denotes when toolbarbutton is checked , only available in toggle mode. |
- Author:
- katherine
- See Also:
-
Toolbarbutton
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeIToolbarbutton.static enumSpecifies the mode withwithMode(Mode).static classBuilds an updater of typeIToolbarbuttonforUiAgent.smartUpdate(Locator, SmartUpdater).Nested classes/interfaces inherited from interface org.zkoss.stateless.sul.IButtonBase
IButtonBase.Direction, IButtonBase.Orient, IButtonBase.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IToolbarbuttonConstant for default attributes of this immutable component. -
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetMode()Returns the current mode.default StringReturns the client widget class.default booleanReturns whether it is checked.static IToolbarbuttonReturns the instance with the given label.static IToolbarbuttonReturns the instance with the given label and image.static IToolbarbuttonReturns the instance with the given dir.static IToolbarbuttonReturns the instance with the given id.static IToolbarbuttonReturns the instance with the given image.static IToolbarbuttonofMode(IToolbarbutton.Mode mode) Returns the instance with the given mode.static IToolbarbuttonofOrient(IButtonBase.Orient orient) Returns the instance with the given orient.withAction(ActionHandler value) Copy the current immutable object by setting a value for theactionattribute.withActions(Iterable<? extends ActionHandler> elements) Copy the current immutable object with elements that replace the content ofactions.withActions(ActionHandler... elements) Copy the current immutable object with elements that replace the content ofactions.withAutodisable(String value) Copy the current immutable object by setting a value for theautodisableattribute.withChecked(boolean checked) Returns a copy ofthisimmutable component with the specifiedchecked.withClientAction(String value) Copy the current immutable object by setting a value for theclientActionattribute.withClientAttributes(Map<String, ? extends String> entries) Copy the current immutable object by replacing theclientAttributesmap with the specified map.withContext(String value) Copy the current immutable object by setting a value for thecontextattribute.withCtrlKeys(String value) Copy the current immutable object by setting a value for thectrlKeysattribute.Copy the current immutable object by setting a value for thedirattribute.withDisabled(boolean value) Copy the current immutable object by setting a value for thedisabledattribute.withDraggable(String value) Copy the current immutable object by setting a value for thedraggableattribute.withDroppable(String value) Copy the current immutable object by setting a value for thedroppableattribute.withEventListenerMap(org.zkoss.zk.ui.sys.EventListenerMap value) Copy the current immutable object by setting a value for theeventListenerMapattribute.withFocus(boolean value) Copy the current immutable object by setting a value for thefocusattribute.withHeight(String value) Copy the current immutable object by setting a value for theheightattribute.Copy the current immutable object by setting a value for thehflexattribute.withHoverImage(String value) Copy the current immutable object by setting a value for thehoverImageattribute.Copy the current immutable object by setting a value for thehrefattribute.withIconSclass(String value) Copy the current immutable object by setting a value for theiconSclassattribute.withIconSclasses(String... elements) Copy the current immutable object with elements that replace the content oficonSclasses.withIconTooltip(String value) Copy the current immutable object by setting a value for theiconTooltipattribute.withIconTooltips(String... elements) Copy the current immutable object with elements that replace the content oficonTooltips.Copy the current immutable object by setting a value for theidattribute.Copy the current immutable object by setting a value for theimageattribute.Copy the current immutable object by setting a value for thelabelattribute.Copy the current immutable object by setting a value for theleftattribute.Returns a copy ofthisimmutable component with the specifiedmode.default IToolbarbuttonwithMode(IToolbarbutton.Mode mode) Returns a copy ofthisimmutable component with the specifiedmode.Copy the current immutable object by setting a value for themoldattribute.withOrient(String value) Copy the current immutable object by setting a value for theorientattribute.Copy the current immutable object by setting a value for thepopupattribute.withPreloadImage(boolean value) Copy the current immutable object by setting a value for thepreloadImageattribute.withRenderdefer(int value) Copy the current immutable object by setting a value for therenderdeferattribute.withSclass(String value) Copy the current immutable object by setting a value for thesclassattribute.withSkeleton(String value) Copy the current immutable object by setting a value for theskeletonattribute.Copy the current immutable object by setting a value for thestyleattribute.withTabindex(Integer value) Copy the current immutable object by setting a value for thetabindexattribute.withTarget(String value) Copy the current immutable object by setting a value for thetargetattribute.withTooltip(String value) Copy the current immutable object by setting a value for thetooltipattribute.withTooltiptext(String value) Copy the current immutable object by setting a value for thetooltiptextattribute.Copy the current immutable object by setting a value for thetopattribute.Copy the current immutable object by setting a value for thetypeattribute.withUpload(String value) Copy the current immutable object by setting a value for theuploadattribute.Copy the current immutable object by setting a value for thevflexattribute.withVisible(boolean value) Copy the current immutable object by setting a value for thevisibleattribute.withWidgetClass(String value) Copy the current immutable object by setting a value for thewidgetClassattribute.withWidgetListeners(Map<String, ? extends String> entries) Copy the current immutable object by replacing thewidgetListenersmap with the specified map.withWidgetOverrides(Map<String, ? extends String> entries) Copy the current immutable object by replacing thewidgetOverridesmap with the specified map.Copy the current immutable object by setting a value for thewidthattribute.withZclass(String value) Copy the current immutable object by setting a value for thezclassattribute.withZIndex(int value) Copy the current immutable object by setting a value for thezIndexattribute.Methods inherited from interface org.zkoss.stateless.sul.IButtonBase
checkOrient, getAutodisable, getDir, getHref, getOrient, getTarget, getType, getUpload, isDisabled, withAutodisable, withDir, withDir, withDisabled, withHref, withOrient, withOrient, withTarget, withType, withType, withUploadMethods 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.Toolbarbutton"- Specified by:
getWidgetClassin interfaceIComponent<IToolbarbutton>
-
getMode
Returns the current mode.Default:
"default" -
withMode
Returns a copy ofthisimmutable component with the specifiedmode.Sets the mode to
"default"and"toggle"- Parameters:
mode- The mode of this component.Default:
"default".- Returns:
- A modified copy of the
thisobject
-
withMode
Returns a copy ofthisimmutable component with the specifiedmode.Sets the mode to
"default"and"toggle"- Parameters:
mode- The mode of this component.Default:
"default".- Returns:
- A modified copy of the
thisobject
-
isChecked
default boolean isChecked()Returns whether it is checked.Default:
false. -
withChecked
Returns a copy ofthisimmutable component with the specifiedchecked.Sets whether it is checked.
- Parameters:
checked- Whether it is checked.Default:
false.- Returns:
- A modified copy of the
thisobject
-
of
Returns the instance with the given label.- Parameters:
label- The label that the component
-
of
Returns the instance with the given label and image.- Parameters:
label- The label that the button holds.image- The image that the button holds.
-
ofImage
Returns the instance with the given image.- Parameters:
image- The image that the button holds.
-
ofMode
Returns the instance with the given mode.- Parameters:
mode- The button mode
-
ofOrient
Returns the instance with the given orient.- Parameters:
orient- The button orient
-
ofDir
Returns the instance with the given dir.- Parameters:
dir- The button dir
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
withId
Copy the current immutable object by setting a value for theidattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withAction
Copy the current immutable object by setting a value for theactionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for action (can benull)- Returns:
- A modified copy of the
thisobject
-
withActions
Copy the current immutable object with elements that replace the content ofactions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withActions
Copy the current immutable object with elements that replace the content ofactions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of actions elements to set- Returns:
- A modified copy of
thisobject
-
withVisible
Copy the current immutable object by setting a value for thevisibleattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for visible- Returns:
- A modified copy of the
thisobject
-
withMold
Copy the current immutable object by setting a value for themoldattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for mold- Returns:
- A modified copy of the
thisobject
-
withEventListenerMap
Copy the current immutable object by setting a value for theeventListenerMapattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for eventListenerMap (can benull)- Returns:
- A modified copy of the
thisobject
-
withWidgetListeners
Copy the current immutable object by replacing thewidgetListenersmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the widgetListeners map- Returns:
- A modified copy of
thisobject
-
withWidgetOverrides
Copy the current immutable object by replacing thewidgetOverridesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the widgetOverrides map- Returns:
- A modified copy of
thisobject
-
withClientAttributes
Copy the current immutable object by replacing theclientAttributesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the clientAttributes map- Returns:
- A modified copy of
thisobject
-
withLeft
Copy the current immutable object by setting a value for theleftattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for left (can benull)- Returns:
- A modified copy of the
thisobject
-
withTop
Copy the current immutable object by setting a value for thetopattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for top (can benull)- Returns:
- A modified copy of the
thisobject
-
withZIndex
Copy the current immutable object by setting a value for thezIndexattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for zIndex- Returns:
- A modified copy of the
thisobject
-
withHeight
Copy the current immutable object by setting a value for theheightattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for height (can benull)- Returns:
- A modified copy of the
thisobject
-
withWidth
Copy the current immutable object by setting a value for thewidthattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for width (can benull)- Returns:
- A modified copy of the
thisobject
-
withTooltiptext
Copy the current immutable object by setting a value for thetooltiptextattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for tooltiptext (can benull)- Returns:
- A modified copy of the
thisobject
-
withZclass
Copy the current immutable object by setting a value for thezclassattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for zclass (can benull)- Returns:
- A modified copy of the
thisobject
-
withSclass
Copy the current immutable object by setting a value for thesclassattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for sclass (can benull)- Returns:
- A modified copy of the
thisobject
-
withStyle
Copy the current immutable object by setting a value for thestyleattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for style (can benull)- Returns:
- A modified copy of the
thisobject
-
withDraggable
Copy the current immutable object by setting a value for thedraggableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for draggable- Returns:
- A modified copy of the
thisobject
-
withFocus
Copy the current immutable object by setting a value for thefocusattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for focus- Returns:
- A modified copy of the
thisobject
-
withDroppable
Copy the current immutable object by setting a value for thedroppableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for droppable- Returns:
- A modified copy of the
thisobject
-
withVflex
Copy the current immutable object by setting a value for thevflexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for vflex (can benull)- Returns:
- A modified copy of the
thisobject
-
withHflex
Copy the current immutable object by setting a value for thehflexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hflex (can benull)- Returns:
- A modified copy of the
thisobject
-
withRenderdefer
Copy the current immutable object by setting a value for therenderdeferattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for renderdefer- Returns:
- A modified copy of the
thisobject
-
withClientAction
Copy the current immutable object by setting a value for theclientActionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for clientAction (can benull)- Returns:
- A modified copy of the
thisobject
-
withTabindex
Copy the current immutable object by setting a value for thetabindexattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for tabindex (can benull)- Returns:
- A modified copy of the
thisobject
-
withSkeleton
Copy the current immutable object by setting a value for theskeletonattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for skeleton (can benull)- Returns:
- A modified copy of the
thisobject
-
withCtrlKeys
Copy the current immutable object by setting a value for thectrlKeysattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ctrlKeys (can benull)- Returns:
- A modified copy of the
thisobject
-
withContext
Copy the current immutable object by setting a value for thecontextattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for context (can benull)- Returns:
- A modified copy of the
thisobject
-
withPopup
Copy the current immutable object by setting a value for thepopupattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for popup (can benull)- Returns:
- A modified copy of the
thisobject
-
withTooltip
Copy the current immutable object by setting a value for thetooltipattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for tooltip (can benull)- Returns:
- A modified copy of the
thisobject
-
withLabel
Copy the current immutable object by setting a value for thelabelattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for label- Returns:
- A modified copy of the
thisobject
-
withIconSclass
Copy the current immutable object by setting a value for theiconSclassattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for iconSclass (can benull)- Returns:
- A modified copy of the
thisobject
-
withIconSclasses
Copy the current immutable object with elements that replace the content oficonSclasses. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for iconSclasses- Returns:
- A modified copy of
thisobject
-
withIconTooltip
Copy the current immutable object by setting a value for theiconTooltipattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for iconTooltip (can benull)- Returns:
- A modified copy of the
thisobject
-
withIconTooltips
Copy the current immutable object with elements that replace the content oficonTooltips. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for iconTooltips- Returns:
- A modified copy of
thisobject
-
withImage
Copy the current immutable object by setting a value for theimageattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for image (can benull)- Returns:
- A modified copy of the
thisobject
-
withHoverImage
Copy the current immutable object by setting a value for thehoverImageattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hoverImage (can benull)- Returns:
- A modified copy of the
thisobject
-
withPreloadImage
Copy the current immutable object by setting a value for thepreloadImageattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for preloadImage- Returns:
- A modified copy of the
thisobject
-
withDir
Copy the current immutable object by setting a value for thedirattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for dir- Returns:
- A modified copy of the
thisobject
-
withOrient
Copy the current immutable object by setting a value for theorientattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for orient- Returns:
- A modified copy of the
thisobject
-
withType
Copy the current immutable object by setting a value for thetypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
withDisabled
Copy the current immutable object by setting a value for thedisabledattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for disabled- Returns:
- A modified copy of the
thisobject
-
withAutodisable
Copy the current immutable object by setting a value for theautodisableattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for autodisable (can benull)- Returns:
- A modified copy of the
thisobject
-
withTarget
Copy the current immutable object by setting a value for thetargetattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for target (can benull)- Returns:
- A modified copy of the
thisobject
-
withUpload
Copy the current immutable object by setting a value for theuploadattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for upload (can benull)- Returns:
- A modified copy of the
thisobject
-
withHref
Copy the current immutable object by setting a value for thehrefattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for href (can benull)- Returns:
- A modified copy of the
thisobject
-
withWidgetClass
Copy the current immutable object by setting a value for thewidgetClassattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for widgetClass- Returns:
- A modified copy of the
thisobject
-