info.joseluismartin.gui
Class ModelRowSorter<M extends TableModel>

java.lang.Object
  extended by javax.swing.RowSorter<M>
      extended by info.joseluismartin.gui.ModelRowSorter<M>

public class ModelRowSorter<M extends TableModel>
extends RowSorter<M>

A RowSorter for server side sorting. No mapping between view columns and model columns are needed.

Since:
1.0
Author:
Jose Luis Martin - (jlm@joseluismartin.info)
See Also:
PageableTable

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.RowSorter
RowSorter.SortKey
 
Constructor Summary
ModelRowSorter(M tableModel)
           
 
Method Summary
 void allRowsChanged()
          
 int convertRowIndexToModel(int index)
          
 int convertRowIndexToView(int index)
          
 M getModel()
          
 int getModelRowCount()
          
 List<? extends RowSorter.SortKey> getSortKeys()
          
 int getViewRowCount()
          
 void modelStructureChanged()
          
 void rowsDeleted(int firstRow, int endRow)
          
 void rowsInserted(int firstRow, int endRow)
          
 void rowsUpdated(int firstRow, int endRow)
          
 void rowsUpdated(int firstRow, int endRow, int column)
          
 void setModel(M model)
           
 void setSortKeys(List<? extends RowSorter.SortKey> sortKeys)
           
 void toggleSortOrder(int column)
          
 
Methods inherited from class javax.swing.RowSorter
addRowSorterListener, fireRowSorterChanged, fireSortOrderChanged, removeRowSorterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelRowSorter

public ModelRowSorter(M tableModel)
Parameters:
tableModel -
Method Detail

allRowsChanged

public void allRowsChanged()

Specified by:
allRowsChanged in class RowSorter<M extends TableModel>

convertRowIndexToModel

public int convertRowIndexToModel(int index)

Specified by:
convertRowIndexToModel in class RowSorter<M extends TableModel>

convertRowIndexToView

public int convertRowIndexToView(int index)

Specified by:
convertRowIndexToView in class RowSorter<M extends TableModel>

getModel

public M getModel()

Specified by:
getModel in class RowSorter<M extends TableModel>

getModelRowCount

public int getModelRowCount()

Specified by:
getModelRowCount in class RowSorter<M extends TableModel>

getSortKeys

public List<? extends RowSorter.SortKey> getSortKeys()

Specified by:
getSortKeys in class RowSorter<M extends TableModel>

getViewRowCount

public int getViewRowCount()

Specified by:
getViewRowCount in class RowSorter<M extends TableModel>

modelStructureChanged

public void modelStructureChanged()

Specified by:
modelStructureChanged in class RowSorter<M extends TableModel>

rowsDeleted

public void rowsDeleted(int firstRow,
                        int endRow)

Specified by:
rowsDeleted in class RowSorter<M extends TableModel>

rowsInserted

public void rowsInserted(int firstRow,
                         int endRow)

Specified by:
rowsInserted in class RowSorter<M extends TableModel>

rowsUpdated

public void rowsUpdated(int firstRow,
                        int endRow)

Specified by:
rowsUpdated in class RowSorter<M extends TableModel>

rowsUpdated

public void rowsUpdated(int firstRow,
                        int endRow,
                        int column)

Specified by:
rowsUpdated in class RowSorter<M extends TableModel>

toggleSortOrder

public void toggleSortOrder(int column)

Specified by:
toggleSortOrder in class RowSorter<M extends TableModel>

setModel

public void setModel(M model)
Parameters:
model - the model to set

setSortKeys

public void setSortKeys(List<? extends RowSorter.SortKey> sortKeys)
Specified by:
setSortKeys in class RowSorter<M extends TableModel>
Parameters:
sortKeys - the sortKeys to set


Copyright © 2013 JDAL. All Rights Reserved.