|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISortableTableModel
An interface to allow you to implement sorting feature on any table model.
Nested Class Summary | |
---|---|
static class |
ISortableTableModel.SortItem
|
Field Summary | |
---|---|
static int |
SORT_PRIORITY_FIFO
|
static int |
SORT_PRIORITY_FILO
|
Method Summary | |
---|---|
void |
addSortListener(SortListener l)
Adds the specified listener to receive SortEvents pane events from this SortableTableModel. |
int |
getActualRowAt(int row)
Gets the actual row. |
int |
getColumnSortRank(int column)
In the case of sort by multiple columns, this method will return the rank of this column within all sorted columns. |
int[] |
getMasterSortColumns()
Gets the master sort columns. |
int |
getMaximumSortColumns()
Gets the maximum columns can be sorted at once. |
int |
getSortedRowAt(int actualRow)
Gets the visual row. |
List<ISortableTableModel.SortItem> |
getSortingColumns()
Gets the sorting columns. |
SortListener[] |
getSortListeners()
Returns an array of all the SortListener s added to this SortableTableModel with
addSortListener . |
int |
getSortPriority()
Gets the sort priority. |
boolean |
isColumnAscending(int column)
Checks if the column is sorted ascendingly. |
boolean |
isColumnSortable(int column)
Check if a certain column is sortable. |
boolean |
isColumnSorted(int column)
Checks if the column is sorted. |
boolean |
isMultiColumnSortable()
Does this table allow sort by multiple columns. |
boolean |
isSortable()
Checks if the sortable table model is sortable. |
void |
removeSortListener(SortListener l)
Removes the specified SortListener so that it no longer receives SortEvents from this SortableTableModel . |
void |
reset()
Resets. |
void |
resort()
Resort the table. |
void |
reverseColumnSortOrder(int column)
Reverses the sort order of the column. |
void |
setColumnSortable(int column,
boolean sortable)
Sets a column sortable or not sortable. |
void |
setMasterSortColumns(int[] masterSortColumns)
Sets the master sort column. |
void |
setMaximumSortColumns(int maximumSortColumns)
Set the maximum number of columns that can be sorted at once. |
void |
setMultiColumnSortable(boolean multiColumnSortable)
Set the value if this table allows sort by multiple columns. |
void |
setSortable(boolean sortable)
Sets the table model sortable. |
void |
setSortingColumns(List<ISortableTableModel.SortItem> list)
Sets the soring columns. |
void |
setSortPriority(int sortPriority)
Sets the sort priority. |
void |
sortColumn(int column)
Sort the column, equals to sortColumn(column, false). |
void |
sortColumn(int column,
boolean reset)
If reset is true, it will remove all existing sort-by columns and only sorts by column . |
void |
sortColumn(int column,
boolean reset,
boolean ascending)
Sorts a column. |
void |
toggleSortOrder(int column,
boolean extend)
Toggles the sort order on the specified column. |
void |
unsortColumn(int column)
Unsorts the column. |
Methods inherited from interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Field Detail |
---|
static final int SORT_PRIORITY_FILO
static final int SORT_PRIORITY_FIFO
Method Detail |
---|
int getSortedRowAt(int actualRow)
actualRow
- the actual row in actual model.
int getActualRowAt(int row)
row
- the row on the UI.
void sortColumn(int column)
column
- column to be sortedvoid sortColumn(int column, boolean reset)
column
. If reset is
false, it will keep existing sort-by columns and add the column
as a new sort-by column.
column
- the column index.reset
- true to reset all existing sorting columns before sorting the new column.void unsortColumn(int column)
column
- column to be removed from sort-by columnsvoid reverseColumnSortOrder(int column)
column
- the column index.void sortColumn(int column, boolean reset, boolean ascending)
column
- the column index.reset
- true to reset all existing sorting columns before sorting the new column.ascending
- true to sort ascending. False to sort descending.boolean isColumnSorted(int column)
column
- the column index.
boolean isColumnAscending(int column)
column
- the column index.
void reset()
void toggleSortOrder(int column, boolean extend)
column
- the column index.extend
- if true, extend the current sort to add more sorted columns.List<ISortableTableModel.SortItem> getSortingColumns()
void setSortingColumns(List<ISortableTableModel.SortItem> list)
list
- a list of SortItems.int getColumnSortRank(int column)
column
- the column index.
void setMasterSortColumns(int[] masterSortColumns)
masterSortColumns
- the new master sort columns.int[] getMasterSortColumns()
boolean isMultiColumnSortable()
void setMultiColumnSortable(boolean multiColumnSortable)
multiColumnSortable
- pass in true if this you want this table allows sort by multiple columnsboolean isColumnSortable(int column)
column
- the column index.
setColumnSortable(int,boolean)
void setColumnSortable(int column, boolean sortable)
column
- the column index.sortable
- true to make the column sortable.boolean isSortable()
void setSortable(boolean sortable)
toggleSortOrder(int,boolean)
will have no
effect.
sortable
- true or false.void resort()
void addSortListener(SortListener l)
l
- the SortListenervoid removeSortListener(SortListener l)
l
- the SortableTableModel listenerSortListener[] getSortListeners()
SortListener
s added to this SortableTableModel
with
addSortListener
.
SortListener
s added or an empty array if no listeners have been addedaddSortListener(com.jidesoft.grid.SortListener)
int getSortPriority()
SORT_PRIORITY_FILO
(the default) or
SORT_PRIORITY_FIFO
.void setSortPriority(int sortPriority)
sortPriority
- must be one the following value: SORT_PRIORITY_FILO (the default), or SORT_PRIORITY_FIFOint getMaximumSortColumns()
getSortPriority()
, the behavior is different. If sort priority is FILO,
nothing will happen when user tries to sort one column. If FIFO, it will push the column with the largest sort
rank out.
void setMaximumSortColumns(int maximumSortColumns)
maximumSortColumns
- the maximum number of columns that can be sorted at once.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |