Class BaseDNTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.opends.guitools.controlpanel.datamodel.SortableTableModel
-
- org.opends.guitools.controlpanel.datamodel.BaseDNTableModel
-
- All Implemented Interfaces:
Serializable,Comparator<BaseDNDescriptor>,TableModel
public class BaseDNTableModel extends SortableTableModel implements Comparator<BaseDNDescriptor>
The table model used to display all the base DNs.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringNOT_AVAILABLEKey value to identify the case of a value not available.static StringNOT_AVAILABLE_AUTHENTICATION_REQUIREDKey value to identify the case of a value not available because authentication is required.static StringNOT_AVAILABLE_SERVER_DOWNKey value to identify the case of a value not available because the server is down.-
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
-
Constructor Summary
Constructors Constructor Description BaseDNTableModel(boolean displayReplicationInformation)Constructor for this table model.BaseDNTableModel(boolean displayReplicationInformation, boolean wrapHeader)Constructor for this table model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(BaseDNDescriptor desc1, BaseDNDescriptor desc2)Comparable implementation.voidforceResort()Updates the table model contents and sorts its contents depending on the sort options set by the user.intgetColumnCount()StringgetColumnName(int col)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<BaseDNDescriptor> newData, ServerDescriptor.ServerStatus status, boolean isAuthenticated)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
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Field Detail
-
NOT_AVAILABLE_SERVER_DOWN
public static final String NOT_AVAILABLE_SERVER_DOWN
Key value to identify the case of a value not available because the server is down.- See Also:
- Constant Field Values
-
NOT_AVAILABLE_AUTHENTICATION_REQUIRED
public static final String NOT_AVAILABLE_AUTHENTICATION_REQUIRED
Key value to identify the case of a value not available because authentication is required.- See Also:
- Constant Field Values
-
NOT_AVAILABLE
public static final String NOT_AVAILABLE
Key value to identify the case of a value not available.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BaseDNTableModel
public BaseDNTableModel(boolean displayReplicationInformation)
Constructor for this table model.- Parameters:
displayReplicationInformation- whether to display replication. monitoring information or not.
-
BaseDNTableModel
public BaseDNTableModel(boolean displayReplicationInformation, boolean wrapHeader)Constructor for this table model.- Parameters:
displayReplicationInformation- whether to display replication.wrapHeader- whether to wrap the headers or not. monitoring information or not.
-
-
Method Detail
-
setData
public void setData(Set<BaseDNDescriptor> newData, ServerDescriptor.ServerStatus status, boolean isAuthenticated)
Sets the data for this table model.- Parameters:
newData- the data for this table model.status- the server status.isAuthenticated- whether the user provided authentication or not.
-
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
-
compare
public int compare(BaseDNDescriptor desc1, BaseDNDescriptor desc2)
Comparable implementation.- Specified by:
comparein interfaceComparator<BaseDNDescriptor>- Parameters:
desc1- the first replica descriptor to compare.desc2- the second replica descriptor to compare.- Returns:
- 1 if according to the sorting options set by the user the first base DN descriptor must be put before the second descriptor, 0 if they are equivalent in terms of sorting and -1 if the second descriptor must be put before the first descriptor.
-
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()
Description copied from class:SortableTableModelReturns whether the sort is ascending or descending.- Specified by:
isSortAscendingin classSortableTableModel- Returns:
trueif the sort is ascending andfalseotherwise.
-
setSortAscending
public void setSortAscending(boolean sortAscending)
Description copied from class:SortableTableModelSets whether to sort ascending of descending.- Specified by:
setSortAscendingin classSortableTableModel- Parameters:
sortAscending- whether to sort ascending or descending.
-
getSortColumn
public int getSortColumn()
Description copied from class:SortableTableModelReturns the column index used to sort.- Specified by:
getSortColumnin classSortableTableModel- Returns:
- the column index used to sort.
-
setSortColumn
public void setSortColumn(int sortColumn)
Description copied from class:SortableTableModelSets the column index used to sort.- Specified by:
setSortColumnin classSortableTableModel- Parameters:
sortColumn- column index used to sort..
-
-