Package org.zkoss.zkmax.zul

## Class Stepbar

- java.lang.Object
- - org.zkoss.zk.ui.AbstractComponent
  - - org.zkoss.zk.ui.HtmlBasedComponent
    - - org.zkoss.zul.impl.XulElement
      - - org.zkoss.zkmax.zul.Stepbar

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Cloneable`, `Component`, `Scope`, `ComponentCtrl`

      public class Stepbar
      extends XulElement

  A stepbar. Shows several steps that represent sequential navigation.

  Only support browsers that support Flex. (IE11, Edge, Chrome, Firefox, Safari)

  Default `getZclass()`: z-stepbar.

  Since:
    9.0.0
  Author:
    jameschu
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `HtmlBasedComponent.ExtraCtrl`

    - ### Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

      `AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfo`

  - ### Field Summary

    - ### Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `_zclass`

    - ### Fields inherited from interface org.zkoss.zk.ui.Component

      `APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE`

    - ### Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

      `AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Stepbar()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `back()` | Activate previous step if possible.
    `void` | `beforeChildAdded​(Component child, Component insertBefore)` | Default: does nothing.
    `int` | `getActiveIndex()` | Return the index of the active step.
    `Step` | `getActiveStep()` | Return the active step.
    `StepModel<?>` | `getModel()` | Returns the step model associated with this stepbar, or null if this stepbar is not associated with any step model.
    `java.lang.String` | `getOrient()` | Returns the orient.
    `StepRenderer` | `getStepRenderer()` |
    `java.util.List<Step>` | `getSteps()` | Returns the steps in this stepbar.
    `java.lang.String` | `getZclass()` | Returns the ZK Cascading Style class for this component.
    `boolean` | `insertBefore​(Component newChild, Component refChild)` | Inserts a child before the reference child.
    `boolean` | `isLinear()` | Returns whether the steps in this stepbar are displayed by order.
    `boolean` | `isVertical()` | Returns whether it is a vertical step bar.
    `boolean` | `isWrappedLabels()` | Returns whether the labels in children steps is wrapped.
    `boolean` | `next()` | Activate next step if possible.
    `void` | `onInitRender()` |
    `void` | `onPageAttached​(Page newpage, Page oldpage)` | Default: handles special event listeners.
    `void` | `onPageDetached​(Page page)` | Default: handles special event listeners.
    `boolean` | `removeChild​(Component child)` | Removes a child.
    `protected void` | `renderProperties​(ContentRenderer renderer)` | Renders the content of this component, excluding the enclosing tags and children.
    `void` | `service​(AuRequest request, boolean everError)` | Processes an AU request.
    `void` | `setActiveIndex​(int activeIndex)` | Sets the index of the active step.
    `void` | `setActiveStep​(Step step)` | Sets the active step.
    `void` | `setLinear​(boolean linear)` | Sets whether the steps in this stepbar are displayed by order.
    `void` | `setModel​(StepModel<?> model)` | Sets the step model associated with this stepbar.
    `void` | `setOrient​(java.lang.String orient)` | Sets the orient.
    `void` | `setStepRenderer​(StepRenderer stepRenderer)` |
    `void` | `setWrappedLabels​(boolean wrappedLabels)` | Sets whether the labels in children steps is wrapped.

    - ### Methods inherited from class org.zkoss.zul.impl.XulElement

      `clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes`

    - ### Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent

      `addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly`

    - ### Methods inherited from class org.zkoss.zk.ui.AbstractComponent

      `addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### Stepbar

          public Stepbar()

  - ### Method Detail

    - #### isWrappedLabels

          public boolean isWrappedLabels()

      Returns whether the labels in children steps is wrapped.

      Default: false.

      Returns:
        whether the labels in children steps is wrapped.

    - #### setWrappedLabels

          public void setWrappedLabels​(boolean wrappedLabels)

      Sets whether the labels in children steps is wrapped.
      Parameters:
        `wrappedLabels` - the labels in children steps is wrapped.

    - #### isLinear

          public boolean isLinear()

      Returns whether the steps in this stepbar are displayed by order.

      Default: true.

      Returns:
        whether the steps in this stepbar are displayed by order.

    - #### setLinear

          public void setLinear​(boolean linear)

      Sets whether the steps in this stepbar are displayed by order.
      Parameters:
        `linear` - whether the steps in this stepbar are displayed by order.

    - #### getActiveIndex

          public int getActiveIndex()

      Return the index of the active step.

      Default: 0.

      Returns:
        the index of the active step.

    - #### setActiveIndex

          public void setActiveIndex​(int activeIndex)

      Sets the index of the active step.
      Parameters:
        `activeIndex` - the index of the active step.

    - #### getActiveStep

          public Step getActiveStep()

      Return the active step.

      Default: first step.

      Returns:
        the active step.

    - #### setActiveStep

          public void setActiveStep​(Step step)

      Sets the active step.
      Parameters:
        `step` - the active step.

    - #### getOrient

          public java.lang.String getOrient()

      Returns the orient.

      Default: "horizontal".

      Since:
        10.2.0

    - #### setOrient

          public void setOrient​(java.lang.String orient)
                         throws WrongValueException

      Sets the orient.

      Default : "horizontal"

      Parameters:
        `orient` - either "horizontal" or "vertical".
      Throws:
        `WrongValueException`
      Since:
        10.2.0

    - #### isVertical

          public boolean isVertical()

      Returns whether it is a vertical step bar.
      Since:
        10.2.0

    - #### getStepRenderer

          public StepRenderer getStepRenderer()

    - #### setStepRenderer

          public void setStepRenderer​(StepRenderer stepRenderer)

    - #### getModel

          public StepModel<?> getModel()

      Returns the step model associated with this stepbar, or null if this stepbar is not associated with any step model.

      Default: null.

      Returns:
        the step model.

    - #### setModel

          public void setModel​(StepModel<?> model)

      Sets the step model associated with this stepbar. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render.
      Parameters:
        `model` - the stepbar model to associate, or null to dis-associate any previous model.
      Throws:
        `UiException` - if failed to initialize with the model

    - #### onInitRender

          public void onInitRender()

    - #### onPageAttached

          public void onPageAttached​(Page newpage,
                                     Page oldpage)

      Description copied from class: `AbstractComponent`
      Default: handles special event listeners.
      Specified by:
        `onPageAttached` in interface `ComponentCtrl`
      Overrides:
        `onPageAttached` in class `AbstractComponent`
      Parameters:
        `newpage` - the new page (never null).
        `oldpage` - the previous page, if any, or null if it didn't belong to any page.
      See Also:
        `ComponentCtrl.onPageAttached(org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)`

    - #### onPageDetached

          public void onPageDetached​(Page page)

      Description copied from class: `AbstractComponent`
      Default: handles special event listeners.
      Specified by:
        `onPageDetached` in interface `ComponentCtrl`
      Overrides:
        `onPageDetached` in class `AbstractComponent`
      Parameters:
        `page` - the previous page (never null)
      See Also:
        `ComponentCtrl.onPageDetached(org.zkoss.zk.ui.Page)`

    - #### next

          public boolean next()

      Activate next step if possible.
      Returns:
        can activate to previous component or not.

    - #### back

          public boolean back()

      Activate previous step if possible.
      Returns:
        can activate to step component or not.

    - #### getSteps

          public java.util.List<Step> getSteps()

      Returns the steps in this stepbar.

      It is the same as `AbstractComponent.getChildren()`.

      Returns:
        list of steps

    - #### beforeChildAdded

          public void beforeChildAdded​(Component child,
                                       Component insertBefore)

      Description copied from class: `AbstractComponent`
      Default: does nothing.
      Specified by:
        `beforeChildAdded` in interface `ComponentCtrl`
      Overrides:
        `beforeChildAdded` in class `AbstractComponent`
      Parameters:
        `child` - the child to be added (never null).
        `insertBefore` - another child component that the new child will be inserted before it. If null, the new child will be the last child.
      See Also:
        `ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)`

    - #### insertBefore

          public boolean insertBefore​(Component newChild,
                                      Component refChild)

      Description copied from interface: `Component`
      Inserts a child before the reference child.

      You could use `Component.setParent(org.zkoss.zk.ui.Component)` or `Component.appendChild(org.zkoss.zk.ui.Component)` instead of this method, unless you want to control where to put the child.

      Note: `Component.setParent(org.zkoss.zk.ui.Component)` always calls back `Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)` and/or `Component.removeChild(org.zkoss.zk.ui.Component)`, while `Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)` and `Component.removeChild(org.zkoss.zk.ui.Component)` always calls back `Component.setParent(org.zkoss.zk.ui.Component)`, if the parent is changed. Thus, you don't need to override both `Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)` and `Component.setParent(org.zkoss.zk.ui.Component)`, if you want to customize the behavior.

      If you would like to monitor if a component is attached or detached from a page, you could register a desktop listener implementing `UiLifeCycle`.

      Specified by:
        `insertBefore` in interface `Component`
      Overrides:
        `insertBefore` in class `AbstractComponent`
      Parameters:
        `newChild` - the new child to be inserted.
        `refChild` - the child before which you want the new child being inserted. If null, the new child is append to the end.
      Returns:
        true if newChild is added successfully or moved; false if it already has the specified child and the order doesn't change.

    - #### removeChild

          public boolean removeChild​(Component child)

      Description copied from interface: `Component`
      Removes a child. The child is not actually removed. Rather, it is detached (see `Component.detach()`) and it will be removed if it is no longer used.

      You could use `Component.setParent(org.zkoss.zk.ui.Component)` with null instead of this method.

      Note: `Component.setParent(org.zkoss.zk.ui.Component)` always calls back `Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)` and/or `Component.removeChild(org.zkoss.zk.ui.Component)`, while `Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)` and `Component.removeChild(org.zkoss.zk.ui.Component)` always calls back `Component.setParent(org.zkoss.zk.ui.Component)`, if the parent is changed. Thus, you don't need to override both `Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)` and `Component.setParent(org.zkoss.zk.ui.Component)`, if you want to customize the behavior.

      If you would like to monitor if a component is attached or detached from a page, you could register a desktop listener implementing `UiLifeCycle`.

      Specified by:
        `removeChild` in interface `Component`
      Overrides:
        `removeChild` in class `AbstractComponent`
      Returns:
        true if child is removed successfully; false if it doesn't have the specified child

    - #### renderProperties

          protected void renderProperties​(ContentRenderer renderer)
                                   throws java.io.IOException

      Description copied from class: `HtmlBasedComponent`
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
        `renderProperties` in class `XulElement`
      Throws:
        `java.io.IOException`

    - #### service

          public void service​(AuRequest request,
                              boolean everError)

      Description copied from class: `HtmlBasedComponent`
      Processes an AU request.

      Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.

      Specified by:
        `service` in interface `ComponentCtrl`
      Overrides:
        `service` in class `HtmlBasedComponent`
        `everError` - whether any error ever occurred before processing this request.
      See Also:
        `AbstractComponent.setAuService(org.zkoss.zk.au.AuService)`

    - #### getZclass

          public java.lang.String getZclass()

      Description copied from class: `HtmlBasedComponent`
      Returns the ZK Cascading Style class for this component. It usually depends on the implementation of the mold (`AbstractComponent.getMold()`).

      Default: null (the default value depends on element).

      `HtmlBasedComponent.setZclass(java.lang.String)`) will completely replace the default style of a component. In other words, the default style of a component is associated with the default value of `HtmlBasedComponent.getZclass()`. Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, use `HtmlBasedComponent.setSclass(java.lang.String)` instead.

      Overrides:
        `getZclass` in class `HtmlBasedComponent`
      See Also:
        `HtmlBasedComponent.getSclass()`