org.apache.wicket.extensions.markup.html.repeater.util
Class SortableDataProvider

java.lang.Object
  extended by org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider
All Implemented Interfaces:
java.io.Serializable, ISortStateLocator, ISortableDataProvider, IClusterable, IDataProvider, IDetachable
Direct Known Subclasses:
ContactDataProvider, SortableContactDataProvider

public abstract class SortableDataProvider
extends java.lang.Object
implements ISortableDataProvider

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()
          Detaches model after use.
 SortParam getSort()
          Returns current sort state
 ISortState getSortState()
           
 void setSort(SortParam param)
          Sets the current sort state
 void setSort(java.lang.String property, boolean ascending)
          Sets the current sort state
 void setSortState(ISortState state)
          Setter for the sort state object
 
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 getSortState()
Specified by:
getSortState in interface ISortStateLocator
Returns:
ISortState object
See Also:
ISortStateLocator.getSortState()

setSortState

public final void setSortState(ISortState state)
Description copied from interface: ISortStateLocator
Setter for the sort state object

Specified by:
setSortState in interface ISortStateLocator
Parameters:
state - new sort state
See Also:
ISortStateLocator.setSortState(org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortState)

getSort

public SortParam getSort()
Returns current sort state

Returns:
current sort state

setSort

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

Parameters:
param - parameter containing new sorting information

setSort

public void setSort(java.lang.String property,
                    boolean ascending)
Sets the current sort state

Parameters:
property - sort property
ascending - sort direction

detach

public void detach()
Description copied from interface: IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.

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


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.