Interface SortableTableModel

    • Method Detail

      • setUnsortedModel

        void setUnsortedModel​(TableModel value)
        Sets the base model to use.
        Parameters:
        value - the base model
      • getUnsortedModel

        TableModel getUnsortedModel()
        returns the underlying model, can be null.
        Returns:
        the current model
      • setCaseSensitive

        void setCaseSensitive​(boolean value)
        Sets whether the sorting is case-sensitive.
        Parameters:
        value - true if case-sensitive
      • isCaseSensitive

        boolean isCaseSensitive()
        Returns whether the sorting is case-sensitive.
        Returns:
        true if case-sensitive
      • isSorted

        boolean isSorted()
        returns whether the table was sorted.
        Returns:
        true if the table was sorted
      • getSortColumn

        int getSortColumn()
        Returns the sort column.
        Returns:
        the sort column
      • isAscending

        boolean isAscending()
        Returns whether sorting is ascending or not.
        Returns:
        true if ascending
        See Also:
        isSorted(), getSortColumn()
      • getActualRow

        int getActualRow​(int visibleRow)
        Returns the actual underlying row the given visible one represents. Useful for retrieving "non-visual" data that is also stored in a TableModel.
        Parameters:
        visibleRow - the displayed row to retrieve the original row for
        Returns:
        the original row
      • getDisplayRow

        int getDisplayRow​(int internalRow)
        Returns the "visible" row derived from row in the actual table model.
        Parameters:
        internalRow - the row in the actual model
        Returns:
        the row in the sorted model, -1 in case of an error
      • sort

        void sort​(int columnIndex)
        sorts the table over the given column (ascending).
        Parameters:
        columnIndex - the column to sort over
      • sort

        void sort​(int columnIndex,
                  boolean ascending)
        sorts the table over the given column, either ascending or descending.
        Parameters:
        columnIndex - the column to sort over
        ascending - ascending if true, otherwise descending