Class Stepbar
- All Implemented Interfaces:
Serializable,Cloneable,Component,Scope,ComponentCtrl
Only support browsers that support Flex. (IE11, Edge, Chrome, Firefox, Safari)
Default getZclass(): z-stepbar.
- Since:
- 9.0.0
- Author:
- jameschu
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
HtmlBasedComponent.ExtraCtrlNested 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
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields 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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanback()Activate previous step if possible.voidbeforeChildAdded(Component child, Component insertBefore) Default: does nothing.intReturn the index of the active step.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.Returns the orient.getSteps()Returns the steps in this stepbar.Returns the ZK Cascading Style class for this component.booleaninsertBefore(Component newChild, Component refChild) Inserts a child before the reference child.booleanisLinear()Returns whether the steps in this stepbar are displayed by order.booleanReturns whether it is a vertical step bar.booleanReturns whether the labels in children steps is wrapped.booleannext()Activate next step if possible.voidvoidonPageAttached(Page newpage, Page oldpage) Default: handles special event listeners.voidonPageDetached(Page page) Default: handles special event listeners.booleanremoveChild(Component child) Removes a child.protected voidrenderProperties(ContentRenderer renderer) Renders the content of this component, excluding the enclosing tags and children.voidProcesses an AU request.voidsetActiveIndex(int activeIndex) Sets the index of the active step.voidsetActiveStep(Step step) Sets the active step.voidsetLinear(boolean linear) Sets whether the steps in this stepbar are displayed by order.voidSets the step model associated with this stepbar.voidSets the orient.voidsetStepRenderer(StepRenderer stepRenderer) voidsetWrappedLabels(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, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, 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, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods 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, getStubonlyDescendants, 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, setStubonlyDescendants, 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
-
Constructor Details
-
Stepbar
public Stepbar()
-
-
Method Details
-
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
Return the active step.Default: first step.
- Returns:
- the active step.
-
setActiveStep
Sets the active step.- Parameters:
step- the active step.
-
getOrient
Returns the orient.Default: "horizontal".
- Since:
- 10.2.0
-
setOrient
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
-
setStepRenderer
-
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
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
Description copied from class:AbstractComponentDefault: handles special event listeners.- Specified by:
onPageAttachedin interfaceComponentCtrl- Overrides:
onPageAttachedin classAbstractComponent- 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:
-
onPageDetached
Description copied from class:AbstractComponentDefault: handles special event listeners.- Specified by:
onPageDetachedin interfaceComponentCtrl- Overrides:
onPageDetachedin classAbstractComponent- Parameters:
page- the previous page (never null)- See Also:
-
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
Returns the steps in this stepbar.It is the same as
AbstractComponent.getChildren().- Returns:
- list of steps
-
beforeChildAdded
Description copied from class:AbstractComponentDefault: does nothing.- Specified by:
beforeChildAddedin interfaceComponentCtrl- Overrides:
beforeChildAddedin classAbstractComponent- 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:
-
insertBefore
Description copied from interface:ComponentInserts a child before the reference child.You could use
Component.setParent(org.zkoss.zk.ui.Component)orComponent.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 backComponent.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)and/orComponent.removeChild(org.zkoss.zk.ui.Component), whileComponent.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)andComponent.removeChild(org.zkoss.zk.ui.Component)always calls backComponent.setParent(org.zkoss.zk.ui.Component), if the parent is changed. Thus, you don't need to override bothComponent.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)andComponent.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:
insertBeforein interfaceComponent- Overrides:
insertBeforein classAbstractComponent- 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
Description copied from interface:ComponentRemoves a child. The child is not actually removed. Rather, it is detached (seeComponent.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 backComponent.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)and/orComponent.removeChild(org.zkoss.zk.ui.Component), whileComponent.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)andComponent.removeChild(org.zkoss.zk.ui.Component)always calls backComponent.setParent(org.zkoss.zk.ui.Component), if the parent is changed. Thus, you don't need to override bothComponent.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)andComponent.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:
removeChildin interfaceComponent- Overrides:
removeChildin classAbstractComponent- Returns:
- true if child is removed successfully; false if it doesn't have the specified child
-
renderProperties
Description copied from class:HtmlBasedComponentRenders the content of this component, excluding the enclosing tags and children.- Overrides:
renderPropertiesin classXulElement- Throws:
IOException
-
service
Description copied from class:HtmlBasedComponentProcesses an AU request.Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.
- Specified by:
servicein interfaceComponentCtrl- Overrides:
servicein classHtmlBasedComponenteverError- whether any error ever occurred before processing this request.- See Also:
-
getZclass
Description copied from class:HtmlBasedComponentReturns 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 ofHtmlBasedComponent.getZclass(). Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, useHtmlBasedComponent.setSclass(java.lang.String)instead.- Overrides:
getZclassin classHtmlBasedComponent- See Also:
-