Package org.zkoss.stateless.sul

## Interface INavitem

- All Superinterfaces:
    `IChildrenOfInputgroup<INavitem>`, `IChildrenOfNavbar<INavitem>`, `IComponent<INavitem>`, `IDisable<INavitem>`, `IHtmlBasedComponent<INavitem>`, `ILabelElement<INavitem>`, `ILabelImageElement<INavitem>`, `IXulElement<INavitem>`

      public interface INavitem
      extends ILabelImageElement<INavitem>, IDisable<INavitem>, IChildrenOfNavbar<INavitem>

  Immutable `Navitem` component

  A single choice in a `INavbar` or `INav` component. It acts much like a button but it is rendered on a navbar or nav.

  Author:
    katherine
  See Also:
    `Navitem`

- - ### Nested Class Summary

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

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static INavitem` | `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
    --- | --- | ---
    `default java.lang.String` | `getBadgeText()` | Returns the badge text of the nav
    `java.lang.String` | `getContent()` | Returns the embedded content (i.e., HTML tags) that is shown as part of the description.
    `java.lang.String` | `getHref()` | Returns the href.
    `java.lang.String` | `getTarget()` | Returns the target frame or window.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isSelected()` | Returns whether it is selected.
    `static INavitem` | `of​(java.lang.String label)` | Returns the instance with the given label.
    `static INavitem` | `ofIconSclass​(java.lang.String iconSclass)` | Returns the instance with the given iconSclass.
    `static INavitem` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `INavitem` | `withBadgeText​(java.lang.String badgeText)` | Returns a copy of `this` immutable component with the specified `badgeText`.
    `INavitem` | `withContent​(java.lang.String content)` | Returns a copy of `this` immutable component with the specified `content`.
    `INavitem` | `withHref​(java.lang.String href)` | Returns a copy of `this` immutable component with the specified `href`.
    `INavitem` | `withSelected​(boolean selected)` | Returns a copy of `this` immutable component with the specified `selected`.
    `INavitem` | `withTarget​(java.lang.String target)` | Returns a copy of `this` immutable component with the specified `target`.

    - ### 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, 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 INavitem DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zkmax.nav.Navitem"`

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

    - #### getContent

          @Nullable
          java.lang.String getContent()

      Returns the embedded content (i.e., HTML tags) that is shown as part of the description.

      It is useful to show the description in more versatile way.

      Default: `null`

    - #### withContent

          INavitem withContent​(@Nullable
                               java.lang.String content)

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

      Sets the embedded content (i.e., HTML tags) that is shown as part of the description.

      Note: the content is sanitized by default to avoid XSS attack, and please don't use JavaScript in the content.

      Parameters:
        `content` - The embedded content.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getHref

          @Nullable
          java.lang.String getHref()

      Returns the href.

      Default: `null`. If null, the button has no function unless you specify the onClick handler.

    - #### withHref

          INavitem withHref​(@Nullable
                            java.lang.String href)

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

      Sets the href.

      Parameters:
        `href` - The href.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getTarget

          @Nullable
          java.lang.String getTarget()

      Returns the target frame or window.

      Note: it is useful only if href (`withHref(java.lang.String)`) is specified (i.e., use the onClick listener).

      Default: `null`.

    - #### withTarget

          INavitem withTarget​(@Nullable
                              java.lang.String target)

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

      Sets the target frame or window.

      Note: it is useful only if href (`withHref(java.lang.String)`) is specified (i.e., use the onClick listener).

      Parameters:
        `target` - The target frame or window.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### isSelected

          default boolean isSelected()

      Returns whether it is selected.

      Default: false. Notice: while Navbar have two selected Navitem, only last navitem would be selected.

    - #### withSelected

          INavitem withSelected​(boolean selected)

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

      Sets whether it is selected.

      Parameters:
        `selected` - Whether it is selected.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getBadgeText

          default java.lang.String getBadgeText()

      Returns the badge text of the nav

      Default: `""`

    - #### withBadgeText

          INavitem withBadgeText​(@Nullable
                                 java.lang.String badgeText)

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

      Sets the badge text of the navitem

      Parameters:
        `badgeText` - The badge text of the navitem

        Default: `""`.

      Returns:
        A modified copy of the `this` object

    - #### of

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

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

    - #### ofIconSclass

          static INavitem ofIconSclass​(java.lang.String iconSclass)

      Returns the instance with the given iconSclass.
      Parameters:
        `iconSclass` - The iconSclass that the navitem holds.

    - #### ofId

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

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