Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.ui.web.model.impl
Class AbstractSortableSelectDataModel

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by org.nuxeo.ecm.platform.ui.web.model.impl.SelectDataModelImpl
          extended by org.nuxeo.ecm.platform.ui.web.model.impl.AbstractSortableSelectDataModel
All Implemented Interfaces:
Serializable, SelectDataModel, SortableDataModel
Direct Known Subclasses:
SortableSelectDocumentDataModelImpl

public abstract class AbstractSortableSelectDataModel
extends SelectDataModelImpl
implements SortableDataModel

Provides support for sorting table models. Inspired from Tomahawk examples. Abstract method design pattern.

Author:
Razvan Caraghin
See Also:
Serialized Form

Field Summary
static int SORT_ASCENDING
           
static int SORT_DESCENDING
           
 
Method Summary
 String getSort()
           
 boolean isAscending()
           
abstract  boolean isDefaultAscending(String sortColumn)
          Is the default sort direction for the given column "ascending"?
 void setAscending(boolean ascending)
           
 void setSort(String sort)
           
 void sort(String sortColumn)
           
abstract  void sort(String column, boolean ascending)
          Sorts the list.
 
Methods inherited from class org.nuxeo.ecm.platform.ui.web.model.impl.SelectDataModelImpl
addSelectModelListener, getName, getRowCount, getRowData, getRowIndex, getRows, getSelectModelListeners, getWrappedData, isRowAvailable, removeSelectModelListener, setRowIndex, setRows, setWrappedData
 
Methods inherited from class javax.faces.model.DataModel
addDataModelListener, getDataModelListeners, removeDataModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SORT_ASCENDING

public static final int SORT_ASCENDING
See Also:
Constant Field Values

SORT_DESCENDING

public static final int SORT_DESCENDING
See Also:
Constant Field Values
Method Detail

sort

public abstract void sort(String column,
                          boolean ascending)
Sorts the list. Should be implemented by the children to customize the sort (what comparators should be used, what other condition must be met).

Specified by:
sort in interface SortableDataModel

isDefaultAscending

public abstract boolean isDefaultAscending(String sortColumn)
Is the default sort direction for the given column "ascending"?

Specified by:
isDefaultAscending in interface SortableDataModel

sort

public void sort(String sortColumn)
Specified by:
sort in interface SortableDataModel

getSort

public String getSort()
Specified by:
getSort in interface SortableDataModel

setSort

public void setSort(String sort)
Specified by:
setSort in interface SortableDataModel

isAscending

public boolean isAscending()
Specified by:
isAscending in interface SortableDataModel

setAscending

public void setAscending(boolean ascending)
Specified by:
setAscending in interface SortableDataModel

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.