Package org.zkoss.stateless.state
Class IStepbarController<DataT>
java.lang.Object
org.zkoss.stateless.state.IStepbarController<DataT>
- All Implemented Interfaces:
ItemController<DataT,org.zkoss.zkmax.zul.StepModel<DataT>, IStepbar, IStep>
public class IStepbarController<DataT>
extends Object
implements ItemController<DataT,org.zkoss.zkmax.zul.StepModel<DataT>,IStepbar,IStep>
An
IStepbar controller to control any operation on the given model.
Note: this class is not thread-safe, so when it's used in multi-threading environment, the developer should handle the threading issue.
- Author:
- katherine
-
Method Summary
Modifier and TypeMethodDescriptionvoidback()Activate previous step if possible.build()Returns the immutable instance that the controller to build withvoidclear()Clears all the rendered data.intReturn the index of the active step.org.zkoss.zkmax.zul.StepModel<DataT>getModel()Returns the model, which is set through byItemController.setModel(Object), or null.Returns the renderer, which is set through byItemController.setRenderer(CheckedFunction2), or a default one which is depended on implementation.voidnext()Activate next step if possible.static <D> IStepbarController<D>Returns the controller instance with the givenstepbarstatic <D> IStepbarController<D>of(IStepbar owner, org.zkoss.zkmax.zul.StepModel<D> model, CheckedFunction2<D, Integer, IStep> renderer) Returns the controller instance with the givenstepbarvoidsetActiveIndex(int activeIndex) Sets the index of the active step.voidSets the given model to this controller.voidsetRenderer(CheckedFunction2<DataT, Integer, IStep> renderer) Sets the renderer which is used to render each data ifItemController.getModel()is not null.
-
Method Details
-
of
Returns the controller instance with the givenstepbar- Parameters:
owner- The controller to control withmodel- The step model to associate with the stepbar.
-
of
public static <D> IStepbarController<D> of(IStepbar owner, org.zkoss.zkmax.zul.StepModel<D> model, CheckedFunction2<D, Integer, IStep> renderer) Returns the controller instance with the givenstepbar- Parameters:
owner- The controller to control withmodel- The step model to associate with the stepbar.renderer- The renderer of the step model.
-
setModel
Description copied from interface:ItemControllerSets the given model to this controller.Note: calling this method after
ItemController.build(), you should invokeItemController.build()again to take effect to replace the current one at client.
For example,uiAgent.replaceWith(locator, itemController.build());Default:
null -
getModel
Description copied from interface:ItemControllerReturns the model, which is set through byItemController.setModel(Object), or null. -
setRenderer
Description copied from interface:ItemControllerSets the renderer which is used to render each data ifItemController.getModel()is not null.Note: calling this method after
ItemController.build(), you should invokeItemController.build()again to take effect to replace the current one at client.
For example,uiAgent.replaceWith(locator, itemController.build());Default:
null, or depended on the implementation- Specified by:
setRendererin interfaceItemController<DataT,org.zkoss.zkmax.zul.StepModel<DataT>, IStepbar, IStep>
-
getRenderer
Description copied from interface:ItemControllerReturns the renderer, which is set through byItemController.setRenderer(CheckedFunction2), or a default one which is depended on implementation.- Specified by:
getRendererin interfaceItemController<DataT,org.zkoss.zkmax.zul.StepModel<DataT>, IStepbar, IStep>
-
build
Description copied from interface:ItemControllerReturns the immutable instance that the controller to build with -
clear
public void clear()Description copied from interface:ItemControllerClears all the rendered data. -
getActiveIndex
public int getActiveIndex()Return the index of the active step.Default:
0. -
setActiveIndex
public void setActiveIndex(int activeIndex) Sets the index of the active step. -
next
public void next()Activate next step if possible. -
back
public void back()Activate previous step if possible.
-