SPT Core API

com.sptci.echo2.table
Class JDOFilterTableModel<F,D>

java.lang.Object
  extended by nextapp.echo2.app.table.AbstractTableModel
      extended by com.sptci.echo2.table.AbstractTableModel<D>
          extended by com.sptci.echo2.table.TableModel<D>
              extended by com.sptci.echo2.table.DefaultPageableTableModel<D>
                  extended by com.sptci.echo2.table.JDOTableModel<D>
                      extended by com.sptci.echo2.table.TransactionalJDOTableModel<D>
                          extended by com.sptci.echo2.table.JDOFilterTableModel<F,D>
Type Parameters:
F - The type of the filter class used to filter the data.
D - The type of the model object represented in the model.
All Implemented Interfaces:
PageableTableModel, SortableTableModel, Serializable, TableModel

public class JDOFilterTableModel<F,D>
extends TransactionalJDOTableModel<D>

A table model that uses the filter object to filter the data represented in the model.

© Copyright 2008 Sans Pareil Technologies, Inc.

Version:
$Id: JDOFilterTableModel.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2008-05-14
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.sptci.echo2.table.SortableTableModel
SortableTableModel.Direction
 
Field Summary
 
Fields inherited from class com.sptci.echo2.table.JDOTableModel
initialised, model, pm
 
Fields inherited from class com.sptci.echo2.table.DefaultPageableTableModel
page, pageSize, totalRows
 
Fields inherited from class com.sptci.echo2.table.TableModel
columns, data
 
Fields inherited from class com.sptci.echo2.table.AbstractTableModel
sortDirection, sortIndex
 
Constructor Summary
JDOFilterTableModel()
           
 
Method Summary
protected  void fetchSortedData()
          Fetch the data for the current DefaultPageableTableModel.page from the data store sorted by AbstractTableModel.sortIndex in AbstractTableModel.sortDirection.
protected  void fetchUnsortedData()
          Fetch the data for the current DefaultPageableTableModel.page from the data store.
 F getFilter()
          Return the filter object used in this table model.
 String getFilterField()
          Return the name of the field in JDOTableModel.model that filter represents.
protected  void initTotalRows()
          Initialise the DefaultPageableTableModel.totalRows field with the total number of persistent instances of JDOTableModel.model.
 void setFilter(F filter)
          Set the filter object used to filter the data set held in this model.
 void setFilterField(String filterField)
          Set the name of the field in JDOTableModel.model that filter represents.
 
Methods inherited from class com.sptci.echo2.table.TransactionalJDOTableModel
addRow, deleteRow, insertRow, updateRow
 
Methods inherited from class com.sptci.echo2.table.JDOTableModel
fetchData, fetchRepository, init, setPage, setPageSize, sort, sort, sortData
 
Methods inherited from class com.sptci.echo2.table.DefaultPageableTableModel
getPage, getPageSize, getTotalPages
 
Methods inherited from class com.sptci.echo2.table.TableModel
deleteRow, getColumnAnnotations, getColumnClass, getColumnCount, getColumnName, getObjectAt, getRowCount, getValueAt, processColumnAnnotations, processColumns, processColumnsAnnotation, processFields
 
Methods inherited from class com.sptci.echo2.table.AbstractTableModel
getSortDirection
 
Methods inherited from class nextapp.echo2.app.table.AbstractTableModel
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getEventListenerList, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sptci.echo2.table.SortableTableModel
getSortDirection
 

Constructor Detail

JDOFilterTableModel

public JDOFilterTableModel()
Method Detail

initTotalRows

protected void initTotalRows()
Initialise the DefaultPageableTableModel.totalRows field with the total number of persistent instances of JDOTableModel.model.

Overrides:
initTotalRows in class JDOTableModel<D>

fetchUnsortedData

protected void fetchUnsortedData()
Fetch the data for the current DefaultPageableTableModel.page from the data store. Note that this method assumes that clearing TableModel.data and firing table update events are handled by JDOTableModel.fetchData().

Overrides:
fetchUnsortedData in class JDOTableModel<D>
See Also:
JDOTableModel.setPageSize(int), JDOTableModel.setPage(int)

fetchSortedData

protected void fetchSortedData()
Fetch the data for the current DefaultPageableTableModel.page from the data store sorted by AbstractTableModel.sortIndex in AbstractTableModel.sortDirection. Note that this method assumes that clearing TableModel.data and firing table update events are handled by JDOTableModel.fetchData(). If the data store throws an exception when sorting using this method (complex sorting requires special JDOQL that is not supported by this method), then sorting is done through the JDOTableModel.sortData() method after refreshing the data using fetchUnsortedData().

Overrides:
fetchSortedData in class JDOTableModel<D>
See Also:
JDOTableModel.sort( int ), SortableTableModel.sort( int, Direction )

getFilter

public F getFilter()
Return the filter object used in this table model.

Returns:
The filter object instance.

setFilter

public void setFilter(F filter)
Set the filter object used to filter the data set held in this model.

Parameters:
filter - The filter object to use.

getFilterField

public String getFilterField()
Return the name of the field in JDOTableModel.model that filter represents.

Returns:
The name of the field.

setFilterField

public void setFilterField(String filterField)
Set the name of the field in JDOTableModel.model that filter represents.

Parameters:
filterField - The name of the field to set.

SPT Core API