Package org.zkoss.stateless.sul

## Interface ITab

- All Superinterfaces:
    `IChildrenOfInputgroup<ITab>`, `IComponent<ITab>`, `IHtmlBasedComponent<ITab>`, `ILabelElement<ITab>`, `ILabelImageElement<ITab>`, `IXulElement<ITab>`

      public interface ITab
      extends ILabelImageElement<ITab>

  Immutable `Tab` component

  ### Support @Action

  Name | Action Type
  --- | ---
  onClose | Denotes the close button is pressed by a user, and the component shall detach itself.
  onSelect | ActionData: `SelectData` Denotes user has selected a tab. onSelect is sent to both tab and tabbox.

  Author:
    katherine
  See Also:
    `Tab`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `ITab.Builder` | Builds instances of type `ITab`.
    `static class` | `ITab.Updater` | Builds an updater of type `ITab` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static ITab` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ICaption<IAnyGroup>` | `getCaption()` | Returns the caption of this tab.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isClosable()` | Returns whether this tab is closable.
    `default boolean` | `isDisabled()` | Returns whether this tab is disabled.
    `default boolean` | `isSelected()` | Returns whether this tab is selected.
    `static ITab` | `of​(java.lang.String label)` | Returns the instance with the given label.
    `static ITab` | `of​(java.lang.String label, java.lang.String image)` | Returns the instance with the given label and image.
    `static ITab` | `ofCaption​(ICaption caption)` | Returns the instance with the given `ICaption`.
    `static ITab` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static ITab` | `ofImage​(java.lang.String image)` | Returns the instance with the given image.
    `ITab` | `withCaption​(ICaption<IAnyGroup> caption)` | Returns a copy of `this` immutable component with the specified `caption`.
    `ITab` | `withClosable​(boolean closable)` | Returns a copy of `this` immutable component with the specified `closable`.
    `ITab` | `withDisabled​(boolean disabled)` | Returns a copy of `this` immutable component with the specified `disabled`.
    `ITab` | `withSelected​(boolean selected)` | Returns a copy of `this` immutable component with the specified `selected`.

    - ### 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.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, 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 ITab DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.tab.Tab"`

      Specified by:
        `getWidgetClass` in interface `IComponent<ITab>`

    - #### isDisabled

          default boolean isDisabled()

      Returns whether this tab is disabled.

      Default: `false`.

    - #### withDisabled

          ITab withDisabled​(boolean disabled)

      Returns a copy of `this` immutable component with the specified `disabled`.

      Sets whether it is disabled.

      Parameters:
        `disabled` - `ture` to disable this component.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isClosable

          default boolean isClosable()

      Returns whether this tab is closable. If closable, a button is displayed and the `onClose` action is sent if a user clicks the button.

      Default: `false`.

    - #### withClosable

          ITab withClosable​(boolean closable)

      Returns a copy of `this` immutable component with the specified `closable`.

      Sets whether this tab is closable. If closable, a button is displayed and the onClose action is sent if a user clicks the button.

      Parameters:
        `closable` - `ture` to disable this component.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isSelected

          default boolean isSelected()

      Returns whether this tab is selected.

    - #### withSelected

          ITab withSelected​(boolean selected)

      Returns a copy of `this` immutable component with the specified `selected`.

      Sets whether this tab is selected.

      Parameters:
        `selected` - `ture` to select this component.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getCaption

          @Nullable
          ICaption<IAnyGroup> getCaption()

      Returns the caption of this tab.

    - #### withCaption

          ITab withCaption​(@Nullable
                           ICaption<IAnyGroup> caption)

      Returns a copy of `this` immutable component with the specified `caption`.

      Sets the caption child of this component.

      Parameters:
        `caption` - The caption child of the component.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### of

          static ITab of​(java.lang.String label)

      Returns the instance with the given label.
      Parameters:
        `label` - The label that the tab holds.

    - #### of

          static ITab of​(java.lang.String label,
                         java.lang.String image)

      Returns the instance with the given label and image.
      Parameters:
        `label` - The label that the tab holds.
        `image` - The image that the tab holds.

    - #### ofImage

          static ITab ofImage​(java.lang.String image)

      Returns the instance with the given image.
      Parameters:
        `image` - The image that the tab holds.

    - #### ofCaption

          static ITab ofCaption​(ICaption caption)

      Returns the instance with the given `ICaption`.
      Parameters:
        `caption` - The caption container of this component.

    - #### ofId

          static ITab ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component