Interface IToolbarbutton

All Superinterfaces:
IAnyGroup<IToolbarbutton>, IButtonBase<IToolbarbutton>, IChildrenOfInputgroup<IToolbarbutton>, IComponent<IToolbarbutton>, IHtmlBasedComponent<IToolbarbutton>, ILabelElement<IToolbarbutton>, ILabelImageElement<IToolbarbutton>, IXulElement<IToolbarbutton>

public interface IToolbarbutton extends IButtonBase<IToolbarbutton>, IAnyGroup<IToolbarbutton>
Immutable 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
  • Field Details

    • DEFAULT

      static final IToolbarbutton DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.wgt.Toolbarbutton"

      Specified by:
      getWidgetClass in interface IComponent<IToolbarbutton>
    • getMode

      default String getMode()
      Returns the current mode.

      Default: "default"

    • withMode

      IToolbarbutton withMode(String mode)
      Returns a copy of this immutable component with the specified mode.

      Sets the mode to "default" and "toggle"

      Parameters:
      mode - The mode of this component.

      Default: "default".

      Returns:
      A modified copy of the this object
    • withMode

      default IToolbarbutton withMode(IToolbarbutton.Mode mode)
      Returns a copy of this immutable component with the specified mode.

      Sets the mode to "default" and "toggle"

      Parameters:
      mode - The mode of this component.

      Default: "default".

      Returns:
      A modified copy of the this object
    • isChecked

      default boolean isChecked()
      Returns whether it is checked.

      Default: false.

    • withChecked

      IToolbarbutton withChecked(boolean checked)
      Returns a copy of this immutable component with the specified checked.

      Sets whether it is checked.

      Parameters:
      checked - Whether it is checked.

      Default: false.

      Returns:
      A modified copy of the this object
    • of

      static IToolbarbutton of(String label)
      Returns the instance with the given label.
      Parameters:
      label - The label that the component
    • of

      static IToolbarbutton of(String label, String image)
      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

      static IToolbarbutton ofImage(String image)
      Returns the instance with the given image.
      Parameters:
      image - The image that the button holds.
    • ofMode

      static IToolbarbutton ofMode(IToolbarbutton.Mode mode)
      Returns the instance with the given mode.
      Parameters:
      mode - The button mode
    • ofOrient

      static IToolbarbutton ofOrient(IButtonBase.Orient orient)
      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

      static IToolbarbutton ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component
    • withId

      IToolbarbutton withId(String value)
      Copy the current immutable object by setting a value for the id attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • withAction

      IToolbarbutton withAction(@Nullable ActionHandler value)
      Copy the current immutable object by setting a value for the action attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for action (can be null)
      Returns:
      A modified copy of the this object
    • withActions

      IToolbarbutton withActions(ActionHandler... elements)
      Copy the current immutable object with elements that replace the content of actions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withActions

      IToolbarbutton withActions(Iterable<? extends ActionHandler> elements)
      Copy the current immutable object with elements that replace the content of actions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of actions elements to set
      Returns:
      A modified copy of this object
    • withVisible

      IToolbarbutton withVisible(boolean value)
      Copy the current immutable object by setting a value for the visible attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for visible
      Returns:
      A modified copy of the this object
    • withMold

      IToolbarbutton withMold(String value)
      Copy the current immutable object by setting a value for the mold attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for mold
      Returns:
      A modified copy of the this object
    • withEventListenerMap

      IToolbarbutton withEventListenerMap(@Nullable org.zkoss.zk.ui.sys.EventListenerMap value)
      Copy the current immutable object by setting a value for the eventListenerMap attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for eventListenerMap (can be null)
      Returns:
      A modified copy of the this object
    • withWidgetListeners

      IToolbarbutton withWidgetListeners(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the widgetListeners map 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 returning this.
      Parameters:
      entries - The entries to be added to the widgetListeners map
      Returns:
      A modified copy of this object
    • withWidgetOverrides

      IToolbarbutton withWidgetOverrides(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the widgetOverrides map 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 returning this.
      Parameters:
      entries - The entries to be added to the widgetOverrides map
      Returns:
      A modified copy of this object
    • withClientAttributes

      IToolbarbutton withClientAttributes(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the clientAttributes map 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 returning this.
      Parameters:
      entries - The entries to be added to the clientAttributes map
      Returns:
      A modified copy of this object
    • withLeft

      IToolbarbutton withLeft(@Nullable String value)
      Copy the current immutable object by setting a value for the left attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for left (can be null)
      Returns:
      A modified copy of the this object
    • withTop

      IToolbarbutton withTop(@Nullable String value)
      Copy the current immutable object by setting a value for the top attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for top (can be null)
      Returns:
      A modified copy of the this object
    • withZIndex

      IToolbarbutton withZIndex(int value)
      Copy the current immutable object by setting a value for the zIndex attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for zIndex
      Returns:
      A modified copy of the this object
    • withHeight

      IToolbarbutton withHeight(@Nullable String value)
      Copy the current immutable object by setting a value for the height attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for height (can be null)
      Returns:
      A modified copy of the this object
    • withWidth

      IToolbarbutton withWidth(@Nullable String value)
      Copy the current immutable object by setting a value for the width attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for width (can be null)
      Returns:
      A modified copy of the this object
    • withTooltiptext

      IToolbarbutton withTooltiptext(@Nullable String value)
      Copy the current immutable object by setting a value for the tooltiptext attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tooltiptext (can be null)
      Returns:
      A modified copy of the this object
    • withZclass

      IToolbarbutton withZclass(@Nullable String value)
      Copy the current immutable object by setting a value for the zclass attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for zclass (can be null)
      Returns:
      A modified copy of the this object
    • withSclass

      IToolbarbutton withSclass(@Nullable String value)
      Copy the current immutable object by setting a value for the sclass attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sclass (can be null)
      Returns:
      A modified copy of the this object
    • withStyle

      IToolbarbutton withStyle(@Nullable String value)
      Copy the current immutable object by setting a value for the style attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for style (can be null)
      Returns:
      A modified copy of the this object
    • withDraggable

      IToolbarbutton withDraggable(String value)
      Copy the current immutable object by setting a value for the draggable attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for draggable
      Returns:
      A modified copy of the this object
    • withFocus

      IToolbarbutton withFocus(boolean value)
      Copy the current immutable object by setting a value for the focus attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for focus
      Returns:
      A modified copy of the this object
    • withDroppable

      IToolbarbutton withDroppable(String value)
      Copy the current immutable object by setting a value for the droppable attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for droppable
      Returns:
      A modified copy of the this object
    • withVflex

      IToolbarbutton withVflex(@Nullable String value)
      Copy the current immutable object by setting a value for the vflex attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for vflex (can be null)
      Returns:
      A modified copy of the this object
    • withHflex

      IToolbarbutton withHflex(@Nullable String value)
      Copy the current immutable object by setting a value for the hflex attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hflex (can be null)
      Returns:
      A modified copy of the this object
    • withRenderdefer

      IToolbarbutton withRenderdefer(int value)
      Copy the current immutable object by setting a value for the renderdefer attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for renderdefer
      Returns:
      A modified copy of the this object
    • withClientAction

      IToolbarbutton withClientAction(@Nullable String value)
      Copy the current immutable object by setting a value for the clientAction attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for clientAction (can be null)
      Returns:
      A modified copy of the this object
    • withTabindex

      IToolbarbutton withTabindex(@Nullable Integer value)
      Copy the current immutable object by setting a value for the tabindex attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tabindex (can be null)
      Returns:
      A modified copy of the this object
    • withSkeleton

      IToolbarbutton withSkeleton(@Nullable String value)
      Copy the current immutable object by setting a value for the skeleton attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for skeleton (can be null)
      Returns:
      A modified copy of the this object
    • withCtrlKeys

      IToolbarbutton withCtrlKeys(@Nullable String value)
      Copy the current immutable object by setting a value for the ctrlKeys attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ctrlKeys (can be null)
      Returns:
      A modified copy of the this object
    • withContext

      IToolbarbutton withContext(@Nullable String value)
      Copy the current immutable object by setting a value for the context attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for context (can be null)
      Returns:
      A modified copy of the this object
    • withPopup

      IToolbarbutton withPopup(@Nullable String value)
      Copy the current immutable object by setting a value for the popup attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for popup (can be null)
      Returns:
      A modified copy of the this object
    • withTooltip

      IToolbarbutton withTooltip(@Nullable String value)
      Copy the current immutable object by setting a value for the tooltip attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tooltip (can be null)
      Returns:
      A modified copy of the this object
    • withLabel

      IToolbarbutton withLabel(String value)
      Copy the current immutable object by setting a value for the label attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for label
      Returns:
      A modified copy of the this object
    • withIconSclass

      IToolbarbutton withIconSclass(@Nullable String value)
      Copy the current immutable object by setting a value for the iconSclass attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for iconSclass (can be null)
      Returns:
      A modified copy of the this object
    • withIconSclasses

      IToolbarbutton withIconSclasses(String... elements)
      Copy the current immutable object with elements that replace the content of iconSclasses. The array is cloned before being saved as attribute values.
      Parameters:
      elements - The non-null elements for iconSclasses
      Returns:
      A modified copy of this object
    • withIconTooltip

      IToolbarbutton withIconTooltip(@Nullable String value)
      Copy the current immutable object by setting a value for the iconTooltip attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for iconTooltip (can be null)
      Returns:
      A modified copy of the this object
    • withIconTooltips

      IToolbarbutton withIconTooltips(String... elements)
      Copy the current immutable object with elements that replace the content of iconTooltips. The array is cloned before being saved as attribute values.
      Parameters:
      elements - The non-null elements for iconTooltips
      Returns:
      A modified copy of this object
    • withImage

      IToolbarbutton withImage(@Nullable String value)
      Copy the current immutable object by setting a value for the image attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for image (can be null)
      Returns:
      A modified copy of the this object
    • withHoverImage

      IToolbarbutton withHoverImage(@Nullable String value)
      Copy the current immutable object by setting a value for the hoverImage attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hoverImage (can be null)
      Returns:
      A modified copy of the this object
    • withPreloadImage

      IToolbarbutton withPreloadImage(boolean value)
      Copy the current immutable object by setting a value for the preloadImage attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for preloadImage
      Returns:
      A modified copy of the this object
    • withDir

      IToolbarbutton withDir(String value)
      Copy the current immutable object by setting a value for the dir attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for dir
      Returns:
      A modified copy of the this object
    • withOrient

      IToolbarbutton withOrient(String value)
      Copy the current immutable object by setting a value for the orient attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for orient
      Returns:
      A modified copy of the this object
    • withType

      IToolbarbutton withType(String value)
      Copy the current immutable object by setting a value for the type attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy of the this object
    • withDisabled

      IToolbarbutton withDisabled(boolean value)
      Copy the current immutable object by setting a value for the disabled attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for disabled
      Returns:
      A modified copy of the this object
    • withAutodisable

      IToolbarbutton withAutodisable(@Nullable String value)
      Copy the current immutable object by setting a value for the autodisable attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for autodisable (can be null)
      Returns:
      A modified copy of the this object
    • withTarget

      IToolbarbutton withTarget(@Nullable String value)
      Copy the current immutable object by setting a value for the target attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for target (can be null)
      Returns:
      A modified copy of the this object
    • withUpload

      IToolbarbutton withUpload(@Nullable String value)
      Copy the current immutable object by setting a value for the upload attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for upload (can be null)
      Returns:
      A modified copy of the this object
    • withHref

      IToolbarbutton withHref(@Nullable String value)
      Copy the current immutable object by setting a value for the href attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for href (can be null)
      Returns:
      A modified copy of the this object
    • withWidgetClass

      IToolbarbutton withWidgetClass(String value)
      Copy the current immutable object by setting a value for the widgetClass attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for widgetClass
      Returns:
      A modified copy of the this object