Class SortableTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.opends.guitools.controlpanel.datamodel.SortableTableModel
-
- All Implemented Interfaces:
Serializable,TableModel
- Direct Known Subclasses:
AbstractIndexTableModel,BaseDNTableModel,ConnectionHandlersMonitoringTableModel,ConnectionHandlerTableModel,DatabaseMonitoringTableModel,TaskTableModel
public abstract class SortableTableModel extends AbstractTableModel
A generic interface that must implement table models that are sortable.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description SortableTableModel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidforceResort()Updates the table model contents and sorts its contents depending on the sort options set by the user.protected StringgetHeader(org.forgerock.i18n.LocalizableMessage msg)Returns the header wrapped with the default line width.protected StringgetHeader(org.forgerock.i18n.LocalizableMessage msg, int wrap)Returns the header wrapped with a certain line width.abstract intgetSortColumn()Returns the column index used to sort.abstract booleanisSortAscending()Returns whether the sort is ascending or descending.abstract voidsetSortAscending(boolean sortAscending)Sets whether to sort ascending of descending.abstract voidsetSortColumn(int sortColumn)Sets the column index used to sort.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.table.TableModel
getColumnCount, getRowCount, getValueAt
-
-
-
-
Method Detail
-
isSortAscending
public abstract boolean isSortAscending()
Returns whether the sort is ascending or descending.- Returns:
trueif the sort is ascending andfalseotherwise.
-
setSortAscending
public abstract void setSortAscending(boolean sortAscending)
Sets whether to sort ascending of descending.- Parameters:
sortAscending- whether to sort ascending or descending.
-
getSortColumn
public abstract int getSortColumn()
Returns the column index used to sort.- Returns:
- the column index used to sort.
-
setSortColumn
public abstract void setSortColumn(int sortColumn)
Sets the column index used to sort.- Parameters:
sortColumn- column index used to sort..
-
forceResort
public abstract void forceResort()
Updates the table model contents and sorts its contents depending on the sort options set by the user.
-
getHeader
protected String getHeader(org.forgerock.i18n.LocalizableMessage msg)
Returns the header wrapped with the default line width.- Parameters:
msg- the header message value (with no HTML formatting).- Returns:
- the header wrapped with the default line width.
-
getHeader
protected String getHeader(org.forgerock.i18n.LocalizableMessage msg, int wrap)
Returns the header wrapped with a certain line width.- Parameters:
msg- the header message value (with no HTML formatting).wrap- the maximum line width before wrapping.- Returns:
- the header wrapped with the specified line width.
-
-