Package org.zkoss.stateless.state
Class ILinelayoutController<DataT>
- java.lang.Object
-
- org.zkoss.stateless.state.ILinelayoutController<DataT>
-
- All Implemented Interfaces:
ItemController<DataT,org.zkoss.zul.ListModel<DataT>,ILinelayout,ILineitem>
public class ILinelayoutController<DataT> extends java.lang.Object implements ItemController<DataT,org.zkoss.zul.ListModel<DataT>,ILinelayout,ILineitem>
AnILinelayoutcontroller 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ILinelayoutbuild()Returns the immutable instance that the controller to build withvoidclear()Clears all the rendered data.org.zkoss.zul.ListModel<DataT>getModel()Returns the model, which is set through byItemController.setModel(Object), or null.CheckedFunction2<DataT,java.lang.Integer,ILineitem>getRenderer()Returns the renderer, which is set through byItemController.setRenderer(CheckedFunction2), or a default one which is depended on implementation.static <D> ILinelayoutController<D>of(ILinelayout owner, org.zkoss.zul.ListModel<D> model)Returns the controller instance with the givenlinelayoutstatic <D> ILinelayoutController<D>of(ILinelayout owner, org.zkoss.zul.ListModel<D> model, CheckedFunction2<D,java.lang.Integer,ILineitem> renderer)Returns the controller instance with the givenlinelayoutvoidsetModel(org.zkoss.zul.ListModel<DataT> model)Sets the given model to this controller.voidsetRenderer(CheckedFunction2<DataT,java.lang.Integer,ILineitem> renderer)Sets the renderer which is used to render each data ifItemController.getModel()is not null.
-
-
-
Method Detail
-
of
public static <D> ILinelayoutController<D> of(ILinelayout owner, org.zkoss.zul.ListModel<D> model)
Returns the controller instance with the givenlinelayout- Parameters:
owner- The controller to control withmodel- The list model to associate with the line layout.
-
of
public static <D> ILinelayoutController<D> of(ILinelayout owner, org.zkoss.zul.ListModel<D> model, CheckedFunction2<D,java.lang.Integer,ILineitem> renderer)
Returns the controller instance with the givenlinelayout- Parameters:
owner- The controller to control withmodel- The list model to associate with the line layout.renderer- The renderer of the list model.
-
setModel
public void setModel(org.zkoss.zul.ListModel<DataT> model)
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- Specified by:
setModelin interfaceItemController<DataT,org.zkoss.zul.ListModel<DataT>,ILinelayout,ILineitem>
-
getModel
public org.zkoss.zul.ListModel<DataT> getModel()
Description copied from interface:ItemControllerReturns the model, which is set through byItemController.setModel(Object), or null.- Specified by:
getModelin interfaceItemController<DataT,org.zkoss.zul.ListModel<DataT>,ILinelayout,ILineitem>
-
setRenderer
public void setRenderer(CheckedFunction2<DataT,java.lang.Integer,ILineitem> renderer)
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>,ILinelayout,ILineitem>
-
getRenderer
public CheckedFunction2<DataT,java.lang.Integer,ILineitem> 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>,ILinelayout,ILineitem>
-
build
public ILinelayout build()
Description copied from interface:ItemControllerReturns the immutable instance that the controller to build with- Specified by:
buildin interfaceItemController<DataT,org.zkoss.zul.ListModel<DataT>,ILinelayout,ILineitem>
-
clear
public void clear()
Description copied from interface:ItemControllerClears all the rendered data.- Specified by:
clearin interfaceItemController<DataT,org.zkoss.zul.ListModel<DataT>,ILinelayout,ILineitem>
-
-