Package org.zkoss.stateless.state
Class IBiglistboxController<RowT,HeadT,CellT,HeaderT>
java.lang.Object
org.zkoss.stateless.state.IBiglistboxController<RowT,HeadT,CellT,HeaderT>
- All Implemented Interfaces:
ItemController<Object,org.zkoss.zkmax.zul.MatrixModel<RowT, HeadT, CellT, HeaderT>, IBiglistbox, String>
public class IBiglistboxController<RowT,HeadT,CellT,HeaderT>
extends Object
implements ItemController<Object,org.zkoss.zkmax.zul.MatrixModel<RowT,HeadT,CellT,HeaderT>,IBiglistbox,String>
An
IBiglistbox 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 TypeMethodDescriptionbuild()Returns the immutable instance that the controller to build withvoidclear()Clears all the rendered data.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.intReturns the index of the selected item (-1 if no one is selected).Returns the selected object or null.static <RowT,HeadT, CellT, HeaderT>
IBiglistboxController<RowT,HeadT, CellT, HeaderT> of(IBiglistbox owner, org.zkoss.zkmax.zul.MatrixModel<RowT, HeadT, CellT, HeaderT> model) Returns the controller instance with the givenbiglistboxstatic <RowT,HeadT, CellT, HeaderT>
IBiglistboxController<RowT,HeadT, CellT, HeaderT> of(IBiglistbox owner, org.zkoss.zkmax.zul.MatrixModel<RowT, HeadT, CellT, HeaderT> model, CheckedFunction2<Object, Integer, String> renderer) Returns the controller instance with the givenbiglistboxvoidSets the given model to this controller.voidsetRenderer(CheckedFunction2<Object, Integer, String> renderer) Sets the renderer which is used to render each data ifItemController.getModel()is not null.voidsetSelectedIndex(int jsel) Selects the item with the given index.voidsetSelectedObject(Object item) Sets the selected object or null.
-
Method Details
-
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. -
of
public static <RowT,HeadT, IBiglistboxController<RowT,CellT, HeaderT> HeadT, ofCellT, HeaderT> (IBiglistbox owner, org.zkoss.zkmax.zul.MatrixModel<RowT, HeadT, CellT, HeaderT> model) Returns the controller instance with the givenbiglistbox- Parameters:
owner- The controller to control withmodel- The matrix model to associate with the biglistbox.
-
of
public static <RowT,HeadT, IBiglistboxController<RowT,CellT, HeaderT> HeadT, ofCellT, HeaderT> (IBiglistbox owner, org.zkoss.zkmax.zul.MatrixModel<RowT, HeadT, CellT, HeaderT> model, CheckedFunction2<Object, Integer, String> renderer) Returns the controller instance with the givenbiglistbox- Parameters:
owner- The controller to control withmodel- The matrix model to associate with the biglistbox.renderer- The renderer of the matrix model.
-
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<RowT,HeadT, CellT, HeaderT>
-
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<RowT,HeadT, CellT, HeaderT>
-
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. -
getSelectedIndex
public int getSelectedIndex()Returns the index of the selected item (-1 if no one is selected).Default:
-1or depends onSelectable -
getSelectedObject
Returns the selected object or null.Default:
null -
setSelectedIndex
public void setSelectedIndex(int jsel) Selects the item with the given index. -
setSelectedObject
Sets the selected object or null.
-