Package org.zkoss.stateless.state
Class IGridController<DataT,RowT extends IRowBase>
java.lang.Object
org.zkoss.stateless.state.IGridController<DataT,RowT>
- All Implemented Interfaces:
ItemController<DataT,org.zkoss.zul.ListModel<DataT>, IGrid, RowT>
public class IGridController<DataT,RowT extends IRowBase>
extends Object
implements ItemController<DataT,org.zkoss.zul.ListModel<DataT>,IGrid,RowT>
An
IGrid 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.CheckedFunction3<DataT,Integer, org.zkoss.zul.ext.GroupingInfo, RowT> Returns the groups renderer.org.zkoss.zul.ListModel<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.static <D,G, F, R extends IRowBase>
IGridController<D,R> Returns the controller instance with the givengridstatic <D,G, F, R extends IRowBase>
IGridController<D,R> of(IGrid owner, org.zkoss.zul.GroupsModel<D, G, F> model, CheckedFunction3<D, Integer, org.zkoss.zul.ext.GroupingInfo, R> renderer) Returns the controller instance with the givengridstatic <D,R extends IRowBase>
IGridController<D,R> Returns the controller instance with the givengridstatic <D,R extends IRowBase>
IGridController<D,R> of(IGrid owner, org.zkoss.zul.ListModel<D> model, CheckedFunction2<D, Integer, R> renderer) Returns the controller instance with the givengridvoidsetGroupsRenderer(CheckedFunction3<DataT, Integer, org.zkoss.zul.ext.GroupingInfo, RowT> renderer) Sets the groups renderer forGroupsModelvoidsetModel(org.zkoss.zul.GroupsModel<?, ?, ?> model) Sets the groups model for this controller to render.voidSets the given model to this controller.voidsetRenderer(CheckedFunction2<DataT, Integer, RowT> renderer) Sets the renderer which is used to render each data ifItemController.getModel()is not null.
-
Method Details
-
of
public static <D,R extends IRowBase> IGridController<D,R> of(IGrid owner, org.zkoss.zul.ListModel<D> model) Returns the controller instance with the givengrid- Parameters:
owner- The controller to control withmodel- The list model to associate with the grid.
-
of
public static <D,R extends IRowBase> IGridController<D,R> of(IGrid owner, org.zkoss.zul.ListModel<D> model, CheckedFunction2<D, Integer, R> renderer) Returns the controller instance with the givengrid- Parameters:
owner- The controller to control withmodel- The list model to associate with the grid.renderer- The renderer of the list model.
-
of
public static <D,G, IGridController<D,F, R extends IRowBase> R> of(IGrid owner, org.zkoss.zul.GroupsModel<D, G, F> model) Returns the controller instance with the givengrid- Parameters:
owner- The controller to control withmodel- The groups model to associate with the grid.
-
of
public static <D,G, IGridController<D,F, R extends IRowBase> R> of(IGrid owner, org.zkoss.zul.GroupsModel<D, G, F> model, CheckedFunction3<D, Integer, org.zkoss.zul.ext.GroupingInfo, R> renderer) Returns the controller instance with the givengrid- Parameters:
owner- The controller to control withmodel- The groups model to associate with the grid.renderer- The renderer of the groups 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 -
setModel
public void setModel(org.zkoss.zul.GroupsModel<?, ?, ?> model) Sets the groups model for this controller to render.- Parameters:
model- The groups model.
-
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.zul.ListModel<DataT>, IGrid, RowT extends IRowBase>
-
setGroupsRenderer
public void setGroupsRenderer(CheckedFunction3<DataT, Integer, org.zkoss.zul.ext.GroupingInfo, RowT> renderer) Sets the groups renderer forGroupsModel- Parameters:
renderer- The renderer for GroupsModel.
-
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.zul.ListModel<DataT>, IGrid, RowT extends IRowBase>
-
getGroupsRenderer
Returns the groups renderer.Default:
null -
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.
-