Package org.zkoss.stateless.state
Class IBiglistboxController<Row,Head,Cell,Header>
- java.lang.Object
-
- org.zkoss.stateless.state.IBiglistboxController<Row,Head,Cell,Header>
-
- All Implemented Interfaces:
ItemController<java.lang.Object,MatrixModel<Row,Head,Cell,Header>,IBiglistbox,java.lang.String>
public class IBiglistboxController<Row,Head,Cell,Header> extends java.lang.Object implements ItemController<java.lang.Object,MatrixModel<Row,Head,Cell,Header>,IBiglistbox,java.lang.String>
AnIBiglistbox
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IBiglistbox
build()
Returns the immutable instance that the controller to build withvoid
clear()
Clears all the rendered data.MatrixModel<Row,Head,Cell,Header>
getModel()
Returns the model, which is set through byItemController.setModel(Object)
, or null.CheckedFunction2<java.lang.Object,java.lang.Integer,java.lang.String>
getRenderer()
Returns the renderer, which is set through byItemController.setRenderer(CheckedFunction2)
, or a default one which is depended on implementation.int
getSelectedIndex()
Returns the index of the selected item (-1 if no one is selected).java.lang.Object
getSelectedObject()
Returns the selected object or null.static <Row,Head,Cell,Header>
IBiglistboxController<Row,Head,Cell,Header>of(IBiglistbox owner, MatrixModel<Row,Head,Cell,Header> model)
Returns the controller instance with the givenbiglistbox
static <Row,Head,Cell,Header>
IBiglistboxController<Row,Head,Cell,Header>of(IBiglistbox owner, MatrixModel<Row,Head,Cell,Header> model, CheckedFunction2<java.lang.Object,java.lang.Integer,java.lang.String> renderer)
Returns the controller instance with the givenbiglistbox
void
setModel(MatrixModel<Row,Head,Cell,Header> model)
Sets the given model to this controller.void
setRenderer(CheckedFunction2<java.lang.Object,java.lang.Integer,java.lang.String> renderer)
Sets the renderer which is used to render each data ifItemController.getModel()
is not null.void
setSelectedIndex(int jsel)
Selects the item with the given index.void
setSelectedObject(java.lang.Object item)
Sets the selected object or null.
-
-
-
Method Detail
-
setModel
public void setModel(MatrixModel<Row,Head,Cell,Header> model)
Description copied from interface:ItemController
Sets 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
public MatrixModel<Row,Head,Cell,Header> getModel()
Description copied from interface:ItemController
Returns the model, which is set through byItemController.setModel(Object)
, or null.
-
of
public static <Row,Head,Cell,Header> IBiglistboxController<Row,Head,Cell,Header> of(IBiglistbox owner, MatrixModel<Row,Head,Cell,Header> 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 <Row,Head,Cell,Header> IBiglistboxController<Row,Head,Cell,Header> of(IBiglistbox owner, MatrixModel<Row,Head,Cell,Header> model, CheckedFunction2<java.lang.Object,java.lang.Integer,java.lang.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
public void setRenderer(CheckedFunction2<java.lang.Object,java.lang.Integer,java.lang.String> renderer)
Description copied from interface:ItemController
Sets 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:
setRenderer
in interfaceItemController<Row,Head,Cell,Header>
-
getRenderer
public CheckedFunction2<java.lang.Object,java.lang.Integer,java.lang.String> getRenderer()
Description copied from interface:ItemController
Returns the renderer, which is set through byItemController.setRenderer(CheckedFunction2)
, or a default one which is depended on implementation.- Specified by:
getRenderer
in interfaceItemController<Row,Head,Cell,Header>
-
build
public IBiglistbox build()
Description copied from interface:ItemController
Returns the immutable instance that the controller to build with
-
clear
public void clear()
Description copied from interface:ItemController
Clears all the rendered data.
-
getSelectedIndex
public int getSelectedIndex()
Returns the index of the selected item (-1 if no one is selected).Default:
-1
or depends onSelectable
-
getSelectedObject
public java.lang.Object getSelectedObject()
Returns the selected object or null.Default:
null
-
setSelectedIndex
public void setSelectedIndex(int jsel)
Selects the item with the given index.
-
setSelectedObject
public void setSelectedObject(java.lang.Object item)
Sets the selected object or null.
-
-