JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.swing
Interface JCRowSortModel

All Known Subinterfaces:
JCRowSortTableModel
All Known Implementing Classes:
DefaultRowSortTableModel, TreeTableSupport, TreeWithSortableChildren

public interface JCRowSortModel

Interface to specify methods for a sortable rows datasource.


Field Summary
static int FORWARD
          Valid value for SortOrder.
static int REVERSE
          Valid value for SortOrder.
 
Method Summary
 boolean getAutoSort()
          Returns whether the data is automatically sorted according to the current comparator whenever a data change occurs.
 int[] getKeyColumns(int column)
          Returns the key columns used to sort the table model when clicking on the specified column.
 int getSortColumn()
          Gets the sorting column.
 int getSortOrder()
          Gets the sorting order to use the next time a sort is performed.
 boolean isDataSorted()
          Returns whether or not the data set is currently sorted.
 void setAutoSort(boolean autoSort)
          Sets whether the data should be automatically sorted when it changes.
 void setDataSorted(boolean sorted)
          Sorts data by current column if set to true and the data needs sorting; returns the data set to its native unsorted state if set to false.
 void setKeyColumns(int column, int[] keyColumns)
          Sets the key columns used to sort the table model when clicking on a specified column.
 void setSortColumn(int column)
          Sets the column to use the next time a sort is performed.
 void setSortOrder(int order)
          Sets the sorting order.
 void toggleSortOrder()
          Toggles the sorting order.
 

Field Detail

FORWARD

public static final int FORWARD
Valid value for SortOrder.

See Also:
Constant Field Values

REVERSE

public static final int REVERSE
Valid value for SortOrder.

See Also:
Constant Field Values
Method Detail

getAutoSort

public boolean getAutoSort()
Returns whether the data is automatically sorted according to the current comparator whenever a data change occurs.

Returns:
whether data is automatically sorted

setAutoSort

public void setAutoSort(boolean autoSort)
Sets whether the data should be automatically sorted when it changes.

Parameters:
autoSort -

setKeyColumns

public void setKeyColumns(int column,
                          int[] keyColumns)
Sets the key columns used to sort the table model when clicking on a specified column.

Parameters:
column - index of column in TableModel
keyColumns - columns to use as keys to sort when sorting on the specified column

getKeyColumns

public int[] getKeyColumns(int column)
Returns the key columns used to sort the table model when clicking on the specified column. If the user has not set the key columns, this returns an array of length 1 with the specified column as the only member.

Parameters:
column -
Returns:
key columns

isDataSorted

public boolean isDataSorted()
Returns whether or not the data set is currently sorted.

Returns:
whether or not the data set is currently sorted

setDataSorted

public void setDataSorted(boolean sorted)
Sorts data by current column if set to true and the data needs sorting; returns the data set to its native unsorted state if set to false.

Parameters:
sorted -

getSortColumn

public int getSortColumn()
Gets the sorting column. This should return -1 if the data is unsorted.

Returns:
sorting column

setSortColumn

public void setSortColumn(int column)
Sets the column to use the next time a sort is performed.

Parameters:
column - only valid column indicies are allowed

getSortOrder

public int getSortOrder()
Gets the sorting order to use the next time a sort is performed.

Returns:
sorting order

setSortOrder

public void setSortOrder(int order)
Sets the sorting order.

Parameters:
order -

toggleSortOrder

public void toggleSortOrder()
Toggles the sorting order.


Copyright © 2004 Quest Software Inc..
All rights reserved.