Documentation of 'org.jdesktop.swingx.sort.TableSortController' Java class
TableSortController
org.jdesktop.swingx.sort

Class TableSortController<M extends javax.swing.table.TableModel>

  • All Implemented Interfaces:
    SortController<M>


    public class TableSortController<M extends javax.swing.table.TableModel>
    extends DefaultSortController<M>
    A SortController to use for a JXTable.

    • Constructor Detail

      • TableSortController

        public TableSortController()
      • TableSortController

        public TableSortController(M model)
        Parameters:
        model -
    • Method Detail

      • setModel

        public void setModel(M model)
        Sets the TableModel to use as the underlying model for this TableRowSorter. A value of null can be used to set an empty model.
        Parameters:
        model - the underlying model to use, or null
      • getComparator

        public java.util.Comparator<?> getComparator(int column)
        Returns the Comparator for the specified column. If a Comparator has not been specified using the setComparator method a Comparator will be returned based on the column class (TableModel.getColumnClass) of the specified column. If the column class is String, Collator.getInstance is returned. If the column class implements Comparable a private Comparator is returned that invokes the compareTo method. Otherwise Collator.getInstance is returned.

        PENDING JW: think about implications to string value lookup!

        Specified by:
        getComparator in interface SortController<M extends javax.swing.table.TableModel>
        Overrides:
        getComparator in class javax.swing.DefaultRowSorter<M extends javax.swing.table.TableModel,java.lang.Integer>
        Parameters:
        column - the column to fetch the Comparator for, in terms of the underlying model
        Returns:
        the Comparator for the specified column
        Throws:
        java.lang.IndexOutOfBoundsException - if column is outside the range of the underlying model

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.