Interface INavitem
- All Superinterfaces:
IChildrenOfInputgroup<INavitem>,IChildrenOfNavbar<INavitem>,IComponent<INavitem>,IDisable<INavitem>,IHtmlBasedComponent<INavitem>,ILabelElement<INavitem>,ILabelImageElement<INavitem>,IXulElement<INavitem>
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 ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeINavitem.static classBuilds an updater of typeINavitemforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault StringReturns the badge text of the navReturns the embedded content (i.e., HTML tags) that is shown as part of the description.getHref()Returns the href.Returns the target frame or window.default StringReturns the client widget class.default booleanReturns whether it is selected.static INavitemReturns the instance with the given label.static INavitemofIconSclass(String iconSclass) Returns the instance with the given iconSclass.static INavitemReturns the instance with the given id.withBadgeText(String badgeText) Returns a copy ofthisimmutable component with the specifiedbadgeText.withContent(String content) Returns a copy ofthisimmutable component with the specifiedcontent.Returns a copy ofthisimmutable component with the specifiedhref.withSelected(boolean selected) Returns a copy ofthisimmutable component with the specifiedselected.withTarget(String target) Returns a copy ofthisimmutable component with the specifiedtarget.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, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IDisable
isDisabled, withDisabledMethods 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:
"zkmax.nav.Navitem"- Specified by:
getWidgetClassin interfaceIComponent<INavitem>
-
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
Returns a copy ofthisimmutable component with the specifiedcontent.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
thisobject
-
getHref
Returns the href.Default:
null. If null, the button has no function unless you specify the onClick handler. -
withHref
Returns a copy ofthisimmutable component with the specifiedhref.Sets the href.
- Parameters:
href- The href.Default:
null.- Returns:
- A modified copy of the
thisobject
-
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
Returns a copy ofthisimmutable component with the specifiedtarget.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
thisobject
-
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
Returns a copy ofthisimmutable component with the specifiedselected.Sets whether it is selected.
- Parameters:
selected- Whether it is selected.Default:
false.- Returns:
- A modified copy of the
thisobject
-
getBadgeText
Returns the badge text of the navDefault:
"" -
withBadgeText
Returns a copy ofthisimmutable component with the specifiedbadgeText.Sets the badge text of the navitem
- Parameters:
badgeText- The badge text of the navitemDefault:
"".- Returns:
- A modified copy of the
thisobject
-
of
Returns the instance with the given label.- Parameters:
label- The label that the component holds.
-
ofIconSclass
Returns the instance with the given iconSclass.- Parameters:
iconSclass- The iconSclass that the navitem holds.
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-