wicket.extensions.markup.html.repeater.data.sort
Class SortableDataProvider

java.lang.Object
  extended bywicket.extensions.markup.html.repeater.data.sort.SortableDataProvider
All Implemented Interfaces:
IDataProvider, ISortableDataProvider, java.io.Serializable

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

A ISortableDataProvider that allows sorting on columns.

Author:
Igor Vaynberg, Phil Kulak
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class wicket.extensions.markup.html.repeater.data.sort.ISortableDataProvider
ISortableDataProvider.SortState
 
Constructor Summary
SortableDataProvider()
           
 
Method Summary
 void addSort(SortParam sp)
          Adds the sort parameter to the end of the list.
 void addSort(java.lang.String property)
          Adds the field to the end of the sort list.
 void addSort(java.lang.String property, boolean ascending)
          Adds the sort parameter to the front of the list.
 void clearSort()
          Removes all sorting fields.
 SortParam getSort()
           
 java.util.List getSortList()
           
 ISortableDataProvider.SortState getSortState(java.lang.String property)
          Gets the sort state of a property
 void setDefaultSort(java.lang.String property, boolean ascending)
          Sets the sort parameter to use when no other fields are set.
 void setMaxColumns(int maxColumns)
          Sets the maximum number of columns to sort on.
 void setSort(SortParam sp)
          Removes all previous sort fields and adds the one given.
 void setSort(java.lang.String property, boolean ascending)
          Removes all previous sort fields and adds the one given.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wicket.extensions.markup.html.repeater.data.IDataProvider
iterator, model, size
 

Constructor Detail

SortableDataProvider

public SortableDataProvider()
Method Detail

clearSort

public void clearSort()
Removes all sorting fields.


setDefaultSort

public void setDefaultSort(java.lang.String property,
                           boolean ascending)
Sets the sort parameter to use when no other fields are set.

Parameters:
property - the name of the property to sort on
ascending - true for ascending, false for descending

setMaxColumns

public void setMaxColumns(int maxColumns)
Sets the maximum number of columns to sort on.

Parameters:
maxColumns - max number of columns

addSort

public void addSort(SortParam sp)
Adds the sort parameter to the end of the list.

Parameters:
sp - the parameter to add

addSort

public void addSort(java.lang.String property,
                    boolean ascending)
Adds the sort parameter to the front of the list.

Parameters:
property - the name of the property to sort on
ascending - true for ascending, false for descending

addSort

public void addSort(java.lang.String property)
Description copied from interface: ISortableDataProvider
Adds the field to the end of the sort list. If it already exists, it's first removed, then the ordering is flipped.

Specified by:
addSort in interface ISortableDataProvider
Parameters:
property - the name of the property to sort on
See Also:
ISortableDataProvider.addSort(String)

getSort

public SortParam getSort()
Returns:
the last sort added, null if none.

getSortList

public java.util.List getSortList()
Specified by:
getSortList in interface ISortableDataProvider
Returns:
the current list of sort parameters.

setSort

public void setSort(SortParam sp)
Removes all previous sort fields and adds the one given.

Parameters:
sp - new sort param

setSort

public void setSort(java.lang.String property,
                    boolean ascending)
Removes all previous sort fields and adds the one given.

Parameters:
property - sort property
ascending - ascending flag

getSortState

public ISortableDataProvider.SortState getSortState(java.lang.String property)
Description copied from interface: ISortableDataProvider
Gets the sort state of a property

Specified by:
getSortState in interface ISortableDataProvider
Parameters:
property - sort property to be checked
Returns:
1 if ascending, -1 if descending, 0 if none
See Also:
ISortableDataProvider.getSortState(String)


Copyright © 2004-2006 . All Rights Reserved.