Package com.inmethod.grid
Class DataProviderAdapter<T,S>
- java.lang.Object
-
- com.inmethod.grid.DataProviderAdapter<T,S>
-
- Type Parameters:
T
- row/item model object type
- All Implemented Interfaces:
IDataSource<T>
,Serializable
,IDetachable
,IClusterable
- Direct Known Subclasses:
AppendableDataProviderAdapter
public class DataProviderAdapter<T,S> extends Object implements IDataSource<T>
Adapter that allows using a wicket extensionIDataProvider
in anAbstractGrid
. The adapter also supports sortable data providers.- Author:
- Matej Knopp
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.inmethod.grid.IDataSource
IDataSource.IQuery, IDataSource.IQueryResult<T>
-
-
Constructor Summary
Constructors Constructor Description DataProviderAdapter(IDataProvider<T> dataProvider)
Creates a newDataProviderAdapter
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
detach()
IModel<T>
model(T object)
Allows wrapping the object in a model which will be set as model of the appropriate row.void
query(IDataSource.IQuery query, IDataSource.IQueryResult<T> result)
Implementation of this method should load subset of the data specified byquery.getFrom()
andquery.getCount()
.
-
-
-
Constructor Detail
-
DataProviderAdapter
public DataProviderAdapter(IDataProvider<T> dataProvider)
Creates a newDataProviderAdapter
instance.- Parameters:
dataProvider
-IDataProvider
instance
-
-
Method Detail
-
detach
public void detach()
- Specified by:
detach
in interfaceIDetachable
-
model
public IModel<T> model(T object)
Allows wrapping the object in a model which will be set as model of the appropriate row. In most cases the model should be detachable.- Specified by:
model
in interfaceIDataSource<T>
- Returns:
- model that can be used to access the object
-
query
public void query(IDataSource.IQuery query, IDataSource.IQueryResult<T> result)
Implementation of this method should load subset of the data specified byquery.getFrom()
andquery.getCount()
. Also if the total item count can be determined, it should be passed toresult
.- Specified by:
query
in interfaceIDataSource<T>
- Parameters:
query
- Specified the amount and position of items to be queriedresult
- Allows to set the total item count and result items
-
-