Interface INavitem

    • 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