Class AbstractIndexTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.opends.guitools.controlpanel.datamodel.SortableTableModel
-
- org.opends.guitools.controlpanel.datamodel.AbstractIndexTableModel
-
- All Implemented Interfaces:
Serializable,Comparator<AbstractIndexDescriptor>,TableModel
- Direct Known Subclasses:
IndexTableModel,VLVIndexTableModel
public abstract class AbstractIndexTableModel extends SortableTableModel implements Comparator<AbstractIndexDescriptor>
Table Model used to store information about indexes. It is used basically by the tables that appear on the right side of the 'Manage Indexes...' dialog when the user clicks on 'Indexes' or 'VLV Indexes'.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleansortAscendingWhether the sorting is ascending or descending.protected intsortColumnThe sort column of the table.-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description AbstractIndexTableModel()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected intcompareNames(AbstractIndexDescriptor i1, AbstractIndexDescriptor i2)Compares the names of the two indexes.protected intcompareRebuildRequired(AbstractIndexDescriptor i1, AbstractIndexDescriptor i2)Compares the rebuild messages for the two indexes.voidforceResort()Updates the table model contents and sorts its contents depending on the sort options set by the user.intgetColumnCount()StringgetColumnName(int col)protected abstract String[]getColumnNames()Returns the column names of the table.AbstractIndexDescriptorgetIndexAt(int row)Returns the index in the specified row.protected abstract String[]getLine(AbstractIndexDescriptor index)Returns the different cell values for a given index in a String array.protected org.forgerock.i18n.LocalizableMessagegetRebuildRequiredString(AbstractIndexDescriptor index)Returns the message to be displayed in the cell if an index must be rebuilt.intgetRowCount()intgetSortColumn()Returns the column index used to sort.ObjectgetValueAt(int row, int col)booleanisSortAscending()Returns whether the sort is ascending or descending.voidsetData(Set<AbstractIndexDescriptor> newData, ControlPanelInfo info)Sets the data for this table model.voidsetSortAscending(boolean sortAscending)Sets whether to sort ascending of descending.voidsetSortColumn(int sortColumn)Sets the column index used to sort.-
Methods inherited from class org.opends.guitools.controlpanel.datamodel.SortableTableModel
getHeader, getHeader
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, 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 java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Method Detail
-
setData
public void setData(Set<AbstractIndexDescriptor> newData, ControlPanelInfo info)
Sets the data for this table model.- Parameters:
newData- the data for this table model.info- the control panel info.
-
forceResort
public void forceResort()
Updates the table model contents and sorts its contents depending on the sort options set by the user.- Specified by:
forceResortin classSortableTableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCountin interfaceTableModel
-
getRowCount
public int getRowCount()
- Specified by:
getRowCountin interfaceTableModel
-
getValueAt
public Object getValueAt(int row, int col)
- Specified by:
getValueAtin interfaceTableModel
-
getColumnName
public String getColumnName(int col)
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
isSortAscending
public boolean isSortAscending()
Returns whether the sort is ascending or descending.- Specified by:
isSortAscendingin classSortableTableModel- Returns:
trueif the sort is ascending andfalseotherwise.
-
setSortAscending
public void setSortAscending(boolean sortAscending)
Sets whether to sort ascending of descending.- Specified by:
setSortAscendingin classSortableTableModel- Parameters:
sortAscending- whether to sort ascending or descending.
-
getSortColumn
public int getSortColumn()
Returns the column index used to sort.- Specified by:
getSortColumnin classSortableTableModel- Returns:
- the column index used to sort.
-
setSortColumn
public void setSortColumn(int sortColumn)
Sets the column index used to sort.- Specified by:
setSortColumnin classSortableTableModel- Parameters:
sortColumn- column index used to sort..
-
getIndexAt
public AbstractIndexDescriptor getIndexAt(int row)
Returns the index in the specified row.- Parameters:
row- the row.- Returns:
- the index in the specified row.
-
getRebuildRequiredString
protected org.forgerock.i18n.LocalizableMessage getRebuildRequiredString(AbstractIndexDescriptor index)
Returns the message to be displayed in the cell if an index must be rebuilt.- Parameters:
index- the index to be analyzed.- Returns:
- the message to be displayed in the cell if an index must be rebuilt.
-
compareNames
protected int compareNames(AbstractIndexDescriptor i1, AbstractIndexDescriptor i2)
Compares the names of the two indexes.- Parameters:
i1- the first index.i2- the second index.- Returns:
- the alphabetical comparison of the names of both indexes.
-
compareRebuildRequired
protected int compareRebuildRequired(AbstractIndexDescriptor i1, AbstractIndexDescriptor i2)
Compares the rebuild messages for the two indexes.- Parameters:
i1- the first index.i2- the second index.- Returns:
- the alphabetical comparison of the rebuild required message of both indexes.
-
getColumnNames
protected abstract String[] getColumnNames()
Returns the column names of the table.- Returns:
- the column names of the table.
-
getLine
protected abstract String[] getLine(AbstractIndexDescriptor index)
Returns the different cell values for a given index in a String array.- Parameters:
index- the index.- Returns:
- the different cell values for a given index in a String array.
-
-