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>
ImmutableNavitemcomponentA single choice in a
INavbarorINavcomponent. 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 classINavitem.BuilderBuilds instances of typeINavitem.static classINavitem.UpdaterBuilds an updater of typeINavitemforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.StringgetBadgeText()Returns the badge text of the navjava.lang.StringgetContent()Returns the embedded content (i.e., HTML tags) that is shown as part of the description.java.lang.StringgetHref()Returns the href.java.lang.StringgetTarget()Returns the target frame or window.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisSelected()Returns whether it is selected.static INavitemof(java.lang.String label)Returns the instance with the given label.static INavitemofIconSclass(java.lang.String iconSclass)Returns the instance with the given iconSclass.static INavitemofId(java.lang.String id)Returns the instance with the given id.INavitemwithBadgeText(java.lang.String badgeText)Returns a copy ofthisimmutable component with the specifiedbadgeText.INavitemwithContent(java.lang.String content)Returns a copy ofthisimmutable component with the specifiedcontent.INavitemwithHref(java.lang.String href)Returns a copy ofthisimmutable component with the specifiedhref.INavitemwithSelected(boolean selected)Returns a copy ofthisimmutable component with the specifiedselected.INavitemwithTarget(java.lang.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, 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:
getWidgetClassin interfaceIComponent<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 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
@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 ofthisimmutable component with the specifiedhref.Sets the href.
- Parameters:
href- The href.Default:
null.- Returns:
- A modified copy of the
thisobject
-
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 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
INavitem withSelected(boolean selected)
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
default java.lang.String getBadgeText()
Returns the badge text of the navDefault:
""
-
withBadgeText
INavitem withBadgeText(@Nullable java.lang.String badgeText)
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
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
-
-