org.apache.wicket.extensions.markup.html.repeater.util
Class SortableDataProvider<T,S>

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider<T,S>
Type Parameters:
T -
S - the type of the sorting parameter
All Implemented Interfaces:
Serializable, ISortStateLocator<S>, ISortableDataProvider<T,S>, IDataProvider<T>, IDetachable, org.apache.wicket.util.io.IClusterable

public abstract class SortableDataProvider<T,S>
extends Object
implements ISortableDataProvider<T,S>

Convenience implementation of a data provider that can also act as a locator for a SingleSortState object. Most times it is convenient to keep sort and filtering information inside the data provider implementation because it makes that information easy to access within the data provider.

Author:
Igor Vaynberg (ivaynberg at apache dot org)
See Also:
Serialized Form

Constructor Summary
SortableDataProvider()
           
 
Method Summary
 void detach()
           
 SortParam<S> getSort()
          Returns current sort state
 ISortState<S> getSortState()
           
 void setSort(SortParam<S> param)
          Sets the current sort state
 void setSort(S property, SortOrder order)
          Sets the current sort state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.markup.repeater.data.IDataProvider
iterator, model, size
 

Constructor Detail

SortableDataProvider

public SortableDataProvider()
Method Detail

getSortState

public final ISortState<S> getSortState()
Specified by:
getSortState in interface ISortStateLocator<S>
Returns:
ISortState object
See Also:
ISortStateLocator.getSortState()

getSort

public SortParam<S> getSort()
Returns current sort state

Returns:
current sort state

setSort

public void setSort(SortParam<S> param)
Sets the current sort state

Parameters:
param - parameter containing new sorting information

setSort

public void setSort(S property,
                    SortOrder order)
Sets the current sort state

Parameters:
property - sort property
order - sort order

detach

public void detach()
Specified by:
detach in interface IDetachable
See Also:
IDetachable.detach()


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.